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

RTABMAP with multiple ZED stereo cameras

asked 2017-10-26 05:26:08 -0500

Cole gravatar image

Hi, I would like to use multiple ZED stereo cameras for the 3D mapping with RTABMAP. But I notice RTABMAP only supports single stereo camera or stereo camera+laser. Could anyone kindly give me some insights on how to do the multiple ZED cameras mapping? Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-10-26 11:59:42 -0500

matlabbe gravatar image

Hi,

Take a look at the multiple Kinect demo launch file.

You would have to remap rgb/depth/camera_info of the zed cameras. Another similar post for ZR300 cameras.

cheers

edit flag offensive delete link more

Comments

Hi Matlabbe,

Thank you so much for the insight. May I know if I would like to use the ZED odometry, how can I revise the launch file accordingly. :)

cheers

Cole gravatar image Cole  ( 2017-10-27 22:37:35 -0500 )edit

Remove rgbd_odometry node, then remap the zed's odom topic in rtabmap/rtabmapviz nodes: <remap from="odom" to="/zed_camera1/odom"/>

matlabbe gravatar image matlabbe  ( 2017-10-29 04:49:48 -0500 )edit

Hi Thank you for the help. I have rewritten the launch file and run the two cameras simultaneously. I paste the details in my own "answer". I am not sure if the "static_transform_publisher" node is correctly defined since for both cameras, I use the same child_frame_id "zed_center". Is it correct?

Cole gravatar image Cole  ( 2017-10-31 00:25:41 -0500 )edit

emm, I have tried to use the ZED odometry by removing the rgbd_odometry node and remap the "odom" as you suggested based on the same code in my own "answer". But I receive the error "TF of received depth image 0 at time 1509441479.227963s is not set!". I am not sure how to fix...

Cole gravatar image Cole  ( 2017-10-31 04:39:33 -0500 )edit

base_link ->zed_center, as you set, would put both cameras exactly superposed. You would also want to set base_frame (zed1_center and zed2_center), camera_frame and depth_frame of zed_camera.launch to something different for both cameras, otherwise you will have multiple TF having the same name

matlabbe gravatar image matlabbe  ( 2017-11-01 12:36:59 -0500 )edit
0

answered 2017-10-31 00:25:49 -0500

Cole gravatar image

updated 2017-11-01 12:33:01 -0500

matlabbe gravatar image

<launch>
<arg name="zed_rgbd_mode" default="true"/>

           <!-- Choose visualization -->
           <arg name="rviz"       default="false" />
           <arg name="rtabmapviz" default="true" /> 

           <!-- ODOMETRY MAIN ARGUMENTS: 
                -"strategy"        : Strategy: 0=Frame-to-Map 1=Frame-to-Frame
                -"feature"         : Feature type: 0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK
                -"nn"              : Nearest neighbor strategy : 0=Linear, 1=FLANN_KDTREE, 2=FLANN_LSH, 3=BRUTEFORCE 
                                     Set to 1 for float descriptor like SIFT/SURF                  
                                     Set to 3 for binary descriptor like ORB/FREAK/BRIEF/BRISK  
                -"max_depth"       : Maximum features depth (m)  
                -"min_inliers"     : Minimum visual correspondences to accept a transformation (m)  
                -"inlier_distance" : RANSAC maximum inliers distance (m)  
                -"local_map"       : Local map size: number of unique features to keep track 
                -"odom_info_data"  : Fill odometry info messages with inliers/outliers data.
            -->
           <arg name="strategy"        default="0" />
           <arg name="feature"         default="6" />
           <arg name="nn"              default="3" />
           <arg name="max_depth"       default="4.0" />
           <arg name="min_inliers"     default="20" />
           <arg name="inlier_distance" default="0.02" />
           <arg name="local_map"       default="1000" />
           <arg name="odom_info_data"  default="true" />
           <arg name="wait_for_transform"  default="true" />

          <group ns="/zed1" >

              <include file="$(find zed_wrapper)/launch/zed_camera.launch">
        <arg name="zed_id"                value="0" />
                 <arg name="publish_tf" value="false"/>
              </include> 

              <node unless="$(arg zed_rgbd_mode)" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
                 <remap from="left/image_raw"    to="left/image_rect_color"/>
                 <remap from="left/camera_info"  to="left/camera_info"/>
                 <remap from="right/image_raw"   to="right/image_rect_color"/>
                 <remap from="right/camera_info" to="right/camera_info"/>
                 <param name="disparity_range" value="200"/>
              </node>

              <node pkg="nodelet" type="nodelet" name="camera_nodelet_manager1"  args="manager"/>
              <node unless="$(arg zed_rgbd_mode)" pkg="nodelet" type="nodelet" name="disparity2depth" 
                 args="load rtabmap_ros/disparity_to_depth camera_nodelet_manager1"/>

              <node     if="$(arg zed_rgbd_mode)" pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync camera_nodelet_manager1">
                 <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"/>
                 <param name="approx_sync"     value="false"/>
              </node>
              <node unless="$(arg zed_rgbd_mode)" pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync camera_nodelet_manager1">
                 <remap from="rgb/image"       to="left/image_rect_color"/>
                 <remap from="depth/image"     to="depth"/>
                 <remap from="rgb/camera_info" to="left/camera_info"/>
                 <param name="approx_sync"     value="false"/>
              </node>

              <node pkg="tf" type="static_transform_publisher" name="base_to_camera1_tf"
              args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /zed_center 100" />
           </group>

         <group ns="/zed2" >

              <include file="$(find zed_wrapper)/launch/zed_camera.launch">
            <arg name="zed_id"                value="1" />
                 <arg name="publish_tf" value="false"/>
              </include> 

              <node unless="$(arg zed_rgbd_mode)" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
                 <remap from="left/image_raw"    to="left/image_rect_color"/>
                 <remap from="left/camera_info"  to="left/camera_info"/>
                 <remap from="right/image_raw"   to="right/image_rect_color"/>
                 <remap from="right/camera_info" to="right/camera_info"/>
                 <param name="disparity_range" value="200"/>
              </node>

              <node pkg="nodelet" type="nodelet" name="camera_nodelet_manager2"  args="manager"/>
              <node unless="$(arg zed_rgbd_mode)" pkg="nodelet" type="nodelet" name="disparity2depth" 
                 args="load rtabmap_ros/disparity_to_depth camera_nodelet_manager"/>

              <node     if="$(arg zed_rgbd_mode)" pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync camera_nodelet_manager2">
                 <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"/>
                 <param name="approx_sync"     value="false"/>
              </node>
              <node unless="$(arg zed_rgbd_mode ...
(more)
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-10-26 05:26:08 -0500

Seen: 1,380 times

Last updated: Nov 01 '17