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

rtabmap+Turtlebot+stereo images

asked 2017-11-30 04:39:48 -0600

zahra.kh gravatar image

updated 2017-12-01 03:42:44 -0600

gvdhoorn gravatar image

hi, i am new in rtabmap and have a question . can i use the demo_turtlebot_mapping.launch for turtlebot in simulation (Gazebo) by use of stereo images?


Edit: hi matlabbe i change launch file according to your answer but the launch file have two error

<launch>

<!--For turtlebot in simulation (Gazebo):
         $ roslaunch turtlebot_gazebo turtlebot_world.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="15"/>      <!-- 3D visual words minimum inliers to accept loop ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-30 14:39:07 -0600

matlabbe gravatar image

updated 2017-12-01 18:09:29 -0600

Yes, but to keep fake laser scans like on turtlebot, you would need to use stereo_img_proc and disparity_to_depth to create a depth image (similar to this setup), so that you can use your stereo camera like a rgb-d camera (use rgb/depth inputs of rtabmap) and create the fake laser scan from it. Beware that to get a dense disparity image, a lot of texture is required in the simulated environment. You may want to simulate a RGB-D camera directly in the simulator instead.

EDIT: As stated in the warning, make sure these topics are published:

$ rostopic hz /stereo_camera/left/image_rect
$ rostopic hz /stereo_camera/depth
$ rostopic hz /stereo_camera/left/camera_info
$ rostopic hz /scan

cheers

edit flag offensive delete link more

Comments

thanks matlabbe. your answer is very good

zahra.kh gravatar image zahra.kh  ( 2017-12-01 00:52:22 -0600 )edit

hi matlabbe all topics are in launch file are published. but i don't know what is problem?

zahra.kh gravatar image zahra.kh  ( 2017-12-02 04:38:52 -0600 )edit

Do they have different fps?

matlabbe gravatar image matlabbe  ( 2017-12-02 11:26:32 -0600 )edit

how to check fps?

zahra.kh gravatar image zahra.kh  ( 2017-12-02 22:37:39 -0600 )edit

i used but error is not solve!

zahra.kh gravatar image zahra.kh  ( 2017-12-02 22:42:34 -0600 )edit

zahra.kh gravatar image zahra.kh  ( 2017-12-02 22:42:53 -0600 )edit

finally, i can create grid map. but the map is not good. for create good map which parameters must be changed?

zahra.kh gravatar image zahra.kh  ( 2017-12-02 23:30:49 -0600 )edit

this is my map, but is not good!!image description

zahra.kh gravatar image zahra.kh  ( 2017-12-02 23:46:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-30 04:39:48 -0600

Seen: 677 times

Last updated: Dec 02 '17