Skip to content

Instantly share code, notes, and snippets.

@eric-schleicher
Created January 10, 2018 19:43
Show Gist options
  • Save eric-schleicher/3cfb98989190abdfe72e4d19a975b418 to your computer and use it in GitHub Desktop.
Save eric-schleicher/3cfb98989190abdfe72e4d19a975b418 to your computer and use it in GitHub Desktop.
launch file
<launch>
<!-- Choose visualization -->
<arg name="rviz" default="false" />
<arg name="rtabmapviz" default="true" />
<!-- Corresponding config files -->
<arg name="rtabmapviz_cfg" default="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" />
<arg name="rviz_cfg" default="-d $(find rtabmap_ros)/launch/config/rgbd.rviz" />
<!-- Which image resolution to process in rtabmap: sd, qhd, hd -->
<arg name="resolution" default="sd" />
<arg name="frame_id" default="kinect2_base"/>
<!-- Synchronize kinect data before rtabmap node, generating single /rgbd_image topic -->
<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="load rtabmap_ros/rgbd_sync kinect2">
<remap from="rgb/image" to="/kinect2/$(arg resolution)/image_color_rect"/>
<remap from="depth/image" to="/kinect2/$(arg resolution)/image_depth_rect"/>
<remap from="rgb/camera_info" to="/kinect2/$(arg resolution)/camera_info"/>
<param name="approx_sync" value="false"/> <!-- exact synchronization -->
</node>
<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap" output="screen" args="--delete_db_on_start">
<!-- Remap topics -->
<param name="subscribe_depth" type="bool" value="false"/>
<param name="subscribe_rgbd" type="bool" value="true"/>
<param name="rgbd_cameras" type="int" value="1"/>
<remap from="rgbd_image0" to="/rgbd_image"/>
<!-- Frames: fixed frame is /map, base frame of lidar and kinect is /kinect2_ir_optical_frame -->
<param name="odom_frame_id" value="map"/>
<param name="frame_id" value="$(arg frame_id)"/>
<param name="publish_tf" value="false"/>
<!-- Disable loop closure detection -->
<param name="Kp/MaxFeatures" type="string" value="-1"/>
<!-- For laser assembler integration, use rate at which scans are assembled --> <!-- not sure if thie comment still valid -->
<param name="Rtabmap/DetectionRate" type="string" value="10"/>
</node>
<!-- Visualisation RTAB-Map -->
<node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="$(arg rtabmapviz_cfg)" output="screen">
<param name="subscribe_depth" type="bool" value="true"/>
<param name="subscribe_odom_info" type="bool" value="true"/>
<param name="approx_sync" type="bool" value="true"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<remap from="rgb/image" to="/kinect2/$(arg resolution)/image_color_rect"/>
<remap from="depth/image" to="/kinect2/$(arg resolution)/image_depth_rect"/>
<remap from="rgb/camera_info" to="/kinect2/$(arg resolution)/camera_info"/>
</node>
</launch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment