mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Added stereo_mapping.launch, updated bumblebee.launch(10 Hz throttle), set wait_for_transform=true by default for rtabmap, rtabmapviz and odometry nodes
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<arg name="scan_topic" default="/scan"/>
|
||||
|
||||
<arg name="namespace" default="rtabmap"/>
|
||||
<arg name="wait_for_transform" default="true"/>
|
||||
|
||||
<!-- Odometry parameters: -->
|
||||
<arg name="strategy" default="0" /> <!-- Strategy: 0=BOW (bag-of-words) 1=Optical Flow -->
|
||||
@@ -42,6 +43,8 @@
|
||||
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
|
||||
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<param name="Odom/Strategy" type="string" value="$(arg strategy)"/>
|
||||
<param name="Odom/FeatureType" type="string" value="$(arg feature)"/>
|
||||
<param name="OdomBow/NNType" type="string" value="$(arg nn)"/>
|
||||
@@ -55,9 +58,10 @@
|
||||
<!-- Visual SLAM (robot side) -->
|
||||
<!-- args: "delete_db_on_start" and "udebug" -->
|
||||
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
|
||||
<param name="subscribe_depth" type="bool" value="true"/>
|
||||
<param name="subscribe_scan" type="bool" value="$(arg subscribe_scan)"/>
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="subscribe_depth" type="bool" value="true"/>
|
||||
<param name="subscribe_scan" type="bool" value="$(arg subscribe_scan)"/>
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<remap from="rgb/image" to="$(arg rgb_topic)"/>
|
||||
<remap from="depth/image" to="$(arg depth_registered_topic)"/>
|
||||
@@ -82,6 +86,7 @@
|
||||
<param name="subscribe_scan" type="bool" value="$(arg subscribe_scan)"/>
|
||||
<param name="subscribe_odom_info" type="bool" value="$(arg odom_info_data)"/>
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<remap from="rgb/image" to="$(arg rgb_topic)"/>
|
||||
<remap from="depth/image" to="$(arg depth_registered_topic)"/>
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
|
||||
<launch>
|
||||
<!-- Your camera should be calibrated and publishing rectified left and right
|
||||
images + corresponding camera_info msgs. You can use stereo_image_proc for image rectification.
|
||||
Example:
|
||||
$ roslaunch rtabmap_ros bumblebee.launch -->
|
||||
|
||||
<!-- Choose visualization -->
|
||||
<arg name="rviz" default="false" />
|
||||
<arg name="rtabmapviz" default="true" />
|
||||
|
||||
<arg name="frame_id" default="base_link"/> <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
|
||||
<arg name="time_threshold" default="0"/> <!-- (ms) If not 0 ms, memory management is used to keep processing time on this fixed limit. -->
|
||||
<arg name="optimize_from_last_node" default="false"/> <!-- Optimize the map from the last node. Should be true on multi-session mapping and when time threshold is set -->
|
||||
|
||||
<arg name="left_image_topic" default="/stereo_camera/left/image_rect_color" />
|
||||
<arg name="right_image_topic" default="/stereo_camera/right/image_rect" /> <!-- using grayscale image for efficiency -->
|
||||
<arg name="left_camera_info_topic" default="/stereo_camera/left/camera_info" />
|
||||
<arg name="right_camera_info_topic" default="/stereo_camera/right/camera_info" />
|
||||
|
||||
<arg name="subscribe_scan" default="false"/> <!-- Assuming 2D scan if set, rtabmap will do 3DoF mapping instead of 6DoF -->
|
||||
<arg name="scan_topic" default="/scan"/>
|
||||
|
||||
<arg name="namespace" default="rtabmap"/>
|
||||
<arg name="wait_for_transform" default="true"/>
|
||||
|
||||
<!-- Odometry parameters: -->
|
||||
<arg name="strategy" default="0" /> <!-- Strategy: 0=BOW (bag-of-words) 1=Optical Flow -->
|
||||
<arg name="feature" default="6" /> <!-- Feature type: 0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK -->
|
||||
<arg name="Odom/EstimationType" default="1" /> <!-- Motion estimation approach: 0:3D->3D, 1:3D->2D (PnP) -->
|
||||
<arg name="nn" default="3" /> <!-- Nearest neighbor strategy : 0=Linear, 1=FLANN_KDTREE (SIFT, SURF), 2=FLANN_LSH, 3=BRUTEFORCE (ORB/FREAK/BRIEF/BRISK) -->
|
||||
<arg name="max_depth" default="10.0" /> <!-- Maximum features depth (m) -->
|
||||
<arg name="min_inliers" default="20" /> <!-- Minimum visual correspondences to accept a transformation (m) -->
|
||||
<arg name="inlier_distance" default="0.1" /> <!-- RANSAC maximum inliers distance (m) -->
|
||||
<arg name="local_map" default="1000" /> <!-- Local map size: number of unique features to keep track -->
|
||||
<arg name="odom_info_data" default="true" /> <!-- Fill odometry info messages with inliers/outliers data. -->
|
||||
|
||||
<!-- Nodes -->
|
||||
<group ns="$(arg namespace)">
|
||||
|
||||
<!-- Odometry -->
|
||||
<node pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen">
|
||||
<remap from="left/image_rect" to="$(arg left_image_topic)"/>
|
||||
<remap from="right/image_rect" to="$(arg right_image_topic)"/>
|
||||
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
||||
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
||||
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<param name="Odom/Strategy" type="string" value="$(arg strategy)"/>
|
||||
<param name="Odom/FeatureType" type="string" value="$(arg feature)"/>
|
||||
<param name="OdomBow/NNType" type="string" value="$(arg nn)"/>
|
||||
<param name="Odom/MaxDepth" type="string" value="$(arg max_depth)"/>
|
||||
<param name="Odom/MinInliers" type="string" value="$(arg min_inliers)"/>
|
||||
<param name="Odom/InlierDistance" type="string" value="$(arg inlier_distance)"/>
|
||||
<param name="OdomBow/LocalHistorySize" type="string" value="$(arg local_map)"/>
|
||||
<param name="Odom/FillInfoData" type="string" value="$(arg odom_info_data)"/>
|
||||
</node>
|
||||
|
||||
<!-- Visual SLAM (robot side) -->
|
||||
<!-- args: "delete_db_on_start" and "udebug" -->
|
||||
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
|
||||
<param name="subscribe_depth" type="bool" value="false"/>
|
||||
<param name="subscribe_stereo" type="bool" value="true"/>
|
||||
<param name="subscribe_scan" type="bool" value="$(arg subscribe_scan)"/>
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<remap from="left/image_rect" to="$(arg left_image_topic)"/>
|
||||
<remap from="right/image_rect" to="$(arg right_image_topic)"/>
|
||||
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
||||
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
||||
<remap from="scan" to="$(arg scan_topic)"/>
|
||||
|
||||
<param name="Rtabmap/TimeThr" type="string" value="$(arg time_threshold)"/>
|
||||
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="$(arg optimize_from_last_node)"/>
|
||||
<param name="LccBow/MinInliers" type="string" value="10"/>
|
||||
<param name="LccBow/InlierDistance" type="string" value="$(arg inlier_distance)"/>
|
||||
|
||||
<!-- when 2D scan is set -->
|
||||
<param if="$(arg subscribe_scan)" name="RGBD/OptimizeSlam2D" type="string" value="true"/>
|
||||
<param if="$(arg subscribe_scan)" name="RGBD/LocalLoopDetectionSpace" type="string" value="true"/>
|
||||
<param if="$(arg subscribe_scan)" name="LccIcp/Type" type="string" value="2"/>
|
||||
<param if="$(arg subscribe_scan)" name="LccIcp2/CorrespondenceRatio" type="string" value="0.25"/>
|
||||
</node>
|
||||
|
||||
<!-- Visualisation RTAB-Map -->
|
||||
<node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" output="screen">
|
||||
<param name="subscribe_depth" type="bool" value="false"/>
|
||||
<param name="subscribe_stereo" type="bool" value="true"/>
|
||||
<param name="subscribe_scan" type="bool" value="$(arg subscribe_scan)"/>
|
||||
<param name="subscribe_odom_info" type="bool" value="$(arg odom_info_data)"/>
|
||||
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
||||
<param name="wait_for_transform" type="bool" value="$(arg wait_for_transform)"/>
|
||||
|
||||
<remap from="left/image_rect" to="$(arg left_image_topic)"/>
|
||||
<remap from="right/image_rect" to="$(arg right_image_topic)"/>
|
||||
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
||||
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
||||
<remap from="scan" to="$(arg scan_topic)"/>
|
||||
</node>
|
||||
|
||||
</group>
|
||||
|
||||
<!-- Visualization RVIZ -->
|
||||
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find rtabmap_ros)/launch/config/rgbd.rviz"/>
|
||||
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="points_xyzrgb" args="standalone rtabmap_ros/point_cloud_xyzrgb">
|
||||
<remap from="left/image" to="$(arg left_image_topic)"/>
|
||||
<remap from="right/image" to="$(arg right_image_topic)"/>
|
||||
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
||||
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
||||
<remap from="cloud" to="voxel_cloud" />
|
||||
|
||||
<param name="decimation" type="double" value="2"/>
|
||||
<param name="voxel_size" type="double" value="0.02"/>
|
||||
</node>
|
||||
|
||||
</launch>
|
||||
@@ -15,10 +15,24 @@
|
||||
<node pkg="tf" type="static_transform_publisher" name="camera_base_link"
|
||||
args="$(arg optical_rotate) base_link stereo_camera 100" />
|
||||
|
||||
<!-- Run the ROS package stereo_image_proc -->
|
||||
<!-- Run the ROS package stereo_image_proc (throttle to 10 Hz to avoid rectifying all images) -->
|
||||
<group ns="/stereo_camera" >
|
||||
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/>
|
||||
<node pkg="nodelet" type="nodelet" name="disparity2depth" args="standalone rtabmap_ros/disparity_to_depth"/>
|
||||
<node pkg="nodelet" type="nodelet" name="stereo_throttle" args="standalone rtabmap_ros/stereo_throttle">
|
||||
<remap from="left/image" to="left/image_raw"/>
|
||||
<remap from="right/image" to="right/image_raw"/>
|
||||
<remap from="left/camera_info" to="left/camera_info"/>
|
||||
<remap from="right/camera_info" to="right/camera_info"/>
|
||||
|
||||
<param name="queue_size" type="int" value="10"/>
|
||||
<param name="rate" type="double" value="10"/>
|
||||
</node>
|
||||
|
||||
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc">
|
||||
<remap from="left/image_raw" to="left/image_raw_throttle"/>
|
||||
<remap from="left/camera_info" to="left/camera_info_throttle"/>
|
||||
<remap from="right/image_raw" to="right/image_raw_throttle"/>
|
||||
<remap from="right/camera_info" to="right/camera_info_throttle"/>
|
||||
</node>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ CoreWrapper::CoreWrapper(bool deleteDbOnStart) :
|
||||
odomFrameId_(""),
|
||||
configPath_(""),
|
||||
databasePath_(UDirectory::homeDir()+"/.ros/"+rtabmap::Parameters::getDefaultDatabaseName()),
|
||||
waitForTransform_(false),
|
||||
waitForTransform_(true),
|
||||
useActionForGoal_(false),
|
||||
genScan_(false),
|
||||
genScanMaxDepth_(4.0),
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ GuiWrapper::GuiWrapper(int & argc, char** argv) :
|
||||
app_(0),
|
||||
mainWindow_(0),
|
||||
frameId_("base_link"),
|
||||
waitForTransform_(false),
|
||||
waitForTransform_(true),
|
||||
cameraNodeName_(""),
|
||||
lastOdomInfoUpdateTime_(0),
|
||||
depthScanSync_(0),
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ OdometryROS::OdometryROS(int argc, char * argv[]) :
|
||||
odomFrameId_("odom"),
|
||||
groundTruthFrameId_(""),
|
||||
publishTf_(true),
|
||||
waitForTransform_(false),
|
||||
waitForTransform_(true),
|
||||
paused_(false)
|
||||
{
|
||||
this->processArguments(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user