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

Question about tf | problem with ar_pose reverse

asked 2014-11-25 22:38:52 -0500

green96 gravatar image

updated 2014-11-26 19:38:53 -0500

Hi, I successfully run ar_pose with tracking a single marker option. I also tried to run option: tracking the camera position (reverse), everything looks good, but I don't get image...

My topics exists but rviz says something different.

Please check this screen:

rostopic seems to be ok:

przemek@przem:~/tum_simulator_ws/src/ar_tools/ar_pose/launch$ rostopic list 

I get launch file from this repository

my launch looks:

  <node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find ar_pose)/launch/live_reverse.rviz"/>
  <node pkg="tf" type="static_transform_publisher" name="world_to_marker" 
    args="0 1 1 -1.57 3.14 -1.57 world ar_marker 10" />
  <node ns="camera" pkg="image_proc" type="image_proc" name="image_proc"/>
  <node ns="camera" pkg="uvc_camera" type="uvc_camera_node" name="uvc_camera_node"
    <param name="width" type="int" value="320" />
    <param name="height" type="int" value="240" />
    <param name="fps" type="int" value="30" />
    <param name="frame" type="string" value="camera" />
    <param name="device" type="string" value="/dev/video0" />
    <param name="camera_info_url" type="string"
      value="file://$(find ar_pose)/camera_calibration_rev.yaml" />
  <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false" output="screen">
    <param name="marker_pattern" type="string" value="data/4x4/4x4_19.patt"/>
    <param name="marker_width" type="double" value="152.4"/>
    <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"/>
    <param name="reverse_transform" type="bool" value="true"/>

Where did I make a mistake? please help.

edit retag flag offensive close merge delete


The camera image does not depend on ar_pose. Try running only the camera related nodes and see if it's solved.

Miquel Massot gravatar image Miquel Massot  ( 2014-11-26 11:40:52 -0500 )edit

When I use tracking a single marker option camera works excellent. When I use reverse option something is broken.

launch files compared:

green96 gravatar image green96  ( 2014-11-26 16:53:39 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2014-11-30 05:23:42 -0500

Miquel Massot gravatar image

The problem is that your launchfile is setting up a TF between world and camera, and the marker package is also trying to set up a TF between the marker and the camera, and camera cannot have two TF parents.

Remove that static tf publisher from the launchfile and the problem should be solved.

edit flag offensive delete link more

answered 2014-11-26 19:34:11 -0500

green96 gravatar image

updated 2014-11-26 19:40:24 -0500

Finally I have noticed that my problems are connected with strange behaviour of TF.

When I run for the first time launch ar_pose_single (camera frame) everything worked well. I was terminating this node and tried to run ar_reverse (tag framework) and it didn't work properly.

So, the rule is: reset roscore after runing the first note (it is impossible to run this nodes one after the other without reseting roscore )

Why it is happening? Is there any way to do this without this RESET (in one roscore section)?

edit flag offensive delete link more


Are you publishing any TF between world and camera?

Miquel Massot gravatar image Miquel Massot  ( 2014-11-27 02:17:19 -0500 )edit

Please check link

I think that TF is publishing to rviz, but I am not sure. Please precise your question.

I don't understand why there is option to use TF between world and cam. I would rather use it to get pose of cam in reference to marker and vice versa.

green96 gravatar image green96  ( 2014-11-27 06:24:42 -0500 )edit

Question Tools

1 follower


Asked: 2014-11-25 22:38:52 -0500

Seen: 401 times

Last updated: Nov 30 '14