rtabmap:turtlebot with stereo images

asked 2018-01-18 13:32:46 -0600

zahra.kh gravatar image

updated 2018-01-18 13:44:19 -0600

jayess gravatar image

Hi,

I am using rtabmap_ros on a Turtlebot in Gazebo. I have successfully created the map with rtabmap_ros for stereo images by using of this launch file link text . Now, I would like to do the navigation with a known map. for this purpose my launch file is this:

<launch>

<!--For turtlebot in simulation (Gazebo):
         $ roslaunch turtlebot_gazebo turtlebot_world.launch
         $ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
         -->

  <arg name="database_path"     default="rtabmap.db"/>
  <arg name="rgbd_odometry"     default="false"/>
  <arg name="rtabmapviz"        default="false"/>
  <arg name="localization"      default="false"/>
  <arg     if="$(arg localization)" name="args"  default=""/>
  <arg unless="$(arg localization)" name="args"  default="--delete_db_on_start"/>
  <arg name="wait_for_transform"  default="0.2"/> 



   <!-- stereo_20Hz directory -->

   <arg name="dir"        default="$(env HOME)/Downloads/stereo_20Hz" />

   <!-- Choose visualization -->

   <arg name="rate"       default="20" />

    <!-- Run stereo_sequence_publisher to publish synchronized images -->
   <node name="stereo_pub" pkg="bag_tools" type="stereo_sequence_publisher.py" output="screen">
      <param name="image_dir_left"         value="$(arg dir)/left"/>
      <param name="image_dir_right"        value="$(arg dir)/right"/>
      <param name="file_pattern"           value="*.jpg"/>
      <param name="camera_info_file_left"  value="$(arg dir)/stereo_20Hz_ros_left.yaml"/>
      <param name="camera_info_file_right" value="$(arg dir)/stereo_20Hz_ros_right.yaml"/>
      <param name="frequency"              value="$(arg rate)"/>
      <remap from="/stereo_camera/left/image_color"  to="/stereo_camera/left/image_raw" />
      <remap from="/stereo_camera/right/image_color" to="/stereo_camera/right/image_raw" />
      <remap from="/stereo_camera/left/camera_info"  to="/stereo_camera/left/camera_info" />
      <remap from="/stereo_camera/right/camera_info" to="/stereo_camera/right/camera_info" />
   </node>

<!-- rotate camera so z axis is up and x forward. -->
   <arg name="pi/2" value="1.5707963267948966" />
   <node pkg="tf" type="static_transform_publisher" name="camera_base_link" args="0 0 0 -$(arg pi/2) 0 -$(arg pi/2) camera_link stereo_20Hz_left 100" />

   <!-- Run the ROS package stereo_image_proc for image rectification and disparity computation -->
   <group ns="/stereo_camera" >
      <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"/>
    <remap from="/disparity"  to="/stereo_camera/disparity" />
   </group>


<!-- Navigation stuff (move_base) -->
    <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>



<!-- Mapping -->
  <group ns="rtabmap">

    <node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg args)">
      <param name="database_path"       type="string" value="$(arg database_path)"/>
      <param name="frame_id"            type="string" value="base_footprint"/>
      <param name="odom_frame_id"       type="string" value="odom"/>
      <param name="wait_for_transform_duration"  type="double"   value="$(arg wait_for_transform)"/>
      <param name="subscribe_depth"     type="bool"   value="true"/>
      <param name="subscribe_scan"      type="bool"   value="true"/>

      <!-- inputs -->
      <remap from="scan"            to="/scan"/>
      <remap from="rgb/image"       to="/stereo_camera/left/image_rect"/>
      <remap from="depth/image"     to="/stereo_camera/depth"/>
      <remap from="rgb/camera_info" to="/stereo_camera/left/camera_info"/>

      <!-- output -->
      <remap from="grid_map" to="/map"/>

<!-- RTAB-Map's parameters: do "rosrun rtabmap rtabmap (double-dash)params" to see the list of available parameters. -->
      <param name="RGBD/ProximityBySpace"        type="string" value="true"/>   <!-- Local loop closure detection (using estimated position) with locations in WM -->
      <param name="RGBD/OptimizeFromGraphEnd"    type="string" value="false"/>  <!-- Set to false to generate map correction between /map and /odom -->
      <param name="Kp/MaxDepth"                  type="string" value="4.0"/>
      <param name="Reg/Strategy"                 type="string" value="0"/>      <!-- Loop closure transformation: 0=Visual, 1=ICP, 2=Visual+ICP -->
      <param name="Icp/CorrespondenceRatio"      type="string" value="0.3"/>
      <param name="Vis/MinInliers"               type="string" value ...
(more)
edit retag flag offensive close merge delete

Comments

also the previous map wasn't run.

zahra.kh gravatar image zahra.kh  ( 2018-01-18 13:34:27 -0600 )edit

i am new in ros and rtabmap and i don't know my launch file is ok or not. please help me for write correct launch file.

zahra.kh gravatar image zahra.kh  ( 2018-01-18 13:38:24 -0600 )edit

Please format your code/terminal output. Once you post your code/terminal output, highlight it then click the preformatted text (101010) button or press Ctrl-k. It's much easier to read with the text formatted.

jayess gravatar image jayess  ( 2018-01-18 13:43:00 -0600 )edit

I don't understand why you are publishing images from a directory while turtlebot is in a simulation environment. Can you add a stereo camera in Gazebo and subscribe to it instead? You may want to test this tutorial before integrating a stereo camera.

matlabbe gravatar image matlabbe  ( 2018-01-22 10:41:37 -0600 )edit

hi. i have stereo images that these save in directory. my purpose is path planning by using this stereo images. i am new in ros and rtabmap and I do not know how to do this. i studied rtabmap tutorials and by using this create map

zahra.kh gravatar image zahra.kh  ( 2018-01-22 13:38:17 -0600 )edit

but i don't know how i can create path planning. please help me matlabbe!

zahra.kh gravatar image zahra.kh  ( 2018-01-22 13:41:06 -0600 )edit

I suggest to familiarize with the RTAB-Map/Navigation with Turtlebot tutorial I provided, follow step 6 to bring up the simulation with rtabmap and navigation ready, then step 3 for path planning.

matlabbe gravatar image matlabbe  ( 2018-01-22 14:19:05 -0600 )edit

i studied RTAB-Map/Navigation with Turtlebot tutorial and according to this tutorial, i write launch file above. is my launch file ok for my purpose?

zahra.kh gravatar image zahra.kh  ( 2018-01-22 14:37:56 -0600 )edit