turtulbot+rtabmap
hi i have stereo images that save in a directory. i used rtabmap_ros package and this launch file for created map and localization:
<launch>
<!-- stereo_20Hz directory -->
<arg name="dir" default="$(env HOME)/Downloads/stereo_20Hz" />
<!-- Choose visualization -->
<arg name="rviz" default="false" />
<arg name="rtabmapviz" default="true" />
<arg name="rate" default="20" />
<arg name="ground_is_obstacle" default="false"/>
<arg name="align_with_ground" default="false"/>
<!-- 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>
<!-- Run the ROS package stereo_image_proc for image rectification -->
<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"/>
</group>
<!-- 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" />
<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
<arg name="rtabmap_args" value="--delete_db_on_start --Rtabmap/CreateIntermediateNodes true --voxel_size 0.0 --Vis/EstimationType 1 --Vis/MinInliers 15 --SURF/HessianThreshold 100 --Grid/3DGroundIsObstacle $(arg ground_is_obstacle) --Odom/AlignWithGround $(arg align_with_ground)" />
<arg name="rviz" value="$(arg rviz)" />
<arg name="rtabmapviz" value="$(arg rtabmapviz)" />
<arg name="rgb_topic" value="/stereo_camera/left/image_rect" />
<arg name="depth_topic" value="/stereo_camera/depth_raw" />
<arg name="camera_info_topic" value="/stereo_camera/left/camera_info" />
</include>
</launch>
after mapping and saving it, i used demo_turtlebot_mapping.launch in rtabmap_ros package and changed this launch file for navigation:
<launch>
<!--
Bringup Turtlebot:
$ roslaunch turtlebot_bringup minimal.launch
Mapping:
$ roslaunch rtabmap_ros demo_turtlebot_mapping.launch
Visualization:
$ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
This launch file is a one to one replacement of the gmapping_demo.launch in the
"SLAM Map Building with TurtleBot" tutorial:
http://wiki.ros.org/turtlebot_navigation/Tutorials/indigo/Build%20a%20map%20with%20SLAM
For localization-only after a mapping session, add argument "localization:=true" to
demo_turtlebot_mapping.launch line above. Move the robot around until it can relocalize in
the previous map, then the 2D map should re-appear again. You can then follow the same steps
from 3.3.2 of the "Autonomous Navigation of a Known Map with TurtleBot" tutorial:
http://wiki.ros.org/turtlebot_navigation/Tutorials/Autonomously%20navigate%20in%20a%20known%20map
For turtlebot in simulation (Gazebo):
$ roslaunch turtlebot_gazebo turtlebot_world.launch
$ roslaunch rtabmap_ros demo_turtlebot_mapping.launch simulation:=true
$ 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 name="simulation" default="false"/>
<arg if="$(arg localization)" name="args" default=""/>
<arg unless="$(arg localization)" name="args" default="--delete_db_on_start"/>
<arg if="$(arg simulation)" name="rgb_topic" default="/stereo_camera ...