ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.