0
$\begingroup$

Rosanswers logo


  • UPDATE - SOLVED

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.


Hi,

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!


Originally posted by Pedro on ROS Answers with karma: 102 on 2012-09-26

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by sniekum with karma: 101 on 2012-11-27

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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:

<launch>
    <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>
    </node>
</launch>

<launch>
    <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)" />
</launch>

I hope this helps.


Originally posted by Pedro with karma: 102 on 2012-11-27

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.