diff --git a/.devcontainer/jazzy/devcontainer.json b/.devcontainer/jazzy/devcontainer.json
index 5e768e9a..3cff6f58 100644
--- a/.devcontainer/jazzy/devcontainer.json
+++ b/.devcontainer/jazzy/devcontainer.json
@@ -22,6 +22,18 @@
},
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/ros2_ws/src/rtabmap_ros,type=bind",
"workspaceFolder": "/home/vscode/ros2_ws",
- "postCreateCommand": "echo 'Initialize: export MAKEFLAGS=\"-j6\" && colcon build --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release --parallel-workers 2'"
- //"runArgs": ["--privileged", "--runtime=nvidia", "--network=host"]
+ "postCreateCommand": "echo 'Initialize: export MAKEFLAGS=\"-j6\" && colcon build --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release --parallel-workers 2'",
+ "hostRequirements": {
+ "gpu": "optional"
+ },
+ "runArgs": ["--privileged",
+ "--network=host",
+ "--gpus=all",
+ //"--runtime=nvidia", // uncommment this if rtabmap doesn't show up in nvidia-smi on the host computer
+ "--env=DISPLAY",
+ "--env=QT_X11_NO_MITSHM=1",
+ "--volume=/tmp/.X11-unix:/tmp/.X11-unix"],
+ "containerEnv": {
+ "NVIDIA_VISIBLE_DEVICES": "all"
+ }
}
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd.launch.py
index b9076449..37d59c89 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd.launch.py
@@ -20,11 +20,13 @@ from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.substitutions import LaunchConfiguration
from launch.conditions import IfCondition, UnlessCondition
from launch_ros.actions import Node
+from launch.actions import OpaqueFunction
-def generate_launch_description():
+def launch_setup(context, *args, **kwargs):
use_sim_time = LaunchConfiguration('use_sim_time')
localization = LaunchConfiguration('localization')
+ max_ground_height = LaunchConfiguration('max_ground_height').perform(context)
parameters={
'frame_id':'base_footprint',
@@ -36,7 +38,7 @@ def generate_launch_description():
'Grid/3D':'false', # Use 2D occupancy
'Grid/RangeMax':'3',
'Grid/NormalsSegmentation':'false', # Use passthrough filter to detect obstacles
- 'Grid/MaxGroundHeight':'0.05', # All points above 5 cm are obstacles
+ 'Grid/MaxGroundHeight': str(max_ground_height), # All points above 5 cm are obstacles
'Grid/MaxObstacleHeight':'0.4', # All points over 1 meter are ignored
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
}
@@ -46,17 +48,7 @@ def generate_launch_description():
('rgb/camera_info', '/camera/camera_info'),
('depth/image', '/camera/depth/image_raw')]
- return LaunchDescription([
-
- # Launch arguments
- DeclareLaunchArgument(
- 'use_sim_time', default_value='true',
- description='Use simulation (Gazebo) clock if true'),
-
- DeclareLaunchArgument(
- 'localization', default_value='false',
- description='Launch in localization mode.'),
-
+ return [
# Nodes to launch
# SLAM mode:
@@ -98,4 +90,23 @@ def generate_launch_description():
remappings=[('cloud', '/camera/cloud'),
('obstacles', '/camera/obstacles'),
('ground', '/camera/ground')]),
- ])
+ ]
+
+def generate_launch_description():
+ return LaunchDescription([
+
+ # Launch arguments
+ DeclareLaunchArgument(
+ 'use_sim_time', default_value='true',
+ description='Use simulation (Gazebo) clock if true'),
+
+ DeclareLaunchArgument(
+ 'localization', default_value='false',
+ description='Launch in localization mode.'),
+
+ DeclareLaunchArgument(
+ 'max_ground_height', default_value='0.05',
+ description='Maximum ground height, everything above is obstacle'),
+
+ OpaqueFunction(function=launch_setup)
+ ])
\ No newline at end of file
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd_scan.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd_scan.launch.py
index 733330fc..030a6741 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd_scan.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_rgbd_scan.launch.py
@@ -20,12 +20,13 @@ from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.substitutions import LaunchConfiguration
from launch.conditions import IfCondition, UnlessCondition
from launch_ros.actions import Node
+from launch.actions import OpaqueFunction
-
-def generate_launch_description():
+def launch_setup(context, *args, **kwargs):
use_sim_time = LaunchConfiguration('use_sim_time')
localization = LaunchConfiguration('localization')
+ max_ground_height = LaunchConfiguration('max_ground_height').perform(context)
parameters={
'frame_id':'base_footprint',
@@ -42,7 +43,7 @@ def generate_launch_description():
'Grid/RangeMax':'3',
'Grid/NormalsSegmentation':'false', # Use passthrough filter to detect obstacles
'Grid/Sensor':'2', # Use both laser scan and camera for obstacle detection in global map
- 'Grid/MaxGroundHeight':'0.05', # All points above 5 cm are obstacles
+ 'Grid/MaxGroundHeight': str(max_ground_height), # All points above are obstacles
'Grid/MaxObstacleHeight':'0.4', # All points over 1 meter are ignored
'Grid/RangeMin':'0.2', # ignore laser scan points on the robot itself
'Optimizer/GravitySigma':'0' # Disable imu constraints (we are already in 2D)
@@ -53,17 +54,7 @@ def generate_launch_description():
('rgb/camera_info', '/camera/camera_info'),
('depth/image', '/camera/depth/image_raw')]
- return LaunchDescription([
-
- # Launch arguments
- DeclareLaunchArgument(
- 'use_sim_time', default_value='false',
- description='Use simulation (Gazebo) clock if true'),
-
- DeclareLaunchArgument(
- 'localization', default_value='false',
- description='Launch in localization mode.'),
-
+ return [
# Nodes to launch
Node(
package='rtabmap_sync', executable='rgbd_sync', output='screen',
@@ -109,4 +100,23 @@ def generate_launch_description():
remappings=[('cloud', '/camera/cloud'),
('obstacles', '/camera/obstacles'),
('ground', '/camera/ground')]),
- ])
+ ]
+
+def generate_launch_description():
+ return LaunchDescription([
+
+ # Launch arguments
+ DeclareLaunchArgument(
+ 'use_sim_time', default_value='true',
+ description='Use simulation (Gazebo) clock if true'),
+
+ DeclareLaunchArgument(
+ 'localization', default_value='false',
+ description='Launch in localization mode.'),
+
+ DeclareLaunchArgument(
+ 'max_ground_height', default_value='0.05',
+ description='Maximum ground height, everything above is obstacle'),
+
+ OpaqueFunction(function=launch_setup)
+ ])
\ No newline at end of file
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_demo.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_demo.launch.py
index ad14ca21..a4155c6a 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_demo.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_demo.launch.py
@@ -13,8 +13,30 @@
#
# 3) Rename to
# 4) Add
-# 5) Change to
-# 6) Change image width/height from 1920x1080 to 640x480
+# 5) Change image width/height from 1920x1080 to 640x480
+# 6) [ROS2 HUMBLE] Change to
+# 6) [ROS2 JAZZY] Change camera_rgb_frame to camera_rgb_optical_frame
+# 7) [ROS2 JAZZY] Add the following just after section
+#
+# true
+# true
+# 30
+# camera/depth/image_raw
+# camera_rgb_optical_frame
+#
+# camera/depth/camera_info
+# 1.02974
+#
+# 640
+# 480
+# R8G8B8
+#
+#
+# 0.02
+# 300
+#
+#
+#
# Example:
# $ ros2 launch rtabmap_demos turtlebot3_sim_rgbd_demo.launch.py
#
@@ -28,9 +50,12 @@ from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, Opaq
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare
+from launch_ros.actions import Node
import os
+ROS_DISTRO = os.environ.get('ROS_DISTRO')
+
def launch_setup(context, *args, **kwargs):
if not 'TURTLEBOT3_MODEL' in os.environ:
os.environ['TURTLEBOT3_MODEL'] = 'waffle'
@@ -45,9 +70,14 @@ def launch_setup(context, *args, **kwargs):
world = LaunchConfiguration('world').perform(context)
- nav2_params_file = PathJoinSubstitution(
- [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_nav2_params.yaml']
- )
+ if ROS_DISTRO == 'humble':
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'humble', 'turtlebot3_rgbd_nav2_params.yaml']
+ )
+ else:
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_nav2_params.yaml']
+ )
# Paths
gazebo_launch = PathJoinSubstitution(
@@ -60,13 +90,22 @@ def launch_setup(context, *args, **kwargs):
[pkg_rtabmap_demos, 'launch', 'turtlebot3', 'turtlebot3_rgbd.launch.py'])
# Includes
- gazebo = IncludeLaunchDescription(
+ gazebo = [IncludeLaunchDescription(
PythonLaunchDescriptionSource([gazebo_launch]),
launch_arguments=[
('x_pose', LaunchConfiguration('x_pose')),
('y_pose', LaunchConfiguration('y_pose'))
]
- )
+ )]
+ if ROS_DISTRO != 'humble':
+ start_gazebo_ros_depth_image_bridge_cmd = Node(
+ package='ros_gz_image',
+ executable='image_bridge',
+ arguments=['/camera/depth/image_raw'],
+ output='screen',
+ )
+ gazebo.append(start_gazebo_ros_depth_image_bridge_cmd)
+
nav2 = IncludeLaunchDescription(
PythonLaunchDescriptionSource([nav2_launch]),
launch_arguments=[
@@ -77,20 +116,25 @@ def launch_setup(context, *args, **kwargs):
rviz = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rviz_launch])
)
+
+ max_ground_height = '0.05'
+ if ROS_DISTRO == 'jazzy':
+ max_ground_height = '0.02' # for the demo, on new gazebo the depth is more accurate
+
rtabmap = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rtabmap_launch]),
launch_arguments=[
('localization', LaunchConfiguration('localization')),
- ('use_sim_time', 'true')
+ ('use_sim_time', 'true'),
+ ('max_ground_height', max_ground_height)
]
)
return [
# Nodes to launch
nav2,
rviz,
- rtabmap,
- gazebo
- ]
+ rtabmap
+ ] + gazebo
def generate_launch_description():
return LaunchDescription([
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_fake_scan_demo.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_fake_scan_demo.launch.py
index 314ad3eb..311edd68 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_fake_scan_demo.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_fake_scan_demo.launch.py
@@ -13,8 +13,30 @@
#
# 3) Rename to
# 4) Add
-# 5) Change to
-# 6) Change image width/height from 1920x1080 to 640x480
+# 5) Change image width/height from 1920x1080 to 640x480
+# 6) [ROS2 HUMBLE] Change to
+# 6) [ROS2 JAZZY] Change camera_rgb_frame to camera_rgb_optical_frame
+# 7) [ROS2 JAZZY] Add the following just after section (under same link)
+#
+# true
+# true
+# 30
+# camera/depth/image_raw
+# camera_rgb_optical_frame
+#
+# camera/depth/camera_info
+# 1.02974
+#
+# 640
+# 480
+# R8G8B8
+#
+#
+# 0.02
+# 300
+#
+#
+#
# Example:
# $ ros2 launch rtabmap_demos turtlebot3_sim_rgbd_fake_scan_demo.launch.py
#
@@ -28,9 +50,12 @@ from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, Opaq
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare
+from launch_ros.actions import Node
import os
+ROS_DISTRO = os.environ.get('ROS_DISTRO')
+
def launch_setup(context, *args, **kwargs):
if not 'TURTLEBOT3_MODEL' in os.environ:
os.environ['TURTLEBOT3_MODEL'] = 'waffle'
@@ -45,9 +70,14 @@ def launch_setup(context, *args, **kwargs):
world = LaunchConfiguration('world').perform(context)
- nav2_params_file = PathJoinSubstitution(
- [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_nav2_params.yaml']
- )
+ if ROS_DISTRO == 'humble':
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'humble', 'turtlebot3_rgbd_nav2_params.yaml']
+ )
+ else:
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_nav2_params.yaml']
+ )
# Paths
gazebo_launch = PathJoinSubstitution(
@@ -60,13 +90,22 @@ def launch_setup(context, *args, **kwargs):
[pkg_rtabmap_demos, 'launch', 'turtlebot3', 'turtlebot3_rgbd_fake_scan.launch.py'])
# Includes
- gazebo = IncludeLaunchDescription(
+ gazebo = [IncludeLaunchDescription(
PythonLaunchDescriptionSource([gazebo_launch]),
launch_arguments=[
('x_pose', LaunchConfiguration('x_pose')),
('y_pose', LaunchConfiguration('y_pose'))
]
- )
+ )]
+ if ROS_DISTRO != 'humble':
+ start_gazebo_ros_depth_image_bridge_cmd = Node(
+ package='ros_gz_image',
+ executable='image_bridge',
+ arguments=['/camera/depth/image_raw'],
+ output='screen',
+ )
+ gazebo.append(start_gazebo_ros_depth_image_bridge_cmd)
+
nav2 = IncludeLaunchDescription(
PythonLaunchDescriptionSource([nav2_launch]),
launch_arguments=[
@@ -77,6 +116,7 @@ def launch_setup(context, *args, **kwargs):
rviz = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rviz_launch])
)
+
rtabmap = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rtabmap_launch]),
launch_arguments=[
@@ -88,9 +128,8 @@ def launch_setup(context, *args, **kwargs):
# Nodes to launch
nav2,
rviz,
- rtabmap,
- gazebo
- ]
+ rtabmap
+ ] + gazebo
def generate_launch_description():
return LaunchDescription([
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_scan_demo.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_scan_demo.launch.py
index 5a826cb6..d269639c 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_scan_demo.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_scan_demo.launch.py
@@ -13,8 +13,30 @@
#
# 3) Rename to
# 4) Add
-# 5) Change to
-# 6) Change image width/height from 1920x1080 to 640x480
+# 5) Change image width/height from 1920x1080 to 640x480
+# 6) [ROS2 HUMBLE] Change to
+# 6) [ROS2 JAZZY] Change camera_rgb_frame to camera_rgb_optical_frame
+# 7) [ROS2 JAZZY] Add the following just after section (under same link)
+#
+# true
+# true
+# 30
+# camera/depth/image_raw
+# camera_rgb_optical_frame
+#
+# camera/depth/camera_info
+# 1.02974
+#
+# 640
+# 480
+# R8G8B8
+#
+#
+# 0.02
+# 300
+#
+#
+#
# 7) Note that we can increase min scan range from 0.12 to 0.2 to avoid having scans
# hitting the robot itself
# Example:
@@ -30,9 +52,12 @@ from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, Opaq
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare
+from launch_ros.actions import Node
import os
+ROS_DISTRO = os.environ.get('ROS_DISTRO')
+
def launch_setup(context, *args, **kwargs):
if not 'TURTLEBOT3_MODEL' in os.environ:
os.environ['TURTLEBOT3_MODEL'] = 'waffle'
@@ -47,9 +72,14 @@ def launch_setup(context, *args, **kwargs):
world = LaunchConfiguration('world').perform(context)
- nav2_params_file = PathJoinSubstitution(
- [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_scan_nav2_params.yaml']
- )
+ if ROS_DISTRO == 'humble':
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'humble', 'turtlebot3_rgbd_scan_nav2_params.yaml']
+ )
+ else:
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_rgbd_scan_nav2_params.yaml']
+ )
# Paths
gazebo_launch = PathJoinSubstitution(
@@ -62,13 +92,22 @@ def launch_setup(context, *args, **kwargs):
[pkg_rtabmap_demos, 'launch', 'turtlebot3', 'turtlebot3_rgbd_scan.launch.py'])
# Includes
- gazebo = IncludeLaunchDescription(
+ gazebo = [IncludeLaunchDescription(
PythonLaunchDescriptionSource([gazebo_launch]),
launch_arguments=[
('x_pose', LaunchConfiguration('x_pose')),
('y_pose', LaunchConfiguration('y_pose'))
]
- )
+ )]
+ if ROS_DISTRO != 'humble':
+ start_gazebo_ros_depth_image_bridge_cmd = Node(
+ package='ros_gz_image',
+ executable='image_bridge',
+ arguments=['/camera/depth/image_raw'],
+ output='screen',
+ )
+ gazebo.append(start_gazebo_ros_depth_image_bridge_cmd)
+
nav2 = IncludeLaunchDescription(
PythonLaunchDescriptionSource([nav2_launch]),
launch_arguments=[
@@ -79,20 +118,25 @@ def launch_setup(context, *args, **kwargs):
rviz = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rviz_launch])
)
+
+ max_ground_height = '0.05'
+ if ROS_DISTRO == 'jazzy':
+ max_ground_height = '0.02' # for the demo, on new gazebo the depth is more accurate
+
rtabmap = IncludeLaunchDescription(
PythonLaunchDescriptionSource([rtabmap_launch]),
launch_arguments=[
('localization', LaunchConfiguration('localization')),
- ('use_sim_time', 'true')
+ ('use_sim_time', 'true'),
+ ('max_ground_height', max_ground_height)
]
)
return [
# Nodes to launch
nav2,
rviz,
- rtabmap,
- gazebo
- ]
+ rtabmap
+ ] + gazebo
def generate_launch_description():
return LaunchDescription([
diff --git a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_scan_demo.launch.py b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_scan_demo.launch.py
index 284b5b68..3fecc353 100644
--- a/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_scan_demo.launch.py
+++ b/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_scan_demo.launch.py
@@ -14,18 +14,22 @@
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
-from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, OpaqueFunction
+from launch.actions import AppendEnvironmentVariable, DeclareLaunchArgument, IncludeLaunchDescription, OpaqueFunction
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare
import os
+ROS_DISTRO = os.environ.get('ROS_DISTRO')
+
def launch_setup(context, *args, **kwargs):
if not 'TURTLEBOT3_MODEL' in os.environ:
os.environ['TURTLEBOT3_MODEL'] = 'waffle'
# Directories
+ pkg_turtlebot3_gazebo = get_package_share_directory(
+ 'turtlebot3_gazebo')
pkg_nav2_bringup = get_package_share_directory(
'nav2_bringup')
pkg_rtabmap_demos = get_package_share_directory(
@@ -37,14 +41,26 @@ def launch_setup(context, *args, **kwargs):
icp_odometry = icp_odometry == 'True' or icp_odometry == 'true'
if icp_odometry:
# modified nav2 params to use icp_odom instead odom frame
- nav2_params_file = PathJoinSubstitution(
- [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_scan_nav2_params.yaml']
- )
+ if ROS_DISTRO == 'humble':
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'humble', 'turtlebot3_scan_nav2_params.yaml']
+ )
+ else:
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_scan_nav2_params.yaml']
+ )
else:
- # original nav2 params
- nav2_params_file = PathJoinSubstitution(
- [FindPackageShare('nav2_bringup'), 'params', 'nav2_params.yaml']
- )
+ if ROS_DISTRO == 'humble':
+ # original nav2 params
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('nav2_bringup'), 'params', 'nav2_params.yaml']
+ )
+ else:
+ # original nav2 params but with "enable_stamped_cmd_vel: True"
+ nav2_params_file = PathJoinSubstitution(
+ [FindPackageShare('rtabmap_demos'), 'params', 'turtlebot3_nav2_params.yaml']
+ )
+
# Paths
nav2_launch = PathJoinSubstitution(
@@ -53,56 +69,6 @@ def launch_setup(context, *args, **kwargs):
[pkg_nav2_bringup, 'launch', 'rviz_launch.py'])
rtabmap_launch = PathJoinSubstitution(
[pkg_rtabmap_demos, 'launch', 'turtlebot3', 'turtlebot3_scan.launch.py'])
-
- # To use ICP odometry, we should increase clock rate of gazebo, we copied content of
- # turtlebot3_gazebo/launch/turtlebot3_world.launch here
- launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch')
- pkg_gazebo_ros = get_package_share_directory('gazebo_ros')
-
- world = os.path.join(
- get_package_share_directory('turtlebot3_gazebo'),
- 'worlds',
- f'turtlebot3_{world_name}.world'
- )
-
- import tempfile
- with tempfile.NamedTemporaryFile(mode='w+t', delete=False) as clock_override_file:
- clock_override_file.write("---\n"+
- "gazebo:\n"+
- " ros__parameters:\n"+
- " publish_rate: 100.0")
-
- gzserver_cmd = IncludeLaunchDescription(
- PythonLaunchDescriptionSource(
- os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')
- ),
- launch_arguments={
- 'world': world,
- 'params_file': clock_override_file.name}.items()
- )
-
- gzclient_cmd = IncludeLaunchDescription(
- PythonLaunchDescriptionSource(
- os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py')
- )
- )
-
- robot_state_publisher_cmd = IncludeLaunchDescription(
- PythonLaunchDescriptionSource(
- os.path.join(launch_file_dir, 'robot_state_publisher.launch.py')
- ),
- launch_arguments={'use_sim_time': 'true'}.items()
- )
-
- spawn_turtlebot_cmd = IncludeLaunchDescription(
- PythonLaunchDescriptionSource(
- os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py')
- ),
- launch_arguments={
- 'x_pose': LaunchConfiguration('x_pose'),
- 'y_pose': LaunchConfiguration('y_pose')
- }.items()
- )
nav2 = IncludeLaunchDescription(
PythonLaunchDescriptionSource([nav2_launch]),
@@ -121,16 +87,83 @@ def launch_setup(context, *args, **kwargs):
('use_sim_time', 'true')
]
)
+
+ # To use ICP odometry, we should increase clock rate of gazebo (humble), we copied content of
+ # turtlebot3_gazebo/launch/turtlebot3_world.launch here.
+ turtlebot3_nodes = []
+ if ROS_DISTRO == 'humble':
+ pkg_gazebo_ros = get_package_share_directory('gazebo_ros')
+
+ import tempfile
+ with tempfile.NamedTemporaryFile(mode='w+t', delete=False) as clock_override_file:
+ clock_override_file.write("---\n"+
+ "gazebo:\n"+
+ " ros__parameters:\n"+
+ " publish_rate: 100.0")
+
+ world = os.path.join(
+ pkg_turtlebot3_gazebo,
+ 'worlds',
+ f'turtlebot3_{world_name}.world'
+ )
+
+ gzserver_cmd = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource(
+ os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')
+ ),
+ launch_arguments={
+ 'world': world,
+ 'params_file': clock_override_file.name}.items()
+ )
+
+ gzclient_cmd = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource(
+ os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py')
+ )
+ )
+
+ robot_state_publisher_cmd = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource(
+ os.path.join(pkg_turtlebot3_gazebo, 'launch', 'robot_state_publisher.launch.py')
+ ),
+ launch_arguments={'use_sim_time': 'true'}.items()
+ )
+ spawn_turtlebot_cmd = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource(
+ os.path.join(pkg_turtlebot3_gazebo, 'launch', 'spawn_turtlebot3.launch.py')
+ ),
+ launch_arguments={
+ 'x_pose': LaunchConfiguration('x_pose'),
+ 'y_pose': LaunchConfiguration('y_pose')
+ }.items()
+ )
+
+ set_env_vars_resources = AppendEnvironmentVariable(
+ 'GZ_SIM_RESOURCE_PATH',
+ os.path.join(pkg_turtlebot3_gazebo, 'models'))
+ turtlebot3_nodes = [
+ gzserver_cmd,
+ gzclient_cmd,
+ robot_state_publisher_cmd,
+ spawn_turtlebot_cmd,
+ set_env_vars_resources
+ ]
+ else:
+ gazebo_launch = PathJoinSubstitution([pkg_turtlebot3_gazebo, 'launch', f'turtlebot3_{world_name}.launch.py'])
+ gazebo = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource([gazebo_launch]),
+ launch_arguments=[
+ ('x_pose', LaunchConfiguration('x_pose')),
+ ('y_pose', LaunchConfiguration('y_pose'))
+ ]
+ )
+ turtlebot3_nodes = [gazebo]
+
return [
# Nodes to launch
nav2,
rviz,
- rtabmap,
- gzserver_cmd,
- gzclient_cmd,
- robot_state_publisher_cmd,
- spawn_turtlebot_cmd
- ]
+ rtabmap] + turtlebot3_nodes
def generate_launch_description():
return LaunchDescription([
diff --git a/rtabmap_demos/params/humble/turtlebot3_rgbd_nav2_params.yaml b/rtabmap_demos/params/humble/turtlebot3_rgbd_nav2_params.yaml
new file mode 100644
index 00000000..838c80b3
--- /dev/null
+++ b/rtabmap_demos/params/humble/turtlebot3_rgbd_nav2_params.yaml
@@ -0,0 +1,287 @@
+# rtabmap_demos: We add segmented ground and obstacles to voxel_layer of the local costmap and removed scan source.
+bt_navigator:
+ ros__parameters:
+ use_sim_time: True
+ global_frame: map
+ robot_base_frame: base_link
+ odom_topic: /odom
+ bt_loop_duration: 10
+ default_server_timeout: 20
+ wait_for_service_timeout: 1000
+ # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
+ # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
+ # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
+ # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
+ plugin_lib_names:
+ - nav2_compute_path_to_pose_action_bt_node
+ - nav2_compute_path_through_poses_action_bt_node
+ - nav2_smooth_path_action_bt_node
+ - nav2_follow_path_action_bt_node
+ - nav2_spin_action_bt_node
+ - nav2_wait_action_bt_node
+ - nav2_assisted_teleop_action_bt_node
+ - nav2_back_up_action_bt_node
+ - nav2_drive_on_heading_bt_node
+ - nav2_clear_costmap_service_bt_node
+ - nav2_is_stuck_condition_bt_node
+ - nav2_goal_reached_condition_bt_node
+ - nav2_goal_updated_condition_bt_node
+ - nav2_globally_updated_goal_condition_bt_node
+ - nav2_is_path_valid_condition_bt_node
+ - nav2_initial_pose_received_condition_bt_node
+ - nav2_reinitialize_global_localization_service_bt_node
+ - nav2_rate_controller_bt_node
+ - nav2_distance_controller_bt_node
+ - nav2_speed_controller_bt_node
+ - nav2_truncate_path_action_bt_node
+ - nav2_truncate_path_local_action_bt_node
+ - nav2_goal_updater_node_bt_node
+ - nav2_recovery_node_bt_node
+ - nav2_pipeline_sequence_bt_node
+ - nav2_round_robin_node_bt_node
+ - nav2_transform_available_condition_bt_node
+ - nav2_time_expired_condition_bt_node
+ - nav2_path_expiring_timer_condition
+ - nav2_distance_traveled_condition_bt_node
+ - nav2_single_trigger_bt_node
+ - nav2_goal_updated_controller_bt_node
+ - nav2_is_battery_low_condition_bt_node
+ - nav2_navigate_through_poses_action_bt_node
+ - nav2_navigate_to_pose_action_bt_node
+ - nav2_remove_passed_goals_action_bt_node
+ - nav2_planner_selector_bt_node
+ - nav2_controller_selector_bt_node
+ - nav2_goal_checker_selector_bt_node
+ - nav2_controller_cancel_bt_node
+ - nav2_path_longer_on_approach_bt_node
+ - nav2_wait_cancel_bt_node
+ - nav2_spin_cancel_bt_node
+ - nav2_back_up_cancel_bt_node
+ - nav2_assisted_teleop_cancel_bt_node
+ - nav2_drive_on_heading_cancel_bt_node
+ - nav2_is_battery_charging_condition_bt_node
+
+bt_navigator_navigate_through_poses_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+bt_navigator_navigate_to_pose_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+controller_server:
+ ros__parameters:
+ use_sim_time: True
+ controller_frequency: 20.0
+ min_x_velocity_threshold: 0.001
+ min_y_velocity_threshold: 0.5
+ min_theta_velocity_threshold: 0.001
+ failure_tolerance: 0.3
+ progress_checker_plugin: "progress_checker"
+ goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
+ controller_plugins: ["FollowPath"]
+
+ # Progress checker parameters
+ progress_checker:
+ plugin: "nav2_controller::SimpleProgressChecker"
+ required_movement_radius: 0.5
+ movement_time_allowance: 10.0
+ # Goal checker parameters
+ #precise_goal_checker:
+ # plugin: "nav2_controller::SimpleGoalChecker"
+ # xy_goal_tolerance: 0.25
+ # yaw_goal_tolerance: 0.25
+ # stateful: True
+ general_goal_checker:
+ stateful: True
+ plugin: "nav2_controller::SimpleGoalChecker"
+ xy_goal_tolerance: 0.25
+ yaw_goal_tolerance: 0.25
+ # DWB parameters
+ FollowPath:
+ plugin: "dwb_core::DWBLocalPlanner"
+ debug_trajectory_details: True
+ min_vel_x: 0.0
+ min_vel_y: 0.0
+ max_vel_x: 0.26
+ max_vel_y: 0.0
+ max_vel_theta: 1.0
+ min_speed_xy: 0.0
+ max_speed_xy: 0.26
+ min_speed_theta: 0.0
+ # Add high threshold velocity for turtlebot 3 issue.
+ # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
+ acc_lim_x: 2.5
+ acc_lim_y: 0.0
+ acc_lim_theta: 3.2
+ decel_lim_x: -2.5
+ decel_lim_y: 0.0
+ decel_lim_theta: -3.2
+ vx_samples: 20
+ vy_samples: 5
+ vtheta_samples: 20
+ sim_time: 1.7
+ linear_granularity: 0.05
+ angular_granularity: 0.025
+ transform_tolerance: 0.2
+ xy_goal_tolerance: 0.25
+ trans_stopped_velocity: 0.25
+ short_circuit_trajectory_evaluation: True
+ stateful: True
+ critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
+ BaseObstacle.scale: 0.02
+ PathAlign.scale: 32.0
+ PathAlign.forward_point_distance: 0.1
+ GoalAlign.scale: 24.0
+ GoalAlign.forward_point_distance: 0.1
+ PathDist.scale: 32.0
+ GoalDist.scale: 24.0
+ RotateToGoal.scale: 32.0
+ RotateToGoal.slowing_factor: 5.0
+ RotateToGoal.lookahead_time: -1.0
+
+local_costmap:
+ local_costmap:
+ ros__parameters:
+ update_frequency: 5.0
+ publish_frequency: 2.0
+ global_frame: odom
+ robot_base_frame: base_link
+ use_sim_time: True
+ rolling_window: true
+ width: 3
+ height: 3
+ resolution: 0.05
+ robot_radius: 0.22
+ plugins: ["voxel_layer", "inflation_layer"]
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ voxel_layer:
+ plugin: "nav2_costmap_2d::VoxelLayer"
+ enabled: True
+ publish_voxel_map: True
+ origin_z: 0.0
+ z_resolution: 0.05
+ z_voxels: 16
+ max_obstacle_height: 2.0
+ mark_threshold: 0
+ observation_sources: ground obstacles
+ ground:
+ topic: /camera/ground
+ max_obstacle_height: 0.4
+ clearing: True
+ marking: False
+ data_type: "PointCloud2"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ obstacles:
+ topic: /camera/obstacles
+ max_obstacle_height: 0.4
+ clearing: True
+ marking: True
+ data_type: "PointCloud2"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ always_send_full_costmap: True
+
+global_costmap:
+ global_costmap:
+ ros__parameters:
+ update_frequency: 1.0
+ publish_frequency: 1.0
+ global_frame: map
+ robot_base_frame: base_link
+ use_sim_time: True
+ robot_radius: 0.22
+ resolution: 0.05
+ track_unknown_space: true
+ plugins: ["static_layer", "inflation_layer"]
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ always_send_full_costmap: True
+
+map_server:
+ ros__parameters:
+ use_sim_time: True
+ # Overridden in launch by the "map" launch configuration or provided default value.
+ # To use in yaml, remove the default "map" value in the tb3_simulation_launch.py file & provide full path to map below.
+ yaml_filename: ""
+
+smoother_server:
+ ros__parameters:
+ use_sim_time: True
+ smoother_plugins: ["simple_smoother"]
+ simple_smoother:
+ plugin: "nav2_smoother::SimpleSmoother"
+ tolerance: 1.0e-10
+ max_its: 1000
+ do_refinement: True
+
+behavior_server:
+ ros__parameters:
+ costmap_topic: local_costmap/costmap_raw
+ footprint_topic: local_costmap/published_footprint
+ cycle_frequency: 10.0
+ behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
+ spin:
+ plugin: "nav2_behaviors/Spin"
+ backup:
+ plugin: "nav2_behaviors/BackUp"
+ drive_on_heading:
+ plugin: "nav2_behaviors/DriveOnHeading"
+ wait:
+ plugin: "nav2_behaviors/Wait"
+ assisted_teleop:
+ plugin: "nav2_behaviors/AssistedTeleop"
+ global_frame: odom
+ robot_base_frame: base_link
+ transform_tolerance: 0.1
+ use_sim_time: true
+ simulate_ahead_time: 2.0
+ max_rotational_vel: 1.0
+ min_rotational_vel: 0.4
+ rotational_acc_lim: 3.2
+
+robot_state_publisher:
+ ros__parameters:
+ use_sim_time: True
+
+waypoint_follower:
+ ros__parameters:
+ use_sim_time: True
+ loop_rate: 20
+ stop_on_failure: false
+ waypoint_task_executor_plugin: "wait_at_waypoint"
+ wait_at_waypoint:
+ plugin: "nav2_waypoint_follower::WaitAtWaypoint"
+ enabled: True
+ waypoint_pause_duration: 200
+
+velocity_smoother:
+ ros__parameters:
+ use_sim_time: True
+ smoothing_frequency: 20.0
+ scale_velocities: False
+ feedback: "OPEN_LOOP"
+ max_velocity: [0.26, 0.0, 1.0]
+ min_velocity: [-0.26, 0.0, -1.0]
+ max_accel: [2.5, 0.0, 3.2]
+ max_decel: [-2.5, 0.0, -3.2]
+ odom_topic: "odom"
+ odom_duration: 0.1
+ deadband_velocity: [0.0, 0.0, 0.0]
+ velocity_timeout: 1.0
diff --git a/rtabmap_demos/params/humble/turtlebot3_rgbd_scan_nav2_params.yaml b/rtabmap_demos/params/humble/turtlebot3_rgbd_scan_nav2_params.yaml
new file mode 100644
index 00000000..43dce5ba
--- /dev/null
+++ b/rtabmap_demos/params/humble/turtlebot3_rgbd_scan_nav2_params.yaml
@@ -0,0 +1,301 @@
+# rtabmap_demos: We add segmented ground and obstacles to voxel_layer of the local costmap.
+bt_navigator:
+ ros__parameters:
+ use_sim_time: True
+ global_frame: map
+ robot_base_frame: base_link
+ odom_topic: /odom
+ bt_loop_duration: 10
+ default_server_timeout: 20
+ wait_for_service_timeout: 1000
+ # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
+ # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
+ # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
+ # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
+ plugin_lib_names:
+ - nav2_compute_path_to_pose_action_bt_node
+ - nav2_compute_path_through_poses_action_bt_node
+ - nav2_smooth_path_action_bt_node
+ - nav2_follow_path_action_bt_node
+ - nav2_spin_action_bt_node
+ - nav2_wait_action_bt_node
+ - nav2_assisted_teleop_action_bt_node
+ - nav2_back_up_action_bt_node
+ - nav2_drive_on_heading_bt_node
+ - nav2_clear_costmap_service_bt_node
+ - nav2_is_stuck_condition_bt_node
+ - nav2_goal_reached_condition_bt_node
+ - nav2_goal_updated_condition_bt_node
+ - nav2_globally_updated_goal_condition_bt_node
+ - nav2_is_path_valid_condition_bt_node
+ - nav2_initial_pose_received_condition_bt_node
+ - nav2_reinitialize_global_localization_service_bt_node
+ - nav2_rate_controller_bt_node
+ - nav2_distance_controller_bt_node
+ - nav2_speed_controller_bt_node
+ - nav2_truncate_path_action_bt_node
+ - nav2_truncate_path_local_action_bt_node
+ - nav2_goal_updater_node_bt_node
+ - nav2_recovery_node_bt_node
+ - nav2_pipeline_sequence_bt_node
+ - nav2_round_robin_node_bt_node
+ - nav2_transform_available_condition_bt_node
+ - nav2_time_expired_condition_bt_node
+ - nav2_path_expiring_timer_condition
+ - nav2_distance_traveled_condition_bt_node
+ - nav2_single_trigger_bt_node
+ - nav2_goal_updated_controller_bt_node
+ - nav2_is_battery_low_condition_bt_node
+ - nav2_navigate_through_poses_action_bt_node
+ - nav2_navigate_to_pose_action_bt_node
+ - nav2_remove_passed_goals_action_bt_node
+ - nav2_planner_selector_bt_node
+ - nav2_controller_selector_bt_node
+ - nav2_goal_checker_selector_bt_node
+ - nav2_controller_cancel_bt_node
+ - nav2_path_longer_on_approach_bt_node
+ - nav2_wait_cancel_bt_node
+ - nav2_spin_cancel_bt_node
+ - nav2_back_up_cancel_bt_node
+ - nav2_assisted_teleop_cancel_bt_node
+ - nav2_drive_on_heading_cancel_bt_node
+ - nav2_is_battery_charging_condition_bt_node
+
+bt_navigator_navigate_through_poses_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+bt_navigator_navigate_to_pose_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+controller_server:
+ ros__parameters:
+ use_sim_time: True
+ controller_frequency: 20.0
+ min_x_velocity_threshold: 0.001
+ min_y_velocity_threshold: 0.5
+ min_theta_velocity_threshold: 0.001
+ failure_tolerance: 0.3
+ progress_checker_plugin: "progress_checker"
+ goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
+ controller_plugins: ["FollowPath"]
+
+ # Progress checker parameters
+ progress_checker:
+ plugin: "nav2_controller::SimpleProgressChecker"
+ required_movement_radius: 0.5
+ movement_time_allowance: 10.0
+ # Goal checker parameters
+ #precise_goal_checker:
+ # plugin: "nav2_controller::SimpleGoalChecker"
+ # xy_goal_tolerance: 0.25
+ # yaw_goal_tolerance: 0.25
+ # stateful: True
+ general_goal_checker:
+ stateful: True
+ plugin: "nav2_controller::SimpleGoalChecker"
+ xy_goal_tolerance: 0.25
+ yaw_goal_tolerance: 0.25
+ # DWB parameters
+ FollowPath:
+ plugin: "dwb_core::DWBLocalPlanner"
+ debug_trajectory_details: True
+ min_vel_x: 0.0
+ min_vel_y: 0.0
+ max_vel_x: 0.26
+ max_vel_y: 0.0
+ max_vel_theta: 1.0
+ min_speed_xy: 0.0
+ max_speed_xy: 0.26
+ min_speed_theta: 0.0
+ # Add high threshold velocity for turtlebot 3 issue.
+ # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
+ acc_lim_x: 2.5
+ acc_lim_y: 0.0
+ acc_lim_theta: 3.2
+ decel_lim_x: -2.5
+ decel_lim_y: 0.0
+ decel_lim_theta: -3.2
+ vx_samples: 20
+ vy_samples: 5
+ vtheta_samples: 20
+ sim_time: 1.7
+ linear_granularity: 0.05
+ angular_granularity: 0.025
+ transform_tolerance: 0.2
+ xy_goal_tolerance: 0.25
+ trans_stopped_velocity: 0.25
+ short_circuit_trajectory_evaluation: True
+ stateful: True
+ critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
+ BaseObstacle.scale: 0.02
+ PathAlign.scale: 32.0
+ PathAlign.forward_point_distance: 0.1
+ GoalAlign.scale: 24.0
+ GoalAlign.forward_point_distance: 0.1
+ PathDist.scale: 32.0
+ GoalDist.scale: 24.0
+ RotateToGoal.scale: 32.0
+ RotateToGoal.slowing_factor: 5.0
+ RotateToGoal.lookahead_time: -1.0
+
+local_costmap:
+ local_costmap:
+ ros__parameters:
+ update_frequency: 5.0
+ publish_frequency: 2.0
+ global_frame: odom
+ robot_base_frame: base_link
+ use_sim_time: True
+ rolling_window: true
+ width: 3
+ height: 3
+ resolution: 0.05
+ robot_radius: 0.22
+ plugins: ["voxel_layer", "inflation_layer"]
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ voxel_layer:
+ plugin: "nav2_costmap_2d::VoxelLayer"
+ enabled: True
+ publish_voxel_map: True
+ origin_z: 0.0
+ z_resolution: 0.05
+ z_voxels: 16
+ max_obstacle_height: 2.0
+ mark_threshold: 0
+ observation_sources: scan ground obstacles
+ scan:
+ topic: /scan
+ max_obstacle_height: 2.0
+ clearing: True
+ marking: True
+ data_type: "LaserScan"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ ground:
+ topic: /camera/ground
+ max_obstacle_height: 0.4
+ clearing: True
+ marking: False
+ data_type: "PointCloud2"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ obstacles:
+ topic: /camera/obstacles
+ max_obstacle_height: 0.4
+ clearing: True
+ marking: True
+ data_type: "PointCloud2"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ always_send_full_costmap: True
+
+global_costmap:
+ global_costmap:
+ ros__parameters:
+ update_frequency: 1.0
+ publish_frequency: 1.0
+ global_frame: map
+ robot_base_frame: base_link
+ use_sim_time: True
+ robot_radius: 0.22
+ resolution: 0.05
+ track_unknown_space: true
+ plugins: ["static_layer", "inflation_layer"]
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ always_send_full_costmap: True
+
+planner_server:
+ ros__parameters:
+ expected_planner_frequency: 20.0
+ use_sim_time: True
+ planner_plugins: ["GridBased"]
+ GridBased:
+ plugin: "nav2_navfn_planner/NavfnPlanner"
+ tolerance: 0.5
+ use_astar: false
+ allow_unknown: true
+
+smoother_server:
+ ros__parameters:
+ use_sim_time: True
+ smoother_plugins: ["simple_smoother"]
+ simple_smoother:
+ plugin: "nav2_smoother::SimpleSmoother"
+ tolerance: 1.0e-10
+ max_its: 1000
+ do_refinement: True
+
+behavior_server:
+ ros__parameters:
+ costmap_topic: local_costmap/costmap_raw
+ footprint_topic: local_costmap/published_footprint
+ cycle_frequency: 10.0
+ behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
+ spin:
+ plugin: "nav2_behaviors/Spin"
+ backup:
+ plugin: "nav2_behaviors/BackUp"
+ drive_on_heading:
+ plugin: "nav2_behaviors/DriveOnHeading"
+ wait:
+ plugin: "nav2_behaviors/Wait"
+ assisted_teleop:
+ plugin: "nav2_behaviors/AssistedTeleop"
+ global_frame: odom
+ robot_base_frame: base_link
+ transform_tolerance: 0.1
+ use_sim_time: true
+ simulate_ahead_time: 2.0
+ max_rotational_vel: 1.0
+ min_rotational_vel: 0.4
+ rotational_acc_lim: 3.2
+
+robot_state_publisher:
+ ros__parameters:
+ use_sim_time: True
+
+waypoint_follower:
+ ros__parameters:
+ use_sim_time: True
+ loop_rate: 20
+ stop_on_failure: false
+ waypoint_task_executor_plugin: "wait_at_waypoint"
+ wait_at_waypoint:
+ plugin: "nav2_waypoint_follower::WaitAtWaypoint"
+ enabled: True
+ waypoint_pause_duration: 200
+
+velocity_smoother:
+ ros__parameters:
+ use_sim_time: True
+ smoothing_frequency: 20.0
+ scale_velocities: False
+ feedback: "OPEN_LOOP"
+ max_velocity: [0.26, 0.0, 1.0]
+ min_velocity: [-0.26, 0.0, -1.0]
+ max_accel: [2.5, 0.0, 3.2]
+ max_decel: [-2.5, 0.0, -3.2]
+ odom_topic: "odom"
+ odom_duration: 0.1
+ deadband_velocity: [0.0, 0.0, 0.0]
+ velocity_timeout: 1.0
diff --git a/rtabmap_demos/params/humble/turtlebot3_scan_nav2_params.yaml b/rtabmap_demos/params/humble/turtlebot3_scan_nav2_params.yaml
new file mode 100644
index 00000000..9c33bdb2
--- /dev/null
+++ b/rtabmap_demos/params/humble/turtlebot3_scan_nav2_params.yaml
@@ -0,0 +1,295 @@
+# Modified to use icp_odom frame
+bt_navigator:
+ ros__parameters:
+ use_sim_time: True
+ global_frame: map
+ robot_base_frame: base_link
+ odom_topic: /odom
+ bt_loop_duration: 10
+ default_server_timeout: 20
+ wait_for_service_timeout: 1000
+ # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
+ # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
+ # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
+ # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
+ plugin_lib_names:
+ - nav2_compute_path_to_pose_action_bt_node
+ - nav2_compute_path_through_poses_action_bt_node
+ - nav2_smooth_path_action_bt_node
+ - nav2_follow_path_action_bt_node
+ - nav2_spin_action_bt_node
+ - nav2_wait_action_bt_node
+ - nav2_assisted_teleop_action_bt_node
+ - nav2_back_up_action_bt_node
+ - nav2_drive_on_heading_bt_node
+ - nav2_clear_costmap_service_bt_node
+ - nav2_is_stuck_condition_bt_node
+ - nav2_goal_reached_condition_bt_node
+ - nav2_goal_updated_condition_bt_node
+ - nav2_globally_updated_goal_condition_bt_node
+ - nav2_is_path_valid_condition_bt_node
+ - nav2_initial_pose_received_condition_bt_node
+ - nav2_reinitialize_global_localization_service_bt_node
+ - nav2_rate_controller_bt_node
+ - nav2_distance_controller_bt_node
+ - nav2_speed_controller_bt_node
+ - nav2_truncate_path_action_bt_node
+ - nav2_truncate_path_local_action_bt_node
+ - nav2_goal_updater_node_bt_node
+ - nav2_recovery_node_bt_node
+ - nav2_pipeline_sequence_bt_node
+ - nav2_round_robin_node_bt_node
+ - nav2_transform_available_condition_bt_node
+ - nav2_time_expired_condition_bt_node
+ - nav2_path_expiring_timer_condition
+ - nav2_distance_traveled_condition_bt_node
+ - nav2_single_trigger_bt_node
+ - nav2_goal_updated_controller_bt_node
+ - nav2_is_battery_low_condition_bt_node
+ - nav2_navigate_through_poses_action_bt_node
+ - nav2_navigate_to_pose_action_bt_node
+ - nav2_remove_passed_goals_action_bt_node
+ - nav2_planner_selector_bt_node
+ - nav2_controller_selector_bt_node
+ - nav2_goal_checker_selector_bt_node
+ - nav2_controller_cancel_bt_node
+ - nav2_path_longer_on_approach_bt_node
+ - nav2_wait_cancel_bt_node
+ - nav2_spin_cancel_bt_node
+ - nav2_back_up_cancel_bt_node
+ - nav2_assisted_teleop_cancel_bt_node
+ - nav2_drive_on_heading_cancel_bt_node
+ - nav2_is_battery_charging_condition_bt_node
+
+bt_navigator_navigate_through_poses_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+bt_navigator_navigate_to_pose_rclcpp_node:
+ ros__parameters:
+ use_sim_time: True
+
+controller_server:
+ ros__parameters:
+ use_sim_time: True
+ controller_frequency: 20.0
+ min_x_velocity_threshold: 0.001
+ min_y_velocity_threshold: 0.5
+ min_theta_velocity_threshold: 0.001
+ failure_tolerance: 0.3
+ progress_checker_plugin: "progress_checker"
+ goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
+ controller_plugins: ["FollowPath"]
+
+ # Progress checker parameters
+ progress_checker:
+ plugin: "nav2_controller::SimpleProgressChecker"
+ required_movement_radius: 0.5
+ movement_time_allowance: 10.0
+ # Goal checker parameters
+ #precise_goal_checker:
+ # plugin: "nav2_controller::SimpleGoalChecker"
+ # xy_goal_tolerance: 0.25
+ # yaw_goal_tolerance: 0.25
+ # stateful: True
+ general_goal_checker:
+ stateful: True
+ plugin: "nav2_controller::SimpleGoalChecker"
+ xy_goal_tolerance: 0.25
+ yaw_goal_tolerance: 0.25
+ # DWB parameters
+ FollowPath:
+ plugin: "dwb_core::DWBLocalPlanner"
+ debug_trajectory_details: True
+ min_vel_x: 0.0
+ min_vel_y: 0.0
+ max_vel_x: 0.26
+ max_vel_y: 0.0
+ max_vel_theta: 1.0
+ min_speed_xy: 0.0
+ max_speed_xy: 0.26
+ min_speed_theta: 0.0
+ # Add high threshold velocity for turtlebot 3 issue.
+ # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
+ acc_lim_x: 2.5
+ acc_lim_y: 0.0
+ acc_lim_theta: 3.2
+ decel_lim_x: -2.5
+ decel_lim_y: 0.0
+ decel_lim_theta: -3.2
+ vx_samples: 20
+ vy_samples: 5
+ vtheta_samples: 20
+ sim_time: 1.7
+ linear_granularity: 0.05
+ angular_granularity: 0.025
+ transform_tolerance: 0.2
+ xy_goal_tolerance: 0.25
+ trans_stopped_velocity: 0.25
+ short_circuit_trajectory_evaluation: True
+ stateful: True
+ critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
+ BaseObstacle.scale: 0.02
+ PathAlign.scale: 32.0
+ PathAlign.forward_point_distance: 0.1
+ GoalAlign.scale: 24.0
+ GoalAlign.forward_point_distance: 0.1
+ PathDist.scale: 32.0
+ GoalDist.scale: 24.0
+ RotateToGoal.scale: 32.0
+ RotateToGoal.slowing_factor: 5.0
+ RotateToGoal.lookahead_time: -1.0
+
+local_costmap:
+ local_costmap:
+ ros__parameters:
+ update_frequency: 5.0
+ publish_frequency: 2.0
+ global_frame: icp_odom
+ robot_base_frame: base_link
+ use_sim_time: True
+ rolling_window: true
+ width: 3
+ height: 3
+ resolution: 0.05
+ robot_radius: 0.22
+ plugins: ["voxel_layer", "inflation_layer"]
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ voxel_layer:
+ plugin: "nav2_costmap_2d::VoxelLayer"
+ enabled: True
+ publish_voxel_map: True
+ origin_z: 0.0
+ z_resolution: 0.05
+ z_voxels: 16
+ max_obstacle_height: 2.0
+ mark_threshold: 0
+ observation_sources: scan
+ scan:
+ topic: /scan
+ max_obstacle_height: 2.0
+ clearing: True
+ marking: True
+ data_type: "LaserScan"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ always_send_full_costmap: True
+
+global_costmap:
+ global_costmap:
+ ros__parameters:
+ update_frequency: 1.0
+ publish_frequency: 1.0
+ global_frame: map
+ robot_base_frame: base_link
+ use_sim_time: True
+ robot_radius: 0.22
+ resolution: 0.05
+ track_unknown_space: true
+ plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
+ obstacle_layer:
+ plugin: "nav2_costmap_2d::ObstacleLayer"
+ enabled: True
+ observation_sources: scan
+ scan:
+ topic: /scan
+ max_obstacle_height: 2.0
+ clearing: True
+ marking: True
+ data_type: "LaserScan"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.55
+ always_send_full_costmap: True
+
+planner_server:
+ ros__parameters:
+ expected_planner_frequency: 20.0
+ use_sim_time: True
+ planner_plugins: ["GridBased"]
+ GridBased:
+ plugin: "nav2_navfn_planner/NavfnPlanner"
+ tolerance: 0.5
+ use_astar: false
+ allow_unknown: true
+
+smoother_server:
+ ros__parameters:
+ use_sim_time: True
+ smoother_plugins: ["simple_smoother"]
+ simple_smoother:
+ plugin: "nav2_smoother::SimpleSmoother"
+ tolerance: 1.0e-10
+ max_its: 1000
+ do_refinement: True
+
+behavior_server:
+ ros__parameters:
+ costmap_topic: local_costmap/costmap_raw
+ footprint_topic: local_costmap/published_footprint
+ cycle_frequency: 10.0
+ behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
+ spin:
+ plugin: "nav2_behaviors/Spin"
+ backup:
+ plugin: "nav2_behaviors/BackUp"
+ drive_on_heading:
+ plugin: "nav2_behaviors/DriveOnHeading"
+ wait:
+ plugin: "nav2_behaviors/Wait"
+ assisted_teleop:
+ plugin: "nav2_behaviors/AssistedTeleop"
+ global_frame: icp_odom
+ robot_base_frame: base_link
+ transform_tolerance: 0.1
+ use_sim_time: true
+ simulate_ahead_time: 2.0
+ max_rotational_vel: 1.0
+ min_rotational_vel: 0.4
+ rotational_acc_lim: 3.2
+
+robot_state_publisher:
+ ros__parameters:
+ use_sim_time: True
+
+waypoint_follower:
+ ros__parameters:
+ use_sim_time: True
+ loop_rate: 20
+ stop_on_failure: false
+ waypoint_task_executor_plugin: "wait_at_waypoint"
+ wait_at_waypoint:
+ plugin: "nav2_waypoint_follower::WaitAtWaypoint"
+ enabled: True
+ waypoint_pause_duration: 200
+
+velocity_smoother:
+ ros__parameters:
+ use_sim_time: True
+ smoothing_frequency: 20.0
+ scale_velocities: False
+ feedback: "OPEN_LOOP"
+ max_velocity: [0.26, 0.0, 1.0]
+ min_velocity: [-0.26, 0.0, -1.0]
+ max_accel: [2.5, 0.0, 3.2]
+ max_decel: [-2.5, 0.0, -3.2]
+ odom_topic: "odom"
+ odom_duration: 0.1
+ deadband_velocity: [0.0, 0.0, 0.0]
+ velocity_timeout: 1.0
diff --git a/rtabmap_demos/params/turtlebot3_nav2_params.yaml b/rtabmap_demos/params/turtlebot3_nav2_params.yaml
new file mode 100644
index 00000000..0a861836
--- /dev/null
+++ b/rtabmap_demos/params/turtlebot3_nav2_params.yaml
@@ -0,0 +1,421 @@
+bt_navigator:
+ ros__parameters:
+ global_frame: map
+ robot_base_frame: base_link
+ odom_topic: /odom
+ bt_loop_duration: 10
+ default_server_timeout: 20
+ wait_for_service_timeout: 1000
+ action_server_result_timeout: 900.0
+ navigators: ["navigate_to_pose", "navigate_through_poses"]
+ navigate_to_pose:
+ plugin: "nav2_bt_navigator::NavigateToPoseNavigator"
+ navigate_through_poses:
+ plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
+ # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
+ # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
+ # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
+ # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
+
+ # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings).
+ # Built-in plugins are added automatically
+ # plugin_lib_names: []
+
+ error_code_names:
+ - compute_path_error_code
+ - follow_path_error_code
+
+controller_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ controller_frequency: 20.0
+ costmap_update_timeout: 0.30
+ min_x_velocity_threshold: 0.001
+ min_y_velocity_threshold: 0.5
+ min_theta_velocity_threshold: 0.001
+ failure_tolerance: 0.3
+ progress_checker_plugins: ["progress_checker"]
+ goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
+ controller_plugins: ["FollowPath"]
+ use_realtime_priority: false
+
+ # Progress checker parameters
+ progress_checker:
+ plugin: "nav2_controller::SimpleProgressChecker"
+ required_movement_radius: 0.5
+ movement_time_allowance: 10.0
+ # Goal checker parameters
+ #precise_goal_checker:
+ # plugin: "nav2_controller::SimpleGoalChecker"
+ # xy_goal_tolerance: 0.25
+ # yaw_goal_tolerance: 0.25
+ # stateful: True
+ general_goal_checker:
+ stateful: True
+ plugin: "nav2_controller::SimpleGoalChecker"
+ xy_goal_tolerance: 0.25
+ yaw_goal_tolerance: 0.25
+ FollowPath:
+ plugin: "nav2_mppi_controller::MPPIController"
+ time_steps: 56
+ model_dt: 0.05
+ batch_size: 2000
+ ax_max: 3.0
+ ax_min: -3.0
+ ay_max: 3.0
+ ay_min: -3.0
+ az_max: 3.5
+ vx_std: 0.2
+ vy_std: 0.2
+ wz_std: 0.4
+ vx_max: 0.5
+ vx_min: -0.35
+ vy_max: 0.5
+ wz_max: 1.9
+ iteration_count: 1
+ prune_distance: 1.7
+ transform_tolerance: 0.1
+ temperature: 0.3
+ gamma: 0.015
+ motion_model: "DiffDrive"
+ visualize: true
+ regenerate_noises: true
+ TrajectoryVisualizer:
+ trajectory_step: 5
+ time_step: 3
+ AckermannConstraints:
+ min_turning_r: 0.2
+ critics: [
+ "ConstraintCritic", "CostCritic", "GoalCritic",
+ "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic",
+ "PathAngleCritic", "PreferForwardCritic"]
+ ConstraintCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 4.0
+ GoalCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 1.4
+ GoalAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.0
+ threshold_to_consider: 0.5
+ PreferForwardCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 0.5
+ CostCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.81
+ near_collision_cost: 253
+ critical_cost: 300.0
+ consider_footprint: false
+ collision_cost: 1000000.0
+ near_goal_distance: 1.0
+ trajectory_point_step: 2
+ PathAlignCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 14.0
+ max_path_occupancy_ratio: 0.05
+ trajectory_point_step: 4
+ threshold_to_consider: 0.5
+ offset_from_furthest: 20
+ use_path_orientations: false
+ PathFollowCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ offset_from_furthest: 5
+ threshold_to_consider: 1.4
+ PathAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 2.0
+ offset_from_furthest: 4
+ threshold_to_consider: 0.5
+ max_angle_to_furthest: 1.0
+ mode: 0
+ # TwirlingCritic:
+ # enabled: true
+ # twirling_cost_power: 1
+ # twirling_cost_weight: 10.0
+
+local_costmap:
+ local_costmap:
+ ros__parameters:
+ update_frequency: 5.0
+ publish_frequency: 2.0
+ global_frame: odom
+ robot_base_frame: base_link
+ rolling_window: true
+ width: 3
+ height: 3
+ resolution: 0.05
+ robot_radius: 0.22
+ plugins: ["voxel_layer", "inflation_layer"]
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.70
+ voxel_layer:
+ plugin: "nav2_costmap_2d::VoxelLayer"
+ enabled: True
+ publish_voxel_map: True
+ origin_z: 0.0
+ z_resolution: 0.05
+ z_voxels: 16
+ max_obstacle_height: 2.0
+ mark_threshold: 0
+ observation_sources: scan
+ scan:
+ topic: /scan
+ max_obstacle_height: 2.0
+ clearing: True
+ marking: True
+ data_type: "LaserScan"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ always_send_full_costmap: True
+
+global_costmap:
+ global_costmap:
+ ros__parameters:
+ update_frequency: 1.0
+ publish_frequency: 1.0
+ global_frame: map
+ robot_base_frame: base_link
+ robot_radius: 0.22
+ resolution: 0.05
+ track_unknown_space: true
+ plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
+ obstacle_layer:
+ plugin: "nav2_costmap_2d::ObstacleLayer"
+ enabled: True
+ observation_sources: scan
+ scan:
+ topic: /scan
+ max_obstacle_height: 2.0
+ clearing: True
+ marking: True
+ data_type: "LaserScan"
+ raytrace_max_range: 3.0
+ raytrace_min_range: 0.0
+ obstacle_max_range: 2.5
+ obstacle_min_range: 0.0
+ static_layer:
+ plugin: "nav2_costmap_2d::StaticLayer"
+ map_subscribe_transient_local: True
+ inflation_layer:
+ plugin: "nav2_costmap_2d::InflationLayer"
+ cost_scaling_factor: 3.0
+ inflation_radius: 0.7
+ always_send_full_costmap: True
+
+planner_server:
+ ros__parameters:
+ expected_planner_frequency: 20.0
+ planner_plugins: ["GridBased"]
+ costmap_update_timeout: 1.0
+ GridBased:
+ plugin: "nav2_navfn_planner::NavfnPlanner"
+ tolerance: 0.5
+ use_astar: false
+ allow_unknown: true
+
+smoother_server:
+ ros__parameters:
+ smoother_plugins: ["simple_smoother"]
+ simple_smoother:
+ plugin: "nav2_smoother::SimpleSmoother"
+ tolerance: 1.0e-10
+ max_its: 1000
+ do_refinement: True
+
+behavior_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ local_costmap_topic: local_costmap/costmap_raw
+ global_costmap_topic: global_costmap/costmap_raw
+ local_footprint_topic: local_costmap/published_footprint
+ global_footprint_topic: global_costmap/published_footprint
+ cycle_frequency: 10.0
+ behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
+ spin:
+ plugin: "nav2_behaviors::Spin"
+ backup:
+ plugin: "nav2_behaviors::BackUp"
+ drive_on_heading:
+ plugin: "nav2_behaviors::DriveOnHeading"
+ wait:
+ plugin: "nav2_behaviors::Wait"
+ assisted_teleop:
+ plugin: "nav2_behaviors::AssistedTeleop"
+ local_frame: odom
+ global_frame: map
+ robot_base_frame: base_link
+ transform_tolerance: 0.1
+ simulate_ahead_time: 2.0
+ max_rotational_vel: 1.0
+ min_rotational_vel: 0.4
+ rotational_acc_lim: 3.2
+
+waypoint_follower:
+ ros__parameters:
+ loop_rate: 20
+ stop_on_failure: false
+ action_server_result_timeout: 900.0
+ waypoint_task_executor_plugin: "wait_at_waypoint"
+ wait_at_waypoint:
+ plugin: "nav2_waypoint_follower::WaitAtWaypoint"
+ enabled: True
+ waypoint_pause_duration: 200
+
+route_server:
+ ros__parameters:
+ # The graph_filepath does not need to be specified since it going to be set by defaults in launch.
+ # If you'd rather set it in the yaml, remove the default "graph" value in the launch file(s).
+ # file & provide full path to map below. If graph config or launch default is provided, it is used
+ # graph_filepath: $(find-pkg-share nav2_route)/graphs/aws_graph.geojson
+ boundary_radius_to_achieve_node: 1.0
+ radius_to_achieve_node: 2.0
+ smooth_corners: true
+ operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"]
+ ReroutingService:
+ plugin: "nav2_route::ReroutingService"
+ AdjustSpeedLimit:
+ plugin: "nav2_route::AdjustSpeedLimit"
+ CollisionMonitor:
+ plugin: "nav2_route::CollisionMonitor"
+ max_collision_dist: 3.0
+ edge_cost_functions: ["DistanceScorer", "CostmapScorer"]
+ DistanceScorer:
+ plugin: "nav2_route::DistanceScorer"
+ CostmapScorer:
+ plugin: "nav2_route::CostmapScorer"
+
+velocity_smoother:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ smoothing_frequency: 20.0
+ stamp_smoothed_velocity_with_smoothing_time: False
+ scale_velocities: False
+ feedback: "OPEN_LOOP"
+ max_velocity: [0.5, 0.0, 2.0]
+ min_velocity: [-0.5, 0.0, -2.0]
+ max_accel: [2.5, 0.0, 3.2]
+ max_decel: [-2.5, 0.0, -3.2]
+ odom_topic: "odom"
+ odom_duration: 0.1
+ deadband_velocity: [0.0, 0.0, 0.0]
+ velocity_timeout: 1.0
+
+collision_monitor:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ cmd_vel_in_topic: "cmd_vel_smoothed"
+ cmd_vel_out_topic: "cmd_vel"
+ state_topic: "collision_monitor_state"
+ transform_tolerance: 0.2
+ source_timeout: 1.0
+ base_shift_correction: True
+ stop_pub_timeout: 2.0
+ # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types,
+ # and robot footprint for "approach" action type.
+ polygons: ["FootprintApproach"]
+ FootprintApproach:
+ type: "polygon"
+ action_type: "approach"
+ footprint_topic: "/local_costmap/published_footprint"
+ time_before_collision: 1.2
+ simulation_time_step: 0.1
+ min_points: 6
+ visualize: False
+ enabled: True
+ observation_sources: ["scan"]
+ scan:
+ type: "scan"
+ topic: "scan"
+ min_height: 0.15
+ max_height: 2.0
+ enabled: True
+
+docking_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ controller_frequency: 50.0
+ initial_perception_timeout: 5.0
+ wait_charge_timeout: 5.0
+ dock_approach_timeout: 30.0
+ undock_linear_tolerance: 0.05
+ undock_angular_tolerance: 0.1
+ max_retries: 3
+ base_frame: "base_link"
+ fixed_frame: "odom"
+ dock_backwards: false
+ dock_prestaging_tolerance: 0.5
+
+ # Types of docks
+ dock_plugins: ['simple_charging_dock']
+ simple_charging_dock:
+ plugin: 'opennav_docking::SimpleChargingDock'
+ docking_threshold: 0.05
+ staging_x_offset: -0.7
+ use_external_detection_pose: true
+ use_battery_status: false # true
+ use_stall_detection: false # true
+
+ external_detection_timeout: 1.0
+ external_detection_translation_x: -0.18
+ external_detection_translation_y: 0.0
+ external_detection_rotation_roll: -1.57
+ external_detection_rotation_pitch: -1.57
+ external_detection_rotation_yaw: 0.0
+ filter_coef: 0.1
+
+ # Dock instances
+ # The following example illustrates configuring dock instances.
+ # docks: ['home_dock'] # Input your docks here
+ # home_dock:
+ # type: 'simple_charging_dock'
+ # frame: map
+ # pose: [0.0, 0.0, 0.0]
+
+ controller:
+ k_phi: 3.0
+ k_delta: 2.0
+ v_linear_min: 0.15
+ v_linear_max: 0.15
+ use_collision_detection: true
+ costmap_topic: "local_costmap/costmap_raw"
+ footprint_topic: "local_costmap/published_footprint"
+ transform_tolerance: 0.1
+ projection_time: 5.0
+ simulation_step: 0.1
+ dock_collision_threshold: 0.3
+
+loopback_simulator:
+ ros__parameters:
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ map_frame_id: "map"
+ scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link'
+ update_duration: 0.02
+ scan_range_min: 0.05
+ scan_range_max: 30.0
+ scan_angle_min: -3.1415
+ scan_angle_max: 3.1415
+ scan_angle_increment: 0.02617
+ scan_use_inf: true
diff --git a/rtabmap_demos/params/turtlebot3_rgbd_nav2_params.yaml b/rtabmap_demos/params/turtlebot3_rgbd_nav2_params.yaml
index 838c80b3..5d32f405 100644
--- a/rtabmap_demos/params/turtlebot3_rgbd_nav2_params.yaml
+++ b/rtabmap_demos/params/turtlebot3_rgbd_nav2_params.yaml
@@ -1,85 +1,44 @@
# rtabmap_demos: We add segmented ground and obstacles to voxel_layer of the local costmap and removed scan source.
bt_navigator:
ros__parameters:
- use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
bt_loop_duration: 10
default_server_timeout: 20
wait_for_service_timeout: 1000
+ action_server_result_timeout: 900.0
+ navigators: ["navigate_to_pose", "navigate_through_poses"]
+ navigate_to_pose:
+ plugin: "nav2_bt_navigator::NavigateToPoseNavigator"
+ navigate_through_poses:
+ plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
- plugin_lib_names:
- - nav2_compute_path_to_pose_action_bt_node
- - nav2_compute_path_through_poses_action_bt_node
- - nav2_smooth_path_action_bt_node
- - nav2_follow_path_action_bt_node
- - nav2_spin_action_bt_node
- - nav2_wait_action_bt_node
- - nav2_assisted_teleop_action_bt_node
- - nav2_back_up_action_bt_node
- - nav2_drive_on_heading_bt_node
- - nav2_clear_costmap_service_bt_node
- - nav2_is_stuck_condition_bt_node
- - nav2_goal_reached_condition_bt_node
- - nav2_goal_updated_condition_bt_node
- - nav2_globally_updated_goal_condition_bt_node
- - nav2_is_path_valid_condition_bt_node
- - nav2_initial_pose_received_condition_bt_node
- - nav2_reinitialize_global_localization_service_bt_node
- - nav2_rate_controller_bt_node
- - nav2_distance_controller_bt_node
- - nav2_speed_controller_bt_node
- - nav2_truncate_path_action_bt_node
- - nav2_truncate_path_local_action_bt_node
- - nav2_goal_updater_node_bt_node
- - nav2_recovery_node_bt_node
- - nav2_pipeline_sequence_bt_node
- - nav2_round_robin_node_bt_node
- - nav2_transform_available_condition_bt_node
- - nav2_time_expired_condition_bt_node
- - nav2_path_expiring_timer_condition
- - nav2_distance_traveled_condition_bt_node
- - nav2_single_trigger_bt_node
- - nav2_goal_updated_controller_bt_node
- - nav2_is_battery_low_condition_bt_node
- - nav2_navigate_through_poses_action_bt_node
- - nav2_navigate_to_pose_action_bt_node
- - nav2_remove_passed_goals_action_bt_node
- - nav2_planner_selector_bt_node
- - nav2_controller_selector_bt_node
- - nav2_goal_checker_selector_bt_node
- - nav2_controller_cancel_bt_node
- - nav2_path_longer_on_approach_bt_node
- - nav2_wait_cancel_bt_node
- - nav2_spin_cancel_bt_node
- - nav2_back_up_cancel_bt_node
- - nav2_assisted_teleop_cancel_bt_node
- - nav2_drive_on_heading_cancel_bt_node
- - nav2_is_battery_charging_condition_bt_node
-bt_navigator_navigate_through_poses_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings).
+ # Built-in plugins are added automatically
+ # plugin_lib_names: []
-bt_navigator_navigate_to_pose_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ error_code_names:
+ - compute_path_error_code
+ - follow_path_error_code
controller_server:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
controller_frequency: 20.0
+ costmap_update_timeout: 0.30
min_x_velocity_threshold: 0.001
min_y_velocity_threshold: 0.5
min_theta_velocity_threshold: 0.001
failure_tolerance: 0.3
- progress_checker_plugin: "progress_checker"
+ progress_checker_plugins: ["progress_checker"]
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
controller_plugins: ["FollowPath"]
+ use_realtime_priority: false
# Progress checker parameters
progress_checker:
@@ -97,48 +56,96 @@ controller_server:
plugin: "nav2_controller::SimpleGoalChecker"
xy_goal_tolerance: 0.25
yaw_goal_tolerance: 0.25
- # DWB parameters
FollowPath:
- plugin: "dwb_core::DWBLocalPlanner"
- debug_trajectory_details: True
- min_vel_x: 0.0
- min_vel_y: 0.0
- max_vel_x: 0.26
- max_vel_y: 0.0
- max_vel_theta: 1.0
- min_speed_xy: 0.0
- max_speed_xy: 0.26
- min_speed_theta: 0.0
- # Add high threshold velocity for turtlebot 3 issue.
- # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
- acc_lim_x: 2.5
- acc_lim_y: 0.0
- acc_lim_theta: 3.2
- decel_lim_x: -2.5
- decel_lim_y: 0.0
- decel_lim_theta: -3.2
- vx_samples: 20
- vy_samples: 5
- vtheta_samples: 20
- sim_time: 1.7
- linear_granularity: 0.05
- angular_granularity: 0.025
- transform_tolerance: 0.2
- xy_goal_tolerance: 0.25
- trans_stopped_velocity: 0.25
- short_circuit_trajectory_evaluation: True
- stateful: True
- critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
- BaseObstacle.scale: 0.02
- PathAlign.scale: 32.0
- PathAlign.forward_point_distance: 0.1
- GoalAlign.scale: 24.0
- GoalAlign.forward_point_distance: 0.1
- PathDist.scale: 32.0
- GoalDist.scale: 24.0
- RotateToGoal.scale: 32.0
- RotateToGoal.slowing_factor: 5.0
- RotateToGoal.lookahead_time: -1.0
+ plugin: "nav2_mppi_controller::MPPIController"
+ time_steps: 56
+ model_dt: 0.05
+ batch_size: 2000
+ ax_max: 3.0
+ ax_min: -3.0
+ ay_max: 3.0
+ ay_min: -3.0
+ az_max: 3.5
+ vx_std: 0.2
+ vy_std: 0.2
+ wz_std: 0.4
+ vx_max: 0.5
+ vx_min: -0.35
+ vy_max: 0.5
+ wz_max: 1.9
+ iteration_count: 1
+ prune_distance: 1.7
+ transform_tolerance: 0.1
+ temperature: 0.3
+ gamma: 0.015
+ motion_model: "DiffDrive"
+ visualize: true
+ regenerate_noises: true
+ TrajectoryVisualizer:
+ trajectory_step: 5
+ time_step: 3
+ AckermannConstraints:
+ min_turning_r: 0.2
+ critics: [
+ "ConstraintCritic", "CostCritic", "GoalCritic",
+ "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic",
+ "PathAngleCritic", "PreferForwardCritic"]
+ ConstraintCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 4.0
+ GoalCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 1.4
+ GoalAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.0
+ threshold_to_consider: 0.5
+ PreferForwardCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 0.5
+ CostCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.81
+ near_collision_cost: 253
+ critical_cost: 300.0
+ consider_footprint: false
+ collision_cost: 1000000.0
+ near_goal_distance: 1.0
+ trajectory_point_step: 2
+ PathAlignCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 14.0
+ max_path_occupancy_ratio: 0.05
+ trajectory_point_step: 4
+ threshold_to_consider: 0.5
+ offset_from_furthest: 20
+ use_path_orientations: false
+ PathFollowCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ offset_from_furthest: 5
+ threshold_to_consider: 1.4
+ PathAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 2.0
+ offset_from_furthest: 4
+ threshold_to_consider: 0.5
+ max_angle_to_furthest: 1.0
+ mode: 0
+ # TwirlingCritic:
+ # enabled: true
+ # twirling_cost_power: 1
+ # twirling_cost_weight: 10.0
local_costmap:
local_costmap:
@@ -147,7 +154,6 @@ local_costmap:
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_link
- use_sim_time: True
rolling_window: true
width: 3
height: 3
@@ -157,7 +163,7 @@ local_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.70
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
@@ -200,7 +206,6 @@ global_costmap:
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_link
- use_sim_time: True
robot_radius: 0.22
resolution: 0.05
track_unknown_space: true
@@ -211,19 +216,22 @@ global_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.7
always_send_full_costmap: True
-map_server:
+planner_server:
ros__parameters:
- use_sim_time: True
- # Overridden in launch by the "map" launch configuration or provided default value.
- # To use in yaml, remove the default "map" value in the tb3_simulation_launch.py file & provide full path to map below.
- yaml_filename: ""
+ expected_planner_frequency: 20.0
+ planner_plugins: ["GridBased"]
+ costmap_update_timeout: 1.0
+ GridBased:
+ plugin: "nav2_navfn_planner::NavfnPlanner"
+ tolerance: 0.5
+ use_astar: false
+ allow_unknown: true
smoother_server:
ros__parameters:
- use_sim_time: True
smoother_plugins: ["simple_smoother"]
simple_smoother:
plugin: "nav2_smoother::SimpleSmoother"
@@ -233,55 +241,178 @@ smoother_server:
behavior_server:
ros__parameters:
- costmap_topic: local_costmap/costmap_raw
- footprint_topic: local_costmap/published_footprint
+ enable_stamped_cmd_vel: True
+ local_costmap_topic: local_costmap/costmap_raw
+ global_costmap_topic: global_costmap/costmap_raw
+ local_footprint_topic: local_costmap/published_footprint
+ global_footprint_topic: global_costmap/published_footprint
cycle_frequency: 10.0
behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
spin:
- plugin: "nav2_behaviors/Spin"
+ plugin: "nav2_behaviors::Spin"
backup:
- plugin: "nav2_behaviors/BackUp"
+ plugin: "nav2_behaviors::BackUp"
drive_on_heading:
- plugin: "nav2_behaviors/DriveOnHeading"
+ plugin: "nav2_behaviors::DriveOnHeading"
wait:
- plugin: "nav2_behaviors/Wait"
+ plugin: "nav2_behaviors::Wait"
assisted_teleop:
- plugin: "nav2_behaviors/AssistedTeleop"
- global_frame: odom
+ plugin: "nav2_behaviors::AssistedTeleop"
+ local_frame: odom
+ global_frame: map
robot_base_frame: base_link
transform_tolerance: 0.1
- use_sim_time: true
simulate_ahead_time: 2.0
max_rotational_vel: 1.0
min_rotational_vel: 0.4
rotational_acc_lim: 3.2
-robot_state_publisher:
- ros__parameters:
- use_sim_time: True
-
waypoint_follower:
ros__parameters:
- use_sim_time: True
loop_rate: 20
stop_on_failure: false
+ action_server_result_timeout: 900.0
waypoint_task_executor_plugin: "wait_at_waypoint"
wait_at_waypoint:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: True
waypoint_pause_duration: 200
+route_server:
+ ros__parameters:
+ # The graph_filepath does not need to be specified since it going to be set by defaults in launch.
+ # If you'd rather set it in the yaml, remove the default "graph" value in the launch file(s).
+ # file & provide full path to map below. If graph config or launch default is provided, it is used
+ # graph_filepath: $(find-pkg-share nav2_route)/graphs/aws_graph.geojson
+ boundary_radius_to_achieve_node: 1.0
+ radius_to_achieve_node: 2.0
+ smooth_corners: true
+ operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"]
+ ReroutingService:
+ plugin: "nav2_route::ReroutingService"
+ AdjustSpeedLimit:
+ plugin: "nav2_route::AdjustSpeedLimit"
+ CollisionMonitor:
+ plugin: "nav2_route::CollisionMonitor"
+ max_collision_dist: 3.0
+ edge_cost_functions: ["DistanceScorer", "CostmapScorer"]
+ DistanceScorer:
+ plugin: "nav2_route::DistanceScorer"
+ CostmapScorer:
+ plugin: "nav2_route::CostmapScorer"
+
velocity_smoother:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
smoothing_frequency: 20.0
+ stamp_smoothed_velocity_with_smoothing_time: False
scale_velocities: False
feedback: "OPEN_LOOP"
- max_velocity: [0.26, 0.0, 1.0]
- min_velocity: [-0.26, 0.0, -1.0]
+ max_velocity: [0.5, 0.0, 2.0]
+ min_velocity: [-0.5, 0.0, -2.0]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0
+
+collision_monitor:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ cmd_vel_in_topic: "cmd_vel_smoothed"
+ cmd_vel_out_topic: "cmd_vel"
+ state_topic: "collision_monitor_state"
+ transform_tolerance: 0.2
+ source_timeout: 1.0
+ base_shift_correction: True
+ stop_pub_timeout: 2.0
+ # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types,
+ # and robot footprint for "approach" action type.
+ polygons: ["FootprintApproach"]
+ FootprintApproach:
+ type: "polygon"
+ action_type: "approach"
+ footprint_topic: "/local_costmap/published_footprint"
+ time_before_collision: 1.2
+ simulation_time_step: 0.1
+ min_points: 6
+ visualize: False
+ enabled: True
+ observation_sources: ["scan"]
+ scan:
+ type: "scan"
+ topic: "scan"
+ min_height: 0.15
+ max_height: 2.0
+ enabled: True
+
+docking_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ controller_frequency: 50.0
+ initial_perception_timeout: 5.0
+ wait_charge_timeout: 5.0
+ dock_approach_timeout: 30.0
+ undock_linear_tolerance: 0.05
+ undock_angular_tolerance: 0.1
+ max_retries: 3
+ base_frame: "base_link"
+ fixed_frame: "odom"
+ dock_backwards: false
+ dock_prestaging_tolerance: 0.5
+
+ # Types of docks
+ dock_plugins: ['simple_charging_dock']
+ simple_charging_dock:
+ plugin: 'opennav_docking::SimpleChargingDock'
+ docking_threshold: 0.05
+ staging_x_offset: -0.7
+ use_external_detection_pose: true
+ use_battery_status: false # true
+ use_stall_detection: false # true
+
+ external_detection_timeout: 1.0
+ external_detection_translation_x: -0.18
+ external_detection_translation_y: 0.0
+ external_detection_rotation_roll: -1.57
+ external_detection_rotation_pitch: -1.57
+ external_detection_rotation_yaw: 0.0
+ filter_coef: 0.1
+
+ # Dock instances
+ # The following example illustrates configuring dock instances.
+ # docks: ['home_dock'] # Input your docks here
+ # home_dock:
+ # type: 'simple_charging_dock'
+ # frame: map
+ # pose: [0.0, 0.0, 0.0]
+
+ controller:
+ k_phi: 3.0
+ k_delta: 2.0
+ v_linear_min: 0.15
+ v_linear_max: 0.15
+ use_collision_detection: true
+ costmap_topic: "local_costmap/costmap_raw"
+ footprint_topic: "local_costmap/published_footprint"
+ transform_tolerance: 0.1
+ projection_time: 5.0
+ simulation_step: 0.1
+ dock_collision_threshold: 0.3
+
+loopback_simulator:
+ ros__parameters:
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ map_frame_id: "map"
+ scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link'
+ update_duration: 0.02
+ scan_range_min: 0.05
+ scan_range_max: 30.0
+ scan_angle_min: -3.1415
+ scan_angle_max: 3.1415
+ scan_angle_increment: 0.02617
+ scan_use_inf: true
diff --git a/rtabmap_demos/params/turtlebot3_rgbd_scan_nav2_params.yaml b/rtabmap_demos/params/turtlebot3_rgbd_scan_nav2_params.yaml
index 43dce5ba..cb833425 100644
--- a/rtabmap_demos/params/turtlebot3_rgbd_scan_nav2_params.yaml
+++ b/rtabmap_demos/params/turtlebot3_rgbd_scan_nav2_params.yaml
@@ -1,85 +1,44 @@
# rtabmap_demos: We add segmented ground and obstacles to voxel_layer of the local costmap.
bt_navigator:
ros__parameters:
- use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
bt_loop_duration: 10
default_server_timeout: 20
wait_for_service_timeout: 1000
+ action_server_result_timeout: 900.0
+ navigators: ["navigate_to_pose", "navigate_through_poses"]
+ navigate_to_pose:
+ plugin: "nav2_bt_navigator::NavigateToPoseNavigator"
+ navigate_through_poses:
+ plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
- plugin_lib_names:
- - nav2_compute_path_to_pose_action_bt_node
- - nav2_compute_path_through_poses_action_bt_node
- - nav2_smooth_path_action_bt_node
- - nav2_follow_path_action_bt_node
- - nav2_spin_action_bt_node
- - nav2_wait_action_bt_node
- - nav2_assisted_teleop_action_bt_node
- - nav2_back_up_action_bt_node
- - nav2_drive_on_heading_bt_node
- - nav2_clear_costmap_service_bt_node
- - nav2_is_stuck_condition_bt_node
- - nav2_goal_reached_condition_bt_node
- - nav2_goal_updated_condition_bt_node
- - nav2_globally_updated_goal_condition_bt_node
- - nav2_is_path_valid_condition_bt_node
- - nav2_initial_pose_received_condition_bt_node
- - nav2_reinitialize_global_localization_service_bt_node
- - nav2_rate_controller_bt_node
- - nav2_distance_controller_bt_node
- - nav2_speed_controller_bt_node
- - nav2_truncate_path_action_bt_node
- - nav2_truncate_path_local_action_bt_node
- - nav2_goal_updater_node_bt_node
- - nav2_recovery_node_bt_node
- - nav2_pipeline_sequence_bt_node
- - nav2_round_robin_node_bt_node
- - nav2_transform_available_condition_bt_node
- - nav2_time_expired_condition_bt_node
- - nav2_path_expiring_timer_condition
- - nav2_distance_traveled_condition_bt_node
- - nav2_single_trigger_bt_node
- - nav2_goal_updated_controller_bt_node
- - nav2_is_battery_low_condition_bt_node
- - nav2_navigate_through_poses_action_bt_node
- - nav2_navigate_to_pose_action_bt_node
- - nav2_remove_passed_goals_action_bt_node
- - nav2_planner_selector_bt_node
- - nav2_controller_selector_bt_node
- - nav2_goal_checker_selector_bt_node
- - nav2_controller_cancel_bt_node
- - nav2_path_longer_on_approach_bt_node
- - nav2_wait_cancel_bt_node
- - nav2_spin_cancel_bt_node
- - nav2_back_up_cancel_bt_node
- - nav2_assisted_teleop_cancel_bt_node
- - nav2_drive_on_heading_cancel_bt_node
- - nav2_is_battery_charging_condition_bt_node
-bt_navigator_navigate_through_poses_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings).
+ # Built-in plugins are added automatically
+ # plugin_lib_names: []
-bt_navigator_navigate_to_pose_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ error_code_names:
+ - compute_path_error_code
+ - follow_path_error_code
controller_server:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
controller_frequency: 20.0
+ costmap_update_timeout: 0.30
min_x_velocity_threshold: 0.001
min_y_velocity_threshold: 0.5
min_theta_velocity_threshold: 0.001
failure_tolerance: 0.3
- progress_checker_plugin: "progress_checker"
+ progress_checker_plugins: ["progress_checker"]
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
controller_plugins: ["FollowPath"]
+ use_realtime_priority: false
# Progress checker parameters
progress_checker:
@@ -97,48 +56,96 @@ controller_server:
plugin: "nav2_controller::SimpleGoalChecker"
xy_goal_tolerance: 0.25
yaw_goal_tolerance: 0.25
- # DWB parameters
FollowPath:
- plugin: "dwb_core::DWBLocalPlanner"
- debug_trajectory_details: True
- min_vel_x: 0.0
- min_vel_y: 0.0
- max_vel_x: 0.26
- max_vel_y: 0.0
- max_vel_theta: 1.0
- min_speed_xy: 0.0
- max_speed_xy: 0.26
- min_speed_theta: 0.0
- # Add high threshold velocity for turtlebot 3 issue.
- # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
- acc_lim_x: 2.5
- acc_lim_y: 0.0
- acc_lim_theta: 3.2
- decel_lim_x: -2.5
- decel_lim_y: 0.0
- decel_lim_theta: -3.2
- vx_samples: 20
- vy_samples: 5
- vtheta_samples: 20
- sim_time: 1.7
- linear_granularity: 0.05
- angular_granularity: 0.025
- transform_tolerance: 0.2
- xy_goal_tolerance: 0.25
- trans_stopped_velocity: 0.25
- short_circuit_trajectory_evaluation: True
- stateful: True
- critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
- BaseObstacle.scale: 0.02
- PathAlign.scale: 32.0
- PathAlign.forward_point_distance: 0.1
- GoalAlign.scale: 24.0
- GoalAlign.forward_point_distance: 0.1
- PathDist.scale: 32.0
- GoalDist.scale: 24.0
- RotateToGoal.scale: 32.0
- RotateToGoal.slowing_factor: 5.0
- RotateToGoal.lookahead_time: -1.0
+ plugin: "nav2_mppi_controller::MPPIController"
+ time_steps: 56
+ model_dt: 0.05
+ batch_size: 2000
+ ax_max: 3.0
+ ax_min: -3.0
+ ay_max: 3.0
+ ay_min: -3.0
+ az_max: 3.5
+ vx_std: 0.2
+ vy_std: 0.2
+ wz_std: 0.4
+ vx_max: 0.5
+ vx_min: -0.35
+ vy_max: 0.5
+ wz_max: 1.9
+ iteration_count: 1
+ prune_distance: 1.7
+ transform_tolerance: 0.1
+ temperature: 0.3
+ gamma: 0.015
+ motion_model: "DiffDrive"
+ visualize: true
+ regenerate_noises: true
+ TrajectoryVisualizer:
+ trajectory_step: 5
+ time_step: 3
+ AckermannConstraints:
+ min_turning_r: 0.2
+ critics: [
+ "ConstraintCritic", "CostCritic", "GoalCritic",
+ "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic",
+ "PathAngleCritic", "PreferForwardCritic"]
+ ConstraintCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 4.0
+ GoalCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 1.4
+ GoalAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.0
+ threshold_to_consider: 0.5
+ PreferForwardCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 0.5
+ CostCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.81
+ near_collision_cost: 253
+ critical_cost: 300.0
+ consider_footprint: false
+ collision_cost: 1000000.0
+ near_goal_distance: 1.0
+ trajectory_point_step: 2
+ PathAlignCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 14.0
+ max_path_occupancy_ratio: 0.05
+ trajectory_point_step: 4
+ threshold_to_consider: 0.5
+ offset_from_furthest: 20
+ use_path_orientations: false
+ PathFollowCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ offset_from_furthest: 5
+ threshold_to_consider: 1.4
+ PathAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 2.0
+ offset_from_furthest: 4
+ threshold_to_consider: 0.5
+ max_angle_to_furthest: 1.0
+ mode: 0
+ # TwirlingCritic:
+ # enabled: true
+ # twirling_cost_power: 1
+ # twirling_cost_weight: 10.0
local_costmap:
local_costmap:
@@ -147,7 +154,6 @@ local_costmap:
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_link
- use_sim_time: True
rolling_window: true
width: 3
height: 3
@@ -157,7 +163,7 @@ local_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.70
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
@@ -210,7 +216,6 @@ global_costmap:
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_link
- use_sim_time: True
robot_radius: 0.22
resolution: 0.05
track_unknown_space: true
@@ -221,23 +226,22 @@ global_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.7
always_send_full_costmap: True
planner_server:
ros__parameters:
expected_planner_frequency: 20.0
- use_sim_time: True
planner_plugins: ["GridBased"]
+ costmap_update_timeout: 1.0
GridBased:
- plugin: "nav2_navfn_planner/NavfnPlanner"
+ plugin: "nav2_navfn_planner::NavfnPlanner"
tolerance: 0.5
use_astar: false
allow_unknown: true
smoother_server:
ros__parameters:
- use_sim_time: True
smoother_plugins: ["simple_smoother"]
simple_smoother:
plugin: "nav2_smoother::SimpleSmoother"
@@ -247,55 +251,178 @@ smoother_server:
behavior_server:
ros__parameters:
- costmap_topic: local_costmap/costmap_raw
- footprint_topic: local_costmap/published_footprint
+ enable_stamped_cmd_vel: True
+ local_costmap_topic: local_costmap/costmap_raw
+ global_costmap_topic: global_costmap/costmap_raw
+ local_footprint_topic: local_costmap/published_footprint
+ global_footprint_topic: global_costmap/published_footprint
cycle_frequency: 10.0
behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
spin:
- plugin: "nav2_behaviors/Spin"
+ plugin: "nav2_behaviors::Spin"
backup:
- plugin: "nav2_behaviors/BackUp"
+ plugin: "nav2_behaviors::BackUp"
drive_on_heading:
- plugin: "nav2_behaviors/DriveOnHeading"
+ plugin: "nav2_behaviors::DriveOnHeading"
wait:
- plugin: "nav2_behaviors/Wait"
+ plugin: "nav2_behaviors::Wait"
assisted_teleop:
- plugin: "nav2_behaviors/AssistedTeleop"
- global_frame: odom
+ plugin: "nav2_behaviors::AssistedTeleop"
+ local_frame: odom
+ global_frame: map
robot_base_frame: base_link
transform_tolerance: 0.1
- use_sim_time: true
simulate_ahead_time: 2.0
max_rotational_vel: 1.0
min_rotational_vel: 0.4
rotational_acc_lim: 3.2
-robot_state_publisher:
- ros__parameters:
- use_sim_time: True
-
waypoint_follower:
ros__parameters:
- use_sim_time: True
loop_rate: 20
stop_on_failure: false
+ action_server_result_timeout: 900.0
waypoint_task_executor_plugin: "wait_at_waypoint"
wait_at_waypoint:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: True
waypoint_pause_duration: 200
+route_server:
+ ros__parameters:
+ # The graph_filepath does not need to be specified since it going to be set by defaults in launch.
+ # If you'd rather set it in the yaml, remove the default "graph" value in the launch file(s).
+ # file & provide full path to map below. If graph config or launch default is provided, it is used
+ # graph_filepath: $(find-pkg-share nav2_route)/graphs/aws_graph.geojson
+ boundary_radius_to_achieve_node: 1.0
+ radius_to_achieve_node: 2.0
+ smooth_corners: true
+ operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"]
+ ReroutingService:
+ plugin: "nav2_route::ReroutingService"
+ AdjustSpeedLimit:
+ plugin: "nav2_route::AdjustSpeedLimit"
+ CollisionMonitor:
+ plugin: "nav2_route::CollisionMonitor"
+ max_collision_dist: 3.0
+ edge_cost_functions: ["DistanceScorer", "CostmapScorer"]
+ DistanceScorer:
+ plugin: "nav2_route::DistanceScorer"
+ CostmapScorer:
+ plugin: "nav2_route::CostmapScorer"
+
velocity_smoother:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
smoothing_frequency: 20.0
+ stamp_smoothed_velocity_with_smoothing_time: False
scale_velocities: False
feedback: "OPEN_LOOP"
- max_velocity: [0.26, 0.0, 1.0]
- min_velocity: [-0.26, 0.0, -1.0]
+ max_velocity: [0.5, 0.0, 2.0]
+ min_velocity: [-0.5, 0.0, -2.0]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0
+
+collision_monitor:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ cmd_vel_in_topic: "cmd_vel_smoothed"
+ cmd_vel_out_topic: "cmd_vel"
+ state_topic: "collision_monitor_state"
+ transform_tolerance: 0.2
+ source_timeout: 1.0
+ base_shift_correction: True
+ stop_pub_timeout: 2.0
+ # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types,
+ # and robot footprint for "approach" action type.
+ polygons: ["FootprintApproach"]
+ FootprintApproach:
+ type: "polygon"
+ action_type: "approach"
+ footprint_topic: "/local_costmap/published_footprint"
+ time_before_collision: 1.2
+ simulation_time_step: 0.1
+ min_points: 6
+ visualize: False
+ enabled: True
+ observation_sources: ["scan"]
+ scan:
+ type: "scan"
+ topic: "scan"
+ min_height: 0.15
+ max_height: 2.0
+ enabled: True
+
+docking_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ controller_frequency: 50.0
+ initial_perception_timeout: 5.0
+ wait_charge_timeout: 5.0
+ dock_approach_timeout: 30.0
+ undock_linear_tolerance: 0.05
+ undock_angular_tolerance: 0.1
+ max_retries: 3
+ base_frame: "base_link"
+ fixed_frame: "odom"
+ dock_backwards: false
+ dock_prestaging_tolerance: 0.5
+
+ # Types of docks
+ dock_plugins: ['simple_charging_dock']
+ simple_charging_dock:
+ plugin: 'opennav_docking::SimpleChargingDock'
+ docking_threshold: 0.05
+ staging_x_offset: -0.7
+ use_external_detection_pose: true
+ use_battery_status: false # true
+ use_stall_detection: false # true
+
+ external_detection_timeout: 1.0
+ external_detection_translation_x: -0.18
+ external_detection_translation_y: 0.0
+ external_detection_rotation_roll: -1.57
+ external_detection_rotation_pitch: -1.57
+ external_detection_rotation_yaw: 0.0
+ filter_coef: 0.1
+
+ # Dock instances
+ # The following example illustrates configuring dock instances.
+ # docks: ['home_dock'] # Input your docks here
+ # home_dock:
+ # type: 'simple_charging_dock'
+ # frame: map
+ # pose: [0.0, 0.0, 0.0]
+
+ controller:
+ k_phi: 3.0
+ k_delta: 2.0
+ v_linear_min: 0.15
+ v_linear_max: 0.15
+ use_collision_detection: true
+ costmap_topic: "local_costmap/costmap_raw"
+ footprint_topic: "local_costmap/published_footprint"
+ transform_tolerance: 0.1
+ projection_time: 5.0
+ simulation_step: 0.1
+ dock_collision_threshold: 0.3
+
+loopback_simulator:
+ ros__parameters:
+ base_frame_id: "base_footprint"
+ odom_frame_id: "odom"
+ map_frame_id: "map"
+ scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link'
+ update_duration: 0.02
+ scan_range_min: 0.05
+ scan_range_max: 30.0
+ scan_angle_min: -3.1415
+ scan_angle_max: 3.1415
+ scan_angle_increment: 0.02617
+ scan_use_inf: true
\ No newline at end of file
diff --git a/rtabmap_demos/params/turtlebot3_scan_nav2_params.yaml b/rtabmap_demos/params/turtlebot3_scan_nav2_params.yaml
index 9c33bdb2..1acddc5b 100644
--- a/rtabmap_demos/params/turtlebot3_scan_nav2_params.yaml
+++ b/rtabmap_demos/params/turtlebot3_scan_nav2_params.yaml
@@ -1,85 +1,44 @@
-# Modified to use icp_odom frame
+# Using icp_odom TF instead of odom
bt_navigator:
ros__parameters:
- use_sim_time: True
global_frame: map
robot_base_frame: base_link
odom_topic: /odom
bt_loop_duration: 10
default_server_timeout: 20
wait_for_service_timeout: 1000
+ action_server_result_timeout: 900.0
+ navigators: ["navigate_to_pose", "navigate_through_poses"]
+ navigate_to_pose:
+ plugin: "nav2_bt_navigator::NavigateToPoseNavigator"
+ navigate_through_poses:
+ plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator"
# 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults:
# nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml
# nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml
# They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2.
- plugin_lib_names:
- - nav2_compute_path_to_pose_action_bt_node
- - nav2_compute_path_through_poses_action_bt_node
- - nav2_smooth_path_action_bt_node
- - nav2_follow_path_action_bt_node
- - nav2_spin_action_bt_node
- - nav2_wait_action_bt_node
- - nav2_assisted_teleop_action_bt_node
- - nav2_back_up_action_bt_node
- - nav2_drive_on_heading_bt_node
- - nav2_clear_costmap_service_bt_node
- - nav2_is_stuck_condition_bt_node
- - nav2_goal_reached_condition_bt_node
- - nav2_goal_updated_condition_bt_node
- - nav2_globally_updated_goal_condition_bt_node
- - nav2_is_path_valid_condition_bt_node
- - nav2_initial_pose_received_condition_bt_node
- - nav2_reinitialize_global_localization_service_bt_node
- - nav2_rate_controller_bt_node
- - nav2_distance_controller_bt_node
- - nav2_speed_controller_bt_node
- - nav2_truncate_path_action_bt_node
- - nav2_truncate_path_local_action_bt_node
- - nav2_goal_updater_node_bt_node
- - nav2_recovery_node_bt_node
- - nav2_pipeline_sequence_bt_node
- - nav2_round_robin_node_bt_node
- - nav2_transform_available_condition_bt_node
- - nav2_time_expired_condition_bt_node
- - nav2_path_expiring_timer_condition
- - nav2_distance_traveled_condition_bt_node
- - nav2_single_trigger_bt_node
- - nav2_goal_updated_controller_bt_node
- - nav2_is_battery_low_condition_bt_node
- - nav2_navigate_through_poses_action_bt_node
- - nav2_navigate_to_pose_action_bt_node
- - nav2_remove_passed_goals_action_bt_node
- - nav2_planner_selector_bt_node
- - nav2_controller_selector_bt_node
- - nav2_goal_checker_selector_bt_node
- - nav2_controller_cancel_bt_node
- - nav2_path_longer_on_approach_bt_node
- - nav2_wait_cancel_bt_node
- - nav2_spin_cancel_bt_node
- - nav2_back_up_cancel_bt_node
- - nav2_assisted_teleop_cancel_bt_node
- - nav2_drive_on_heading_cancel_bt_node
- - nav2_is_battery_charging_condition_bt_node
-bt_navigator_navigate_through_poses_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings).
+ # Built-in plugins are added automatically
+ # plugin_lib_names: []
-bt_navigator_navigate_to_pose_rclcpp_node:
- ros__parameters:
- use_sim_time: True
+ error_code_names:
+ - compute_path_error_code
+ - follow_path_error_code
controller_server:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
controller_frequency: 20.0
+ costmap_update_timeout: 0.30
min_x_velocity_threshold: 0.001
min_y_velocity_threshold: 0.5
min_theta_velocity_threshold: 0.001
failure_tolerance: 0.3
- progress_checker_plugin: "progress_checker"
+ progress_checker_plugins: ["progress_checker"]
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
controller_plugins: ["FollowPath"]
+ use_realtime_priority: false
# Progress checker parameters
progress_checker:
@@ -97,48 +56,96 @@ controller_server:
plugin: "nav2_controller::SimpleGoalChecker"
xy_goal_tolerance: 0.25
yaw_goal_tolerance: 0.25
- # DWB parameters
FollowPath:
- plugin: "dwb_core::DWBLocalPlanner"
- debug_trajectory_details: True
- min_vel_x: 0.0
- min_vel_y: 0.0
- max_vel_x: 0.26
- max_vel_y: 0.0
- max_vel_theta: 1.0
- min_speed_xy: 0.0
- max_speed_xy: 0.26
- min_speed_theta: 0.0
- # Add high threshold velocity for turtlebot 3 issue.
- # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
- acc_lim_x: 2.5
- acc_lim_y: 0.0
- acc_lim_theta: 3.2
- decel_lim_x: -2.5
- decel_lim_y: 0.0
- decel_lim_theta: -3.2
- vx_samples: 20
- vy_samples: 5
- vtheta_samples: 20
- sim_time: 1.7
- linear_granularity: 0.05
- angular_granularity: 0.025
- transform_tolerance: 0.2
- xy_goal_tolerance: 0.25
- trans_stopped_velocity: 0.25
- short_circuit_trajectory_evaluation: True
- stateful: True
- critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
- BaseObstacle.scale: 0.02
- PathAlign.scale: 32.0
- PathAlign.forward_point_distance: 0.1
- GoalAlign.scale: 24.0
- GoalAlign.forward_point_distance: 0.1
- PathDist.scale: 32.0
- GoalDist.scale: 24.0
- RotateToGoal.scale: 32.0
- RotateToGoal.slowing_factor: 5.0
- RotateToGoal.lookahead_time: -1.0
+ plugin: "nav2_mppi_controller::MPPIController"
+ time_steps: 56
+ model_dt: 0.05
+ batch_size: 2000
+ ax_max: 3.0
+ ax_min: -3.0
+ ay_max: 3.0
+ ay_min: -3.0
+ az_max: 3.5
+ vx_std: 0.2
+ vy_std: 0.2
+ wz_std: 0.4
+ vx_max: 0.5
+ vx_min: -0.35
+ vy_max: 0.5
+ wz_max: 1.9
+ iteration_count: 1
+ prune_distance: 1.7
+ transform_tolerance: 0.1
+ temperature: 0.3
+ gamma: 0.015
+ motion_model: "DiffDrive"
+ visualize: true
+ regenerate_noises: true
+ TrajectoryVisualizer:
+ trajectory_step: 5
+ time_step: 3
+ AckermannConstraints:
+ min_turning_r: 0.2
+ critics: [
+ "ConstraintCritic", "CostCritic", "GoalCritic",
+ "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic",
+ "PathAngleCritic", "PreferForwardCritic"]
+ ConstraintCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 4.0
+ GoalCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 1.4
+ GoalAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.0
+ threshold_to_consider: 0.5
+ PreferForwardCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ threshold_to_consider: 0.5
+ CostCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 3.81
+ near_collision_cost: 253
+ critical_cost: 300.0
+ consider_footprint: false
+ collision_cost: 1000000.0
+ near_goal_distance: 1.0
+ trajectory_point_step: 2
+ PathAlignCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 14.0
+ max_path_occupancy_ratio: 0.05
+ trajectory_point_step: 4
+ threshold_to_consider: 0.5
+ offset_from_furthest: 20
+ use_path_orientations: false
+ PathFollowCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 5.0
+ offset_from_furthest: 5
+ threshold_to_consider: 1.4
+ PathAngleCritic:
+ enabled: true
+ cost_power: 1
+ cost_weight: 2.0
+ offset_from_furthest: 4
+ threshold_to_consider: 0.5
+ max_angle_to_furthest: 1.0
+ mode: 0
+ # TwirlingCritic:
+ # enabled: true
+ # twirling_cost_power: 1
+ # twirling_cost_weight: 10.0
local_costmap:
local_costmap:
@@ -147,7 +154,6 @@ local_costmap:
publish_frequency: 2.0
global_frame: icp_odom
robot_base_frame: base_link
- use_sim_time: True
rolling_window: true
width: 3
height: 3
@@ -157,7 +163,7 @@ local_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.70
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
@@ -190,7 +196,6 @@ global_costmap:
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_link
- use_sim_time: True
robot_radius: 0.22
resolution: 0.05
track_unknown_space: true
@@ -215,23 +220,22 @@ global_costmap:
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
- inflation_radius: 0.55
+ inflation_radius: 0.7
always_send_full_costmap: True
planner_server:
ros__parameters:
expected_planner_frequency: 20.0
- use_sim_time: True
planner_plugins: ["GridBased"]
+ costmap_update_timeout: 1.0
GridBased:
- plugin: "nav2_navfn_planner/NavfnPlanner"
+ plugin: "nav2_navfn_planner::NavfnPlanner"
tolerance: 0.5
use_astar: false
allow_unknown: true
smoother_server:
ros__parameters:
- use_sim_time: True
smoother_plugins: ["simple_smoother"]
simple_smoother:
plugin: "nav2_smoother::SimpleSmoother"
@@ -241,55 +245,178 @@ smoother_server:
behavior_server:
ros__parameters:
- costmap_topic: local_costmap/costmap_raw
- footprint_topic: local_costmap/published_footprint
+ enable_stamped_cmd_vel: True
+ local_costmap_topic: local_costmap/costmap_raw
+ global_costmap_topic: global_costmap/costmap_raw
+ local_footprint_topic: local_costmap/published_footprint
+ global_footprint_topic: global_costmap/published_footprint
cycle_frequency: 10.0
behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
spin:
- plugin: "nav2_behaviors/Spin"
+ plugin: "nav2_behaviors::Spin"
backup:
- plugin: "nav2_behaviors/BackUp"
+ plugin: "nav2_behaviors::BackUp"
drive_on_heading:
- plugin: "nav2_behaviors/DriveOnHeading"
+ plugin: "nav2_behaviors::DriveOnHeading"
wait:
- plugin: "nav2_behaviors/Wait"
+ plugin: "nav2_behaviors::Wait"
assisted_teleop:
- plugin: "nav2_behaviors/AssistedTeleop"
- global_frame: icp_odom
+ plugin: "nav2_behaviors::AssistedTeleop"
+ local_frame: icp_odom
+ global_frame: map
robot_base_frame: base_link
transform_tolerance: 0.1
- use_sim_time: true
simulate_ahead_time: 2.0
max_rotational_vel: 1.0
min_rotational_vel: 0.4
rotational_acc_lim: 3.2
-robot_state_publisher:
- ros__parameters:
- use_sim_time: True
-
waypoint_follower:
ros__parameters:
- use_sim_time: True
loop_rate: 20
stop_on_failure: false
+ action_server_result_timeout: 900.0
waypoint_task_executor_plugin: "wait_at_waypoint"
wait_at_waypoint:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: True
waypoint_pause_duration: 200
+route_server:
+ ros__parameters:
+ # The graph_filepath does not need to be specified since it going to be set by defaults in launch.
+ # If you'd rather set it in the yaml, remove the default "graph" value in the launch file(s).
+ # file & provide full path to map below. If graph config or launch default is provided, it is used
+ # graph_filepath: $(find-pkg-share nav2_route)/graphs/aws_graph.geojson
+ boundary_radius_to_achieve_node: 1.0
+ radius_to_achieve_node: 2.0
+ smooth_corners: true
+ operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"]
+ ReroutingService:
+ plugin: "nav2_route::ReroutingService"
+ AdjustSpeedLimit:
+ plugin: "nav2_route::AdjustSpeedLimit"
+ CollisionMonitor:
+ plugin: "nav2_route::CollisionMonitor"
+ max_collision_dist: 3.0
+ edge_cost_functions: ["DistanceScorer", "CostmapScorer"]
+ DistanceScorer:
+ plugin: "nav2_route::DistanceScorer"
+ CostmapScorer:
+ plugin: "nav2_route::CostmapScorer"
+
velocity_smoother:
ros__parameters:
- use_sim_time: True
+ enable_stamped_cmd_vel: True
smoothing_frequency: 20.0
+ stamp_smoothed_velocity_with_smoothing_time: False
scale_velocities: False
feedback: "OPEN_LOOP"
- max_velocity: [0.26, 0.0, 1.0]
- min_velocity: [-0.26, 0.0, -1.0]
+ max_velocity: [0.5, 0.0, 2.0]
+ min_velocity: [-0.5, 0.0, -2.0]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0
+
+collision_monitor:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ base_frame_id: "base_footprint"
+ odom_frame_id: "icp_odom"
+ cmd_vel_in_topic: "cmd_vel_smoothed"
+ cmd_vel_out_topic: "cmd_vel"
+ state_topic: "collision_monitor_state"
+ transform_tolerance: 0.2
+ source_timeout: 1.0
+ base_shift_correction: True
+ stop_pub_timeout: 2.0
+ # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types,
+ # and robot footprint for "approach" action type.
+ polygons: ["FootprintApproach"]
+ FootprintApproach:
+ type: "polygon"
+ action_type: "approach"
+ footprint_topic: "/local_costmap/published_footprint"
+ time_before_collision: 1.2
+ simulation_time_step: 0.1
+ min_points: 6
+ visualize: False
+ enabled: True
+ observation_sources: ["scan"]
+ scan:
+ type: "scan"
+ topic: "scan"
+ min_height: 0.15
+ max_height: 2.0
+ enabled: True
+
+docking_server:
+ ros__parameters:
+ enable_stamped_cmd_vel: True
+ controller_frequency: 50.0
+ initial_perception_timeout: 5.0
+ wait_charge_timeout: 5.0
+ dock_approach_timeout: 30.0
+ undock_linear_tolerance: 0.05
+ undock_angular_tolerance: 0.1
+ max_retries: 3
+ base_frame: "base_link"
+ fixed_frame: "icp_odom"
+ dock_backwards: false
+ dock_prestaging_tolerance: 0.5
+
+ # Types of docks
+ dock_plugins: ['simple_charging_dock']
+ simple_charging_dock:
+ plugin: 'opennav_docking::SimpleChargingDock'
+ docking_threshold: 0.05
+ staging_x_offset: -0.7
+ use_external_detection_pose: true
+ use_battery_status: false # true
+ use_stall_detection: false # true
+
+ external_detection_timeout: 1.0
+ external_detection_translation_x: -0.18
+ external_detection_translation_y: 0.0
+ external_detection_rotation_roll: -1.57
+ external_detection_rotation_pitch: -1.57
+ external_detection_rotation_yaw: 0.0
+ filter_coef: 0.1
+
+ # Dock instances
+ # The following example illustrates configuring dock instances.
+ # docks: ['home_dock'] # Input your docks here
+ # home_dock:
+ # type: 'simple_charging_dock'
+ # frame: map
+ # pose: [0.0, 0.0, 0.0]
+
+ controller:
+ k_phi: 3.0
+ k_delta: 2.0
+ v_linear_min: 0.15
+ v_linear_max: 0.15
+ use_collision_detection: true
+ costmap_topic: "local_costmap/costmap_raw"
+ footprint_topic: "local_costmap/published_footprint"
+ transform_tolerance: 0.1
+ projection_time: 5.0
+ simulation_step: 0.1
+ dock_collision_threshold: 0.3
+
+loopback_simulator:
+ ros__parameters:
+ base_frame_id: "base_footprint"
+ odom_frame_id: "icp_odom"
+ map_frame_id: "map"
+ scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link'
+ update_duration: 0.02
+ scan_range_min: 0.05
+ scan_range_max: 30.0
+ scan_angle_min: -3.1415
+ scan_angle_max: 3.1415
+ scan_angle_increment: 0.02617
+ scan_use_inf: true