ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROS2 and AprilTag for object localization

asked 2023-03-22 14:08:46 -0500

WhateverKatzenfutter gravatar image

Hey Guys,

could someone of you please give me a helping hand and guide me trough my plan of my work with ROS2 and AprilTag for object localization?

At the current state I have a AprilTag on a cube (just for now on one of the faces) and I am already able to run AprilTag detection on ROS2 with the help of this package:

The AprilTag is already getting properly detected and I can extract all the data like the tf transformations, homography, position of the center and the corners of the AprilTag in the image plane.

I already use the given data and use it in RQT with this package…:

…to draw the corners and center points of the detected AprilTag and also its axis, with some other information.

Now to my problem and an possible plan…

I want to also detect the corners of the cube and draw them on the plane of the camera image in RQT, as I have done it with the AprilTag… But because I am a newbie in Computer Vision, I am not really sure, if I going the right way.

For solving my Problem I have created an URDF Model of the cube with the AprilTag on it and it mostly works fine (Still some issues with different orientation of the axis of the camera and the AprilTag Frame) and now I was thinking, if it is possible to calculate any point on the surface of the cube (on which the AprilTag is) via. tf2 and then just use homography to project the point of the 3D space into the 2D plane of the image to draw it with the Image Overlay in RQT?

I hope you guys will be able to understand my problem....I would love to add some picture, so you could understand it better, but sadly I have not enough karma.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2023-03-30 13:35:34 -0500

WhateverKatzenfutter gravatar image

I have finally got my idea done and its working like a charm.

Instead of solving the Homography Matrix by myself I used image_geometry::PinholeCameraModel to project the points from the 3D Space into the 2D image plane....

If someone is interested to know more about it, follow this link:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-03-22 05:27:21 -0500

Seen: 561 times

Last updated: Mar 30 '23