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

Ar_pose doesn't recognize tag in tum_simulator. Please help.

asked 2014-11-29 15:24:42 -0500

green96 gravatar image

updated 2014-12-04 09:16:46 -0500


I would like to use ar_pose with image from ardrone camera. I don't have real quadrotor, I am using tum_simulator with Gazebo.

My problem is that ar_pose doesn't recognize tags in simulation, so I have few questions:


Gazebo and ar_tag which I add image description

  1. Should I do camera calibration? (I don't have real cam, I am using cam which is in tum_simulator)
  2. What parameters should be set in ar_pose like: marker marker_width? (I am using tags in simulation)
  3. Why ar_pose doesn't recognize this tag?

EDIT: what I have done?

I have add two lines to launch file which is responsible for running Gazebo + tum_simulator + ardrone_autonomy

<remap from="/ardrone/camera_info" to="/camera/camera_info"/>
<remap from="/ardrone/image_raw" to="/camera/image_raw"/>

so when I launch this files I have above topics remapped:

next I launch ar_pose:


  <node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find ar_pose)/launch/live_single.rviz"/>
  <node pkg="tf" type="static_transform_publisher" name="world_to_cam" 
    args="0 0 0.5 -1.57 0 -1.57 world camera 10" />

  <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false"
    <param name="marker_pattern" type="string"
      value="$(find ar_pose)/data/4x4/4x4_19.patt"/>
    <param name="marker_width" type="double" value="200"/>
    <param name="marker_center_x" type="double" value="0.0"/>
    <param name="marker_center_y" type="double" value="0.0"/>
    <param name="threshold" type="int" value="100"/>
    <param name="use_history" type="bool" value="true"/>


RESULTS: screen from rviz (simulation) image description

(screen1) image description

Problem is that there is warming NO IMAGE RECEIVED and it is true. Preview from camera using 'CAMERA' gives black window, preview should be done with 'IMAGE'. AR_POSE uses this 'camera style' preview, no 'image style'. How to solve this problem? (screen2) image description

info from marker section: basic_shapes/1 For frame [ardrone_base_frontcam]: No transform to fixed frame [camera]. TF error: [Could not find a connection between 'camera' and 'ardrone_base_frontcam' because they are not part of the same tree.Tf has two or more unconnected trees.] (screen3) image description


it started working! I change fixed frame to ar_marker and it seems to be working! :)

but it gives me message in terminal:

[ERROR] [1417704617.003409185, 3461.051000000]: Ignoring transform for child_frame_id "ar_marker" from authority "unknown_publisher" because of a nan value in the transform (0.609564 -0.180967 -3.568543) (-nan -nan -nan -nan)
[ERROR] [1417704622.185442670, 3463.722000000]: Ignoring transform for child_frame_id "ar_marker" from authority "unknown_publisher" because of a nan value in the transform (0.984986 -0.604149 -2.678788) (nan nan nan nan)
[ERROR] [1417704623.374384366, 3464.377000000]: Ignoring transform for child_frame_id "ar_marker" from authority "unknown_publisher" because of a nan value in the transform (0.590453 -0.226787 -2.891703) (nan nan nan nan)

(screen4) image description

edit retag flag offensive close merge delete


Cześć, używasz ar_sys czy ar_pose ?

l0g1x gravatar image l0g1x  ( 2014-12-02 09:39:06 -0500 )edit

Cześć :) wolałbym pisać po ang ponieważ jest większe prawdop. że ktoś jeszcze może mi pomóc.

I am using ar_pose from this localisation: do you have any idea?

green96 gravatar image green96  ( 2014-12-02 11:45:58 -0500 )edit

nie ma sprawy. And i tried to use ar_pose but it was a little difficult to setup and it seems as if maintenance hasnt been done in a while . Not sure what changes where made on the fork you are using though. Have you looked at ar_sys? Just started to set it up myself

l0g1x gravatar image l0g1x  ( 2014-12-02 12:59:16 -0500 )edit

I haven't heard about this package before. You are using real camera or camera in gazebo simulator? Everything works fine?

Some time ago I found this repository:

I have calibrated ar_pose to my cam in laptop so I would rather don't change repository.

green96 gravatar image green96  ( 2014-12-04 08:25:01 -0500 )edit

3 Answers

Sort by » oldest newest most voted

answered 2014-12-01 13:29:40 -0500

I believe you've hit on the problem in #2: there needs to be a white border around the marker in order for it to be detected.

edit flag offensive delete link more


Agreed. This would cause a issue

l0g1x gravatar image l0g1x  ( 2014-12-02 14:00:07 -0500 )edit

I have added white borders to this tag, changed way of remapping and changed fixed frame. It works, I am a little bit surprised. Could you look at the error which I pasted at the bottom of the post?

green96 gravatar image green96  ( 2014-12-04 07:20:56 -0500 )edit

answered 2016-04-06 08:05:42 -0500

Hi green96, I'm trying to do the same as you. Can you tell me how you include a marker in gazebo? Thanks!

edit flag offensive delete link more

answered 2015-03-24 10:23:59 -0500

End-Effector gravatar image

I'm also working with Arucos I'm using the ar_sys package.

In simulation when you use gazebo you don't need to calibrate the camera, because all the camera matrix goes in the camera_info messages. But if you work with a real camera you will have to calibrate the camera.

You will have to define the size of the arucos, if you don't tell the size the program will detect the arucos but it wil give the wrong results. Like the real distance is 5meters it will tell you some other value.

edit flag offensive delete link more

Question Tools



Asked: 2014-11-29 15:24:42 -0500

Seen: 2,425 times

Last updated: Apr 06 '16