Merged master->ros2. Updated turtlebot3 RGB-D examples (added instructions to add depth camera instead of copying sdf from another project)

This commit is contained in:
matlabbe
2022-01-29 18:01:08 -05:00
18 changed files with 906 additions and 45 deletions
+21 -5
View File
@@ -1,6 +1,22 @@
# Requirements:
# Install Turtlebot3 packages
# Install https://github.com/mlherd/ros2_turtlebot3_waffle_intel_realsense
# Modify turtlebot3_waffle SDF:
# 1) Edit turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf
# 2) Add
# <joint name="camera_rgb_optical_joint" type="fixed">
# <parent>camera_rgb_frame</parent>
# <child>camera_rgb_optical_frame</child>
# <pose>0 0 0 -1.57079632679 0 -1.57079632679</pose>
# <axis>
# <xyz>0 0 1</xyz>
# </axis>
# </joint>
# 3) Rename <link name="camera_rgb_frame"> to <link name="camera_rgb_optical_frame">
# 4) Add <link name="camera_rgb_frame"/>
# 5) Change <sensor name="camera" type="camera"> to <sensor name="camera" type="depth">
# 6) Change image width/height from 1920x1080 to 640x480
# 7) Note that we can increase min scan range from 0.12 to 0.2 to avoid having scans
# hitting the robot itself
# Example:
# $ export TURTLEBOT3_MODEL=waffle
# $ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
@@ -8,7 +24,7 @@
# SLAM:
# $ ros2 launch rtabmap_ros turtlebot3_rgbd.launch.py
# OR
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint odom_topic:=/odom args:="-d" use_sim_time:=true rgb_topic:=/intel_realsense_r200_depth/image_raw depth_topic:=/intel_realsense_r200_depth/depth/image_raw camera_info_topic:=/intel_realsense_r200_depth/camera_info approx_sync:=true
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint odom_topic:=/odom args:="-d" use_sim_time:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info approx_sync:=true
#
# Navigation (install nav2_bringup package):
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
@@ -41,9 +57,9 @@ def generate_launch_description():
}
remappings=[
('rgb/image', '/intel_realsense_r200_depth/image_raw'),
('rgb/camera_info', '/intel_realsense_r200_depth/camera_info'),
('depth/image', '/intel_realsense_r200_depth/depth/image_raw')]
('rgb/image', '/camera/image_raw'),
('rgb/camera_info', '/camera/camera_info'),
('depth/image', '/camera/depth/image_raw')]
return LaunchDescription([
+23 -6
View File
@@ -1,6 +1,22 @@
# Requirements:
# Install Turtlebot3 packages
# Install https://github.com/mlherd/ros2_turtlebot3_waffle_intel_realsense
# Modify turtlebot3_waffle SDF:
# 1) Edit turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf
# 2) Add
# <joint name="camera_rgb_optical_joint" type="fixed">
# <parent>camera_rgb_frame</parent>
# <child>camera_rgb_optical_frame</child>
# <pose>0 0 0 -1.57079632679 0 -1.57079632679</pose>
# <axis>
# <xyz>0 0 1</xyz>
# </axis>
# </joint>
# 3) Rename <link name="camera_rgb_frame"> to <link name="camera_rgb_optical_frame">
# 4) Add <link name="camera_rgb_frame"/>
# 5) Change <sensor name="camera" type="camera"> to <sensor name="camera" type="depth">
# 6) Change image width/height from 1920x1080 to 640x480
# 7) Note that we can increase min scan range from 0.12 to 0.2 to avoid having scans
# hitting the robot itself
# Example:
# $ export TURTLEBOT3_MODEL=waffle
# $ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
@@ -8,7 +24,7 @@
# SLAM:
# $ ros2 launch rtabmap_ros turtlebot3_rgbd_sync.launch.py
# OR
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true approx_sync:=true odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1" use_sim_time:=true rgbd_sync:=true rgb_topic:=/intel_realsense_r200_depth/image_raw depth_topic:=/intel_realsense_r200_depth/depth/image_raw camera_info_topic:=/intel_realsense_r200_depth/camera_info
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true approx_sync:=true approx_rgbd_sync:=false odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true rgbd_sync:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info
#
# Navigation (install nav2_bringup package):
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
@@ -43,13 +59,14 @@ def generate_launch_description():
'Reg/Strategy':'1',
'Reg/Force3DoF':'true',
'RGBD/NeighborLinkRefining':'True',
'Grid/RangeMin':'0.2', # ignore laser scan points on the robot itself
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}
remappings=[
('rgb/image', '/intel_realsense_r200_depth/image_raw'),
('rgb/camera_info', '/intel_realsense_r200_depth/camera_info'),
('depth/image', '/intel_realsense_r200_depth/depth/image_raw')]
('rgb/image', '/camera/image_raw'),
('rgb/camera_info', '/camera/camera_info'),
('depth/image', '/camera/depth/image_raw')]
return LaunchDescription([
@@ -69,7 +86,7 @@ def generate_launch_description():
# Nodes to launch
Node(
package='rtabmap_ros', executable='rgbd_sync', output='screen',
parameters=[{'approx_sync':True, 'use_sim_time':use_sim_time, 'qos':qos}],
parameters=[{'approx_sync':False, 'use_sim_time':use_sim_time, 'qos':qos}],
remappings=remappings),
# SLAM Mode:
+5 -1
View File
@@ -1,5 +1,8 @@
# Requirements:
# Install Turtlebot3 packages
# Note that we can edit turtlebot3_gazebo/models/turtlebot_waffle/model.sdf
# to increase min scan range from 0.12 to 0.2 to avoid having scans
# hitting the robot itself
# Example:
# $ export TURTLEBOT3_MODEL=waffle
# $ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
@@ -7,7 +10,7 @@
# SLAM:
# $ ros2 launch rtabmap_ros turtlebot3_scan.launch.py
# OR
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true depth:=false approx_sync:=true odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1" use_sim_time:=true
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true depth:=false approx_sync:=true odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true
#
# Navigation (install nav2_bringup package):
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
@@ -41,6 +44,7 @@ def generate_launch_description():
'Reg/Strategy':'1',
'Reg/Force3DoF':'true',
'RGBD/NeighborLinkRefining':'True',
'Grid/RangeMin':'0.2', # ignore laser scan points on the robot itself
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}