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

ar_track_alvar problems with different resolutions

asked 2012-09-26 05:58:58 -0500

Pedro gravatar image

updated 2012-10-10 04:19:54 -0500


I didn't know, but if I change the camera resolution, the calibration needs to be done again. So I calibrated the camera again for the new resolution and the problem was solved.


I've been using ar_track_alvar with usb_cam and it works great, except when I don't choose the default video resolution in usb_cam (VGA). When I choose higher resolutions to try to improve ar_track_alvar's precision, the opposite happens, the markers are not detected accurately. And the markers in rviz appear distorted, they are not squares anymore... Anyone knows why this happens? Increasing video resolution should increase the markers detection precision, right?

Thanks in advance!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-11-27 20:42:34 -0500

Pedro gravatar image

Hi AnSooooo, I'm not sure whether using /torso_lift_link frame would cause the program to crash, but either way, I think you're supposed to use the camera frame, just don't forget to create a static tf transformation between the camera frame and an existing frame of your system. Also, make sure that the usb_cam node is publishing correctly with: rosrun image_view image_view image:=/usb_cam/image_raw

Here are my launch files for the usb_cam node and alvar:

    <node pkg="tf" type="static_transform_publisher" name="world_to_cam" 
    args="0 0 0.5 -1.57 0 -1.57 world usb_cam 10" />
    <node pkg="usb_cam" type="usb_cam_node" name="usb_cam">
    <param name="camera_frame_id" type="string" value="/usb_cam" />
    <param name="video_device" type="string" value="/dev/video0"/>
    <param name="image_width" type="int" value="1280" />
    <param name="image_height" type="int" value="720" />
    <param name="pixel_format" type="string" value="yuyv"/>
<rosparam param="D">[0.21582, -0.68937, -0.00314, -0.00033, 0.0]</rosparam>
<rosparam param="K">[1196.80797, 0.0, 608.49624, 0.0, 1187.99243, 379.59537, 0.0, 0.0, 1.0]</rosparam>
<rosparam param="R">[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]</rosparam>
<rosparam param="P">[1201.46741, 0.0, 604.19097, 0.0, 0.0, 1206.73816, 377.82261, 0.0, 0.0, 0.0, 1.0, 0.0]</rosparam>

    <arg name="marker_size" default="3.0" />
    <arg name="max_new_marker_error" default="0.08" />
    <arg name="max_track_error" default="0.2" />
    <arg name="cam_image_topic" default="/usb_cam/image_raw" />
    <arg name="cam_info_topic" default="/usb_cam/camera_info" />    
    <arg name="output_frame" default="/usb_cam" />

    <node name="ar_track_alvar" pkg="ar_track_alvar" type="individualMarkersNoKinect" respawn="false" output="screen" args="$(arg marker_size) $(arg max_new_marker_error) $(arg max_track_error) $(arg cam_image_topic) $(arg cam_info_topic) $(arg output_frame)" />

I hope this helps.

edit flag offensive delete link more

answered 2012-11-27 10:00:57 -0500

sniekum gravatar image

AnSooooo, it looks like you are trying to have it publish the markers poses in the /torso_lift_link frame, which may not exist if you aren't working on a PR2. Try publishing in a different frame.

edit flag offensive delete link more

answered 2012-11-22 04:37:56 -0500

AnSooooo gravatar image

Hi, I have trouble trying to use ar_track_alvar with usb_node. Don't know if you can help, but I did not find any other discussion about that... When I launch the node I get that :

core service [/rosout] found process[ar_track_alvar-1]: started with pid [1819] [ar_track_alvar-1] process has died [pid 1819, exit code -11, cmd /home/viki/ros_workspace/ar_track_alvar/bin/individualMarkersNoKinect 4.4 0.08 0.2 /usb_cam/image_raw /usb_cam/camera_info /torso_lift_link __name:=ar_track_alvar __log:=/home/viki/.ros/log/89dacf3e-34ac-11e2-9ff4-00031d09cf22/ar_track_alvar-1.log]. log file: /home/viki/.ros/log/89dacf3e-34ac-11e2-9ff4-00031d09cf22/ar_track_alvar-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done

Did you have problems using it at the beginning ?

Thanks a lot

edit flag offensive delete link more

Question Tools


Asked: 2012-09-26 05:58:58 -0500

Seen: 1,421 times

Last updated: Nov 27 '12