6DOF pose estimation with Aruco marker and ROS

ArUco is a simple yet great library for augmented reality applications. In this tutorial, I’m gonna show you how to track ArUco marker and estimate their 6DOF pose with ROS.

For this tutorial, you only need a USB camera. You need to calibrate your camera before first. If you don’ know how to that just follow my other tutorial on camera calibration with ROS.

1.So first let’s install the required packages:

2. You need two launch files, one of them will publish images from your USB cam:

 

save it under usb_cam_stream_publisher.launch

3.The other launch file will find the ArUco marker in the image and publish the 6DOF pose. So open your editor and paste the following into that:

 

save it under aruco_marker_finder.launch

4. Now start publishing images from your camera:

and find the markers:

5.To see the results, open rqt_gui:

6.The topic name of the pose of markers is   /aruco_single/pose. You can monitor it by:

7. Generate your aruco marker at:

http://terpconnect.umd.edu/~jwelsh12/enes100/markergen.html

special thanks to sauravag.com.

3.5 2 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

29 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Patrick
Patrick
6 years ago

Great Tutorial
Apt-Get makes it so easy 🙂

Please take a look at RVIZ output:
https://www.youtube.com/watch?v=oXNR8y4qIiI

Robot Geek
Robot Geek
6 years ago
Reply to  Patrick

I followed the steps shown here but in rqt window I do not see the tracking happening. I can see the image stream using topic /aruco_single/result but /aruco_single/pose provides no information. Can you please tell me what am i missing here?
Thank you

Gokul
Gokul
5 years ago
Reply to  Robot Geek

Do a successful calibration and make sure no error is happening when clicked Calibrate button. Then save and commit. I had the same issue and /aruco_single/pose topic gave me some 0.707 and nan values, when echoed. Now that the calibration.py got populated after calibration, everything works fine

furquan
furquan
1 year ago
Reply to  Gokul

i did my camera calibration still i dont get my pose topic not echoing, what is calibration.py

mohamed ehab hafez
mohamed ehab hafez
6 years ago

can I ask about the maximum range(distance from the camera) for the aruco marker detection at the same size?

Robot Geek
Robot Geek
6 years ago

I followed thr steps shown here but in rqt window I do not see the tracking happening. I can see the image stream using topic /aruco_single/result but /aruco_single/pose provides no information. Can you please tell me what am I missing here?

Thank you.

Robot Geek
Robot Geek
6 years ago
Reply to  admin

Thank you for the reponse. I have got it worked. Actually I printed the marker following 5 X 5 dictionary format instead of original Aruco dictionary format.

nana
nana
5 years ago

The pose of markers relative to which frame?

nana
nana
5 years ago

I have succeeded to detect the marker when the distance between the marker and the camera is 180 cm. But I want to detect the marker when the distance between the marker and the camera is 240 cm. How can I do that without changing the size of marker which I used

Sam
Sam
5 years ago

Hello Sir, I tried your tutorial and I got this error: TF_NAN_INPUT: Ignoring transform for child_frame_id “marker_frame” from authority “unknown_publisher” because of a nan value in the transform (-nan -nan -nan) (0.000000 0.707107 0.707107 0.000000)
at line 244 in /tmp/binarydeb/ros-kinetic-tf2-0.5.20/src/buffer_core.cpp

Do you have any idea how to fix it?

Angad
Angad
5 years ago
Reply to  Sam

I have the same issue

Gokul
Gokul
5 years ago
Reply to  Sam

Hey Sam

I had the same problem. Do proper calibration thinks are gonna work directly after that.
Link: https://ros-developer.com/2017/04/23/camera-calibration-with-ros/

Konstantin
Konstantin
5 years ago

Hi, you have a very cool project. Can you please tell at what angle the script can determine the marker?

Arghya Chatterjee
Arghya Chatterjee
5 years ago

Hello sir, I tried your tutorial. I installed Aruco_ros as you described. It’s installed from binary and I am comfortable with building from source. I am new to ROS. The problem that I am facing is that I am unable to go to the directory aruco_ros/launch and launch those 3 files. Please help!!!!

Kashif
Kashif
5 years ago

try “roscd aruco_ros ” you can find “launch” folder there. for launching those launch files ,simply type “roslaunch aruco_ros .launch := “.

Nana
Nana
5 years ago

I am using your package of aruco, when I change the matrix “rotate_to_ros” in “aruco_ros_utils.cpp” to be [1 0 0;0 0 1;0 1 0] I have the following error:
Error: TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id “marker_frame” from authority “unknown_publisher” because of an invalid quaternion in the transform (-0.029012 -0.264665 -0.742686 0.526990)
at line 257 in /tmp/binarydeb/ros-kinetic-tf2-0.5.20/src/buffer_core.cpp
could you help me please?

Cesar
Cesar
5 years ago

Anyone knows what is this problem about ?

WARNING: topic [/aruco_single] does not appear to be published yet
Sorry for this basic question, but i am still quite new in ROS, regards

Gokul
Gokul
5 years ago
Reply to  Cesar

Is your usb_cam_stream_publisher.launch file running without any errors?

Nana
Nana
5 years ago

Hello,
can I change the direction of axes to show them in a different way in rqt_gui?

Gokul
Gokul
5 years ago

I wonder how to convert the Quatranion to Eulers angles. I hope there is some problem in conventions. Can you help me with that.

Also is the distance w.r.t the camera to marker? I mainly require the angle in from camera to the fiducial so which all parameters to be used. Thanks in advance

musfik
musfik
2 years ago

hi i m also currently workin on same april tag and multiple mini robot. but i dont know how to control robot using apriltag via rviz. can you please help me out. i will be very thankful to youhttps://www.youtube.com/s/gaming/emoji/7ff574f2/emoji_u1f64f.png

omkar dandekar
omkar dandekar
2 years ago

Hello Admin, Thanks for sharing this content. I was able to detect the marker and want to subscribe to the pose estimation (x,y,z) of my drone (marker is placed on the Drone). Can you guide me to get those coordinates for my drone controlling script?
Thanks in advance

29
0
Would love your thoughts, please comment.x
()
x