Marker Visual Localization

The simulator session is not working, and it also cannot find the OpenCV and PyAprilTags modules (I was testing the demo code). The error message can be seen in the attached image.

code error:
line 3: unable to import ‘pyapriltags’
line 11: Module ‘cv2.cv2’ has no attribute ‘cvtColor’. (I wrote just one ‘cv2’, but the error shows ‘cv2.cv2’; I don’t know why.)

Which version of the Robotics Backend are you using?

You need to use one of the 4.7.X-beta docker images, the newest one is the 4.7.3-beta.

Also you cannot use NVIDIA gpu acceleration on this exercise (We are working on fixing this).

You can use this command to launch the Robotics Backend for this exercise:
docker run --rm -it --device /dev/dri -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend:4.7.3-beta

It seems that it still doesn’t work with 4.7.3-beta, but with 4.7.2-beta there is no problem.

2 Likes

Sorry for that, we still have not updated Unibotics to work with the latest docker image

1 Like

Okay, perfect. Thank you

Good to know, Thank you

Hello, with the new website update, the exercise has stopped working for me. Is there a specific version I need to install to ensure compatibility with the new version and the visual localization exercise? Also, when I check the locations of the AprilTags using the provided .yaml file for this exercise, the Z value of the tags (height) is 0, but according to the exercise, they should be at a height of 0.8 meters. Which one is correct?

Best regards, and thank you.

Have you tried with the brand new RoboticsBackend (4.8.0)?

The .yaml file does not contain any information about the height of the AprilTags. I have updated the documentation so this misunderstanding does not happen again

Hi, I just tested with that version, and it works correctly. Thanks

Okay, perfect. Thank you

There is an error in the example of the calculation of the camera’s intrinsic parameters. fx and fy are incorrect since they do not match the values returned using $ ros2 topic echo (camera_info_topic)
With the example:
Screenshot from 2025-02-28 10-26-58
With ros2 echo (k matrix):
Screenshot from 2025-02-28 10-35-16