Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArUco Robot Localization #32

Merged
merged 97 commits into from
Nov 23, 2022
Merged

ArUco Robot Localization #32

merged 97 commits into from
Nov 23, 2022

Conversation

VladimirVincan
Copy link
Contributor

@VladimirVincan VladimirVincan commented Dec 9, 2021

ArUco marker numbers:

  • 11 to 50 - playing area, reserved:
    -- 47 - red sample
    -- 13 - blue sample
    -- 36 - green sample
    -- 17 - rock sample
    -- 42 - table
  • purple team:
    -- 1 to 5, given (on top of robots)
    -- 51 to 70, reserved
  • yellow team:
    -- 6 to 10, given (on top of robots)
    -- 71 to 90, reserved
  • 91+ - free

size:

  • samples - 5x5 cm
  • robots - 7x7 cm
  • table - 10x10 cm

NOTE:
priority is robot localization, not sample localization

TODO:

image

image

@VladimirVincan VladimirVincan added localization We need to estimate the position and orientation of the robot simulation The simulation will allow us to simulate robot dynamics, and sensors labels Dec 9, 2021
@lukicdarkoo lukicdarkoo marked this pull request as draft December 9, 2021 16:07
@lukicdarkoo lukicdarkoo added this to the 2022.2 milestone Jan 19, 2022
@VladimirVincan VladimirVincan changed the title Camera ArUco Robot Localization Mar 1, 2022
mep3_simulation/launch/simulation_launch.py Outdated Show resolved Hide resolved
mep3_simulation/launch/simulation_launch.py Outdated Show resolved Hide resolved
mep3_simulation/setup.py Outdated Show resolved Hide resolved
translation -0.1 1.00976 1.05
rotation 0.4472158700299192 0.4472128700307911 -0.7745957748866213 1.82349
children [
JetBotRaspberryPiCamera {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja bih da izbacimo ovaj PROTO, dovoljeno je samo Camera uredjaj da ubacimo. Simulacija bi trebalo da bude sto "laksa"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Da li si siguran u ovo? Pokušao sam sad da ubacim samo JetBotRasberryCamera.proto u eurobot_2023.wbt, nije mogla da se ubaci kamera, samo su se Transform-i ubacili.

WARNING: JetBotRaspberryPiCamera (PROTO): Skipped node: Cannot insert Camera node in 'children' field of Transform node that doesn't have a Robot ancestor.

mep3_localization/mep3_localization/.gitignore Outdated Show resolved Hide resolved
mep3_localization/launch/localization_launch.py Outdated Show resolved Hide resolved
@lukicdarkoo
Copy link
Member

image

Izgleda da je marker 22 okrenut naopacke. @VladimirVincan Mozes da provjeris sta se desava?

@lukicdarkoo
Copy link
Member

Kada robot predje preko (zakloni) markera koji se nalazi na podu cvor pukne sa sljedecom porukom:

$ ros2 run mep3_localization aruco_detector 
Gtk-Message: 17:54:14.693: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:54:14.693: Failed to load module "canberra-gtk-module"
Traceback (most recent call last):
  File "/memristor/ros2_ws/install/mep3_localization/lib/mep3_localization/aruco_detector", line 33, in <module>
    sys.exit(load_entry_point('mep3-localization==0.0.0', 'console_scripts', 'aruco_detector')())
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 336, in main
    rclpy.spin(aruco_detector)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
    executor.spin_once()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 712, in spin_once
    raise handler.exception()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
    self._handler.send(None)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
    await call_coroutine(entity, arg)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 343, in _execute_subscription
    await await_or_execute(sub.callback, msg)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
    return callback(*args)
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 121, in image_listener_callback
    self.find_map(transformation_matrices, ids)
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 222, in find_map
    camera_marker20_tf = transformation_matrices[ids_flattened.index(20)]
ValueError: 20 is not in list
[ros2run]: Process exited with failure 1

Copy link
Member

@lukicdarkoo lukicdarkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generalno je dobro, bitno nam je da imamo map -> maker transformacije sto nam je kriticno za EKF. Samo ispravi ove detalje pa da merge :)

mep3_localization/mep3_localization/aruco_detector.py Outdated Show resolved Hide resolved
mep3_localization/mep3_localization/aruco_detector.py Outdated Show resolved Hide resolved
@VladimirVincan
Copy link
Contributor Author

Kada robot predje preko (zakloni) markera koji se nalazi na podu cvor pukne sa sljedecom porukom:

$ ros2 run mep3_localization aruco_detector 
Gtk-Message: 17:54:14.693: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:54:14.693: Failed to load module "canberra-gtk-module"
Traceback (most recent call last):
  File "/memristor/ros2_ws/install/mep3_localization/lib/mep3_localization/aruco_detector", line 33, in <module>
    sys.exit(load_entry_point('mep3-localization==0.0.0', 'console_scripts', 'aruco_detector')())
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 336, in main
    rclpy.spin(aruco_detector)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
    executor.spin_once()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 712, in spin_once
    raise handler.exception()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
    self._handler.send(None)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
    await call_coroutine(entity, arg)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 343, in _execute_subscription
    await await_or_execute(sub.callback, msg)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
    return callback(*args)
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 121, in image_listener_callback
    self.find_map(transformation_matrices, ids)
  File "/memristor/ros2_ws/install/mep3_localization/lib/python3.10/site-packages/mep3_localization/aruco_detector.py", line 222, in find_map
    camera_marker20_tf = transformation_matrices[ids_flattened.index(20)]
ValueError: 20 is not in list
[ros2run]: Process exited with failure 1

Rešeno :)

Update description.
Check_alignment() now as input has a transformation matrix.
Fix static_tf_listener() - [q.w, q.x, q.y, q.z] and parent <- child order in lookup_transform().
@VladimirVincan
Copy link
Contributor Author

image

Izgleda da je marker 22 okrenut naopacke. @VladimirVincan Mozes da provjeris sta se desava?

Nemam odgovor zašto se sad pojavio a pre humble apdejta nije. Te rotacije su očekivane da će se dešavati tako da bih ovo zanemario, marker_[22] ne utiče ni na šta unutar algoritma za lokalizaciju. Mnogo je manja verovatnoća da će se to desiti nekom markeru bližem kameri.
Takođe, ako ovaj marker ostane pogrešno orijentisan, biće mi lakše da kasnije testiram algoritam za reorijentaciju markera.

Copy link
Member

@lukicdarkoo lukicdarkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To je to! Idemo na EKF i spustanje na SBC

@VladimirVincan VladimirVincan merged commit b97bf58 into main Nov 23, 2022
@VladimirVincan VladimirVincan deleted the camera branch November 23, 2022 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization We need to estimate the position and orientation of the robot simulation The simulation will allow us to simulate robot dynamics, and sensors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants