rtabmap_ros with Stereo Camera launch file and build a map, not working?
Hi
Im using two point Grey Chameleon3 mono camera set up as Master Salve and synchronized so can work as stereo camera. I have a installed ROS driver and able to publish the camera topics . Im using this ROS driver https://github.com/KumarRobotics/flea3. And
roslaunch flea3 stereo_node.launch left:=13344889 right:=14472242 for stereo camera/
then with
ROS_NAMESPACE=stereo rosrun stereo_image_proc stereo_image_proc
can rectify the stereo image , and can be seen with
rosrun image_view stereo_view stereo:=/stereo image:=image_rect_color
Then tried to use this rtabmap_ros launch file.
<launch>
<!-- Run the ROS package stereo_image_proc for image rectification and disparity computation -->
<group ns="stereo">
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/>
<!-- Disparity to depth -->
<node pkg="nodelet" type="nodelet" name="disparity2depth" args="standalone rtabmap_ros/disparity_to_depth"/>
</group>
<!-- Rotate the camera frame. -->
<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="camera_base_link"
args="$(arg optical_rotate) base_link stereo_camera 100" />
<group ns="rtabmap">
<!-- Visual SLAM -->
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<param name="subscribe_depth" type="bool" value="true"/>
<param name="subscribe_laserScan" type="bool" value="false"/>
<remap from="rgb/image" to="/stereo/left/image_rect"/>
<remap from="rgb/camera_info" to="/stereo/left/camera_info"/>
<remap from="depth/image" to="/stereo/depth"/>
<remap from="odom" to="/stereo_odometer/odometry"/>
<param name="frame_id" type="string" value="/base_link"/>
<param name="queue_size" type="int" value="30"/>
<param name="Rtabmap/TimeThr" type="string" value="700"/>
<param name="SURF/HessianThreshold" type="string" value="600"/>
<param name="Vis/MaxDepth" type="string" value="12"/>
<param name="Vis/MinInliers" type="string" value="10"/>
<param name="Vis/InlierDistance" type="string" value="0.05"/>
</node>
</group>
</launch>
i can not see any map. I got this warnings
[ WARN] [1533288718.609296364]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=30).
/rtabmap/rtabmap subscribed to (approx sync):
/stereo_odometer/odometry,
/stereo/left/image_rect,
/stereo/depth,
/stereo/left/camera_info
So, when rostopic hz to each topic rtabmap is subscribed to I got these:
rostopic hz /stereo_camera/right/image_rect
subscribed to [/stereo_camera/right/image_rect]
average rate: 7.658
min: 0.118s max: 0.156s std dev: 0.01260s window: 7
.......
rostopic hz /rtabmap/odom_info
subscribed to [/rtabmap/odom_info]
no new messages
no new messages
.......
rostopic hz /odom
subscribed to [/odom]
no new messages
no new messages
no new messages
Also I got this warnings now after change the camera name in my ROS driver. It was camera and now is stereo_camera.
[ WARN] [1533529654.855086737]: odometry: Could not get transform from base_link to /stereo_camera/left (stamp=1533529651.500643) after 3.200000 seconds ("wait_for_transform_duration"=3.200000)! Error="canTransform: source_frame stereo_camera/left does not exist.. canTransform returned after 3.21201 timeout was 3 ...
Can you do
rostopic hz
on each topic that rtabmap is subscribed to? You may also want to set approx_sync to false if left, depth and odometry messages have exactly the same stamps (to avoid synchronization issues).I edit the comments. Now got different warnings. Is it synchronization problem or? So basically no odometry topic is subscribed. Why?But still no map can show. Im holding the cameras so there is no robot. I just would like to have the map first , so which parameter need to set?
Show TF tree:
$ rosrun tf view_frames
. rtabmap won't start if odometry cannot be computed. In your case, odometry is failing because there is a missing TF.I run
$ rosrun tf view_frames
. I edit the comments is missing map->odom->base_link->camera. Is missing map->odom->. Any help?Where does
camera_link
->base_link
coming from?base_link
should be the root of the robot, asframe_id
is set to it. Your left image topic is publishing under/stereo_camera/left
frame, which doesn't exist. For thecamera_base_link
, you may setbase_link /stereo_camera/left
insteadYour launch file
<remap from="odom" to="/stereo_odometer/odometry"/>
. Are you starting stereo_odometry node from outside this launch file? Check if odom source is publishing correctly.And as @matlabbe mentioned, camera_link->base_link tf sounds bit confusing. Please check your tf tree is clean.
ok . I change it and edit the comments, The TF tree looks clean now. But I have thee problem still building the map. As I said I dont have the robot , just holding the cameras and would like to build the map while walking with the cameras in my hand
This tutorial is about hand-held stereo mapping.