Skip to content

Instantly share code, notes, and snippets.

@eric-schleicher
Created April 25, 2018 19:31
Show Gist options
  • Save eric-schleicher/6068b4ba1f20294d3084b8479776740e to your computer and use it in GitHub Desktop.
Save eric-schleicher/6068b4ba1f20294d3084b8479776740e to your computer and use it in GitHub Desktop.
with vizualization
<launch>
<!-- Choose visualization -->
<!--<arg name="rviz" default="false" />-->
<arg name="rtabmapviz" default="true"/>
<arg name="rgbd_kinect2" default="false"/>
<include if="$(arg rgbd_kinect2)" file="$(find kinect2_bridge)/launch/kinect2_bridge.launch"/>
<!-- 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="qhd"/>
<arg name="frame_id" default="kinect2_ir_optical_frame"/>
<!-- 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"/>
<remap from="depth/camera_info" to="/kinect2/$(arg resolution)/camera_info"/>
<param name="approx_sync" value="false"/> <!-- exact synchronization -->
</node>
<group ns="rtabmap">
<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_image" 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="odom_frame_id" value="world"/>
<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>
</group>
</launch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment