Chapter 10 Detecting and Tracking AR Tags--unable to accurately detect Marker ID numbers

59 views
Skip to first unread message

kf7...@gmail.com

unread,
Dec 4, 2016, 7:45:09 PM12/4/16
to ros-by-example
Hi Patrick,

I am working through your books, ROS by Example Indigo.

In Chapter 10 of Vol 2, you show how to use AR tags.

I have a 64-bit system, and am using Ubuntu 14.04 and ROS Indigo.  I had no problem installing the ar_track_alvar package.

I printed the file Markers_0_2.png that you provided and measured the markers.  Mine were approx 6.6 cm on each side like you had in your launch file. 

I have a Microsoft XBOX 360 (model 1414) and launched it with roslaunch freenect_launch freenect.launch.
I then opened another terminal and entered roslaunch rbx2_ar_tags ar_indiv_kinect.launch.

I have tried standing at all different distances from the XBOX 360 (making sure not to be closer than 0.5 meters) and find that the camera can see the Marker representing 0; however, it never correctly ID's the Markers for 1 or 2.  Instead, it reports completely inaccurate ID numbers ranging from 3 to the thousands as shown in the two .png files I attached.

I tried making small adjustments to the defaults for the max_new_marker_error and max_track_error (changing them through a range of 0.05 to 0.1) that are found in the rbx2_ar_tags ar_indiv_kinect.launch file with no improvements. I double-checked my topic defaults and the output frame I was using by running "rostopic list" and "rosrun tf view_frames", respectively.  The output frame is the camera_link.

I also covered up the Marker representing 0 and found that the camera never correctly identified either Marker 1 or 2.  In addition, I tried changing the lighting in the room and instead of just holding up the piece of paper with the markers printed on it, taped them to a poster board that was a solid light color so that there would be a consistent background.

Do you have any tips on how I might get the camera to recognize the correct ID numbers on the AR tags?
I was thinking it could also be the camera I am using.  Have you ever used an XBOX 360 model 1414  and had success identifying
Marker ID numbers?

Thank you. 

Debbie
markers_1.png
markers_2.png

Patrick Goebel

unread,
Dec 6, 2016, 9:55:55 AM12/6/16
to ros-by-...@googlegroups.com
Hi Debbie,

I just tried your setup using an Asus Xtion Pro camera which is all I
have available at the moment. (I don't own an XBOX 360 model 1414).
All three markers are identified correctly from various distances and
angles. So I would suspect that perhaps something isn't working as
expected with your XBOX 360. If you look at the ar_indiv_kinect.launch
file, you'll see that the image topic is expected to be
/camera/depth_registered/points so be sure you are getting a registered
depth cloud on this topic. You can test this as follows.

First make sure you are getting data on that topic:

$ rostopic echo -n 1 --noarr /camera/depth_registered/points

You should see something like this:

header:
seq: 10954
stamp:
secs: 1481035891
nsecs: 285965878
frame_id: camera_rgb_optical_frame
height: 480
width: 640
is_bigendian: False
point_step: 32
row_step: 20480
is_dense: False
---

Note how the resolution is 640x489 (VGA) which typically works well with
AR markers.

Next, bring up RViz and add a PointCloud2 display. Then point the topic
to /camera/depth_registered/points and set the Color Transformer to
RGB8. Finally, make sure the Fixed frame is set to camera_depth_frame.
You should then see the color depth cloud in RViz.

--patrick

--
The Pi Robot Project
http://www.pirobot.org/wordpress

Debbie Kretzschmar

unread,
Dec 6, 2016, 1:36:21 PM12/6/16
to ros-by-...@googlegroups.com
Hi Patrick,

Thank you very much for trying to help me.

I used the command  rostopic echo -n 1 --noarr /camera/depth_registered/points and got the same results as you.  Please see pic_1.png

Then I opened up rviz.  Pic_2.pgn shows you what I am seeing.  I had taped the paper with the ar tags onto a white poster board.

The only other thought I had was that I am using the calibration that came with the camera.  When I start the camera using "rosrun freenect_launch freenect.launch, the output shows that the default calibration is being used. (see pic 3)

I will find instructions on how to calibrate the camera and try again.

Thanks again for getting back to me and trying to help.

Debbie

--
You received this message because you are subscribed to the Google Groups "ros-by-example" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-by-example+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/ros-by-example.
For more options, visit https://groups.google.com/d/optout.

pic_1.png
pic_2.png
pic_3.png

Patrick Goebel

unread,
Dec 7, 2016, 9:26:07 AM12/7/16
to ros-by-...@googlegroups.com
Hi Debbie,

Everything looks OK on your system so I checked the Issue Tracker for ar_track_alvar and apparently there is a bug in the latest version (0.5.4) that is causing the problem you are seeing.  By chance I am using the previous version (0.5.3) so I did not experience the bug.

You can fix the problem by checking out the source and reverting to an earlier commit:

$ cd ~/catkin_ws/src
$ git clone https://github.com/sniekum/ar_track_alvar.git
$ cd ar_track_alvar
$ git checkout f9e9eb89adbd409d9d9a353ff1346e9581dfaedc
$ cd ~/catkin_ws
$ catkin_make
$ rospack profile

Markers should now be detected correctly.


--patrick

-- 
The Pi Robot Project
http://www.pirobot.org/wordpress

Debbie Kretzschmar

unread,
Dec 7, 2016, 1:14:09 PM12/7/16
to ros-by-...@googlegroups.com
Hi Patrick,

Success!!  I can see the correct ID numbers. Thank you so much.  It means a great deal to me to be able to get help as I go through your books.

Thanks again.

Debbie

Patrick Goebel

unread,
Dec 7, 2016, 5:36:32 PM12/7/16
to ros-by-...@googlegroups.com

Hi Debbie,

Great to hear it and glad to help!

--patrick

On 12/07/2016 10:14 AM, Debbie Kretzschmar wrote:
Hi Patrick,

Success!!  I can see the correct ID numbers. Thank you so much.  It means a great deal to me to be able to get help as I go through your books.

Thanks again.

Debbie

On Wed, Dec 7, 2016 at 7:25 AM, Patrick Goebel <pat...@pirobot.org> wrote:
Hi Debbie,

Everything looks OK on your system so I checked the Issue Tracker for ar_track_alvar and apparently there is a bug in the latest version (0.5.4) that is causing the problem you are seeing.  By chance I am using the previous version (0.5.3) so I did not experience the bug.

You can fix the problem by checking out the source and reverting to an earlier commit:

$ cd ~/catkin_ws/src
$ git clone https://github.com/sniekum/ar_track_alvar.git
$ cd ar_track_alvar
$ git checkout f9e9eb89adbd409d9d9a353ff1346e9581dfaedc
$ cd ~/catkin_ws
$ catkin_make
$ rospack profile

Markers should now be detected correctly.
On 12/04/2016 04:45 PM, kf7...@gmail.com wrote:
Hi Patrick,

I am working through your books, ROS by Example Indigo.

In Chapter 10 of Vol 2, you show how to use AR tags.

I have a 64-bit system, and am using Ubuntu 14.04 and ROS Indigo.  I had no problem installing the ar_track_alvar package.

I printed the file Markers_0_2.png that you provided and measured the markers.  Mine were approx 6.6 cm on each side like you had in your launch file.

I have a Microsoft XBOX 360 (model 1414) and launched it with roslaunch freenect_launch freenect.launch.
I then opened another terminal and entered roslaunch rbx2_ar_tags ar_indiv_kinect.launch.

I have tried standing at all different distances from the XBOX 360 (making sure not to be closer than 0.5 meters) and find that the camera can see the Marker representing 0; however, it never correctly ID's the Markers for 1 or 2.  Instead, it reports completely inaccurate ID numbers ranging from 3 to the thousands as shown in the two .png files I attached.

I tried making small adjustments to the defaults for the max_new_marker_error and max_track_error (changing them through a range of 0.05 to 0.1) that are found in the rbx2_ar_tags ar_indiv_kinect.launch file with no improvements. I double-checked my topic defaults and the output frame I was using by running "rostopic list" and "rosrun tf view_frames", respectively.  The output frame is the camera_link.

I also covered up the Marker representing 0 and found that the camera never correctly identified either Marker 1 or 2.  In addition, I tried changing the lighting in the room and instead of just holding up the piece of paper with the markers printed on it, taped them to a poster board that was a solid light color so that there would be a consistent background.

Do you have any tips on how I might get the camera to recognize the correct ID numbers on the AR tags?
I was thinking it could also be the camera I am using.  Have you ever used an XBOX 360 model 1414  and had success identifying
Marker ID numbers?

Thank you.

Debbie

-- 
The Pi Robot Project
http://www.pirobot.org/wordpress
Reply all
Reply to author
Forward
0 new messages