Re: zed camera frame won't rotate to map
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/zed-camera-frame-won-t-rotate-to-map-tp2712p2715.html
Hi,
Following this
tutorial with the ZED it works (using rtabmap's odometry), but trying to use ZED odometry like in your setup, I had difficulties too. The problem is that
zed_wrapper_node publishes camera info messages with the wrong "frame_id". Instead of "zed_current_frame", it should be "ZED_left_camera". You can change it
here.
So adding the right optical rotation, here is a minimal launch file (to use ZED's odometry):
<launch>
<arg name="camera" default="zed"/>
<arg name="pi/2" value="1.5707963267948966" />
<arg name="optical_rotate" value="0 0 0 -$(arg pi/2) 0 -$(arg pi/2)" />
<node pkg="tf" type="static_transform_publisher" name="$(arg camera)_base_link3"
args="$(arg optical_rotate) $(arg camera)_current_frame ZED_left_camera 100" />
<node name="zed_wrapper_node" pkg="zed_wrapper" type="zed_wrapper_node"/>
<node name="rviz" pkg="rviz" type="rviz" />
<group ns="rtabmap">
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<param name="frame_id" type="string" value="$(arg camera)_current_frame"/>
<remap from="rgb/image" to="/rgb/image_rect_color"/>
<remap from="depth/image" to="/depth/depth_registered"/>
<remap from="rgb/camera_info" to="/rgb/camera_info"/>
<remap from="odom" to="/odom"/>
</node>
</group>
</launch>
It is important that rtabmap node is subscribed to "/odom" (don't use "odom_frame_id" parameter) because zed_wrapper_node won't publish TF or estimate odometry if no one is connected on this topic.

cheers,
Mathieu