mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 16:57:46 +08:00
* Updating examples and README * updated main readme * odom: Added always_check_imu_tf parameter. sync: increased default sync_queue_size from 2 to 5 (to be more flexible to different hardware), added input and output diagnostics. rtabmap_viz: fixed node with same name redeclared warning. * update readme * Added husky demo * converted demo_robot_mapping.launch to ros2 * Converted stereo_outdoor demo from ros1 to ros2 * Converted multi-session demo to ros2 * Converted demo_find_object launch to ros2 * renamed files * uniformized default qos, increased sync_queue_size default to 10 * Added vlp16 + imu example * Added husky 3D lidar demos * moved demos in subdir * Added vlp16+zed example * rtabmap_viz: ignore odom update if tf not ready when not using topic (to avoid showing red screen). Added champ VSLAM demo. * forwarded camera_model arg for zed examples, removed qos for turtlebot4 demo * pointcloud_to_depthimage: added more error logs, removed output camera_info published twice and match ros1 namespaces * Created two base general examples for 3D lidar usage, then create hardware specific examples on top of them. * Added isaac sim demo * Final update of all demos. Fixed MapCloud rviz plugin crashing when floor/ceiling filtering is used and resulting cloud is empty. * Fixed 2d scan deskewing output frame, moved nav2 params under "params" folder, added number of topics processed/dropped for odometry, added icp_odometry option for turtlebot3 scan-only demo. * rtabmap_demos: added README with examples * Added TOC * bump version to 0.21.9
80 lines
3.3 KiB
Python
80 lines
3.3 KiB
Python
#
|
|
# Note: Make sure you have this fix for turtlebot4_description https://github.com/turtlebot/turtlebot4/pull/434,
|
|
# otherwise, the lidar and camera point cloud won't be aligned correctly.
|
|
#
|
|
# Example:
|
|
# 1) Launch simulator (turtlebot4, nav2 and rtabmap):
|
|
# $ ros2 launch rtabmap_demos turtlebot4_sim_demo.launch.py
|
|
#
|
|
# 2) Click on "Play" button on bottom-left of gazebo.
|
|
#
|
|
# 3) Click on double points ".." button on top-right next to power button to undock.
|
|
#
|
|
# 4) Move the robot:
|
|
# b) By sending goals with RVIZ's "Nav2 Goal" button in action bar.
|
|
# a) By teleoperating:
|
|
# $ ros2 run teleop_twist_keyboard teleop_twist_keyboard
|
|
# c) By using autonomous exploration node (tested with https://github.com/robo-friends/m-explore-ros2):
|
|
# $ ros2 launch explore_lite explore.launch.py
|
|
#
|
|
|
|
from ament_index_python.packages import get_package_share_directory
|
|
|
|
from launch import LaunchDescription
|
|
from launch.actions import DeclareLaunchArgument
|
|
from launch.actions import IncludeLaunchDescription
|
|
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
|
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
|
|
|
|
ARGUMENTS = [
|
|
DeclareLaunchArgument('rviz', default_value='true',
|
|
choices=['true', 'false'], description='Start rviz.'),
|
|
DeclareLaunchArgument('rtabmap_viz', default_value='true',
|
|
choices=['true', 'false'], description='Start rtabmap_viz.'),
|
|
DeclareLaunchArgument('localization', default_value='false',
|
|
choices=['true', 'false'], description='Start rtabmap in localization mode (a map should have been already created).'),
|
|
DeclareLaunchArgument('nav2', default_value='true',
|
|
choices=['true', 'false'], description='Start nav2.'),
|
|
DeclareLaunchArgument('world', default_value='warehouse',
|
|
description='Ignition World'),
|
|
]
|
|
|
|
def generate_launch_description():
|
|
# Directories
|
|
pkg_turtlebot4_ignition_bringup = get_package_share_directory(
|
|
'turtlebot4_ignition_bringup')
|
|
pkg_rtabmap_demos = get_package_share_directory(
|
|
'rtabmap_demos')
|
|
|
|
# Paths
|
|
ignition_launch = PathJoinSubstitution(
|
|
[pkg_turtlebot4_ignition_bringup, 'launch', 'turtlebot4_ignition.launch.py'])
|
|
rtabmap_launch = PathJoinSubstitution(
|
|
[pkg_rtabmap_demos, 'launch', 'turtlebot4', 'turtlebot4_slam.launch.py'])
|
|
|
|
ignition = IncludeLaunchDescription(
|
|
PythonLaunchDescriptionSource([ignition_launch]),
|
|
launch_arguments=[
|
|
('world', LaunchConfiguration('world')),
|
|
('slam', 'false'),
|
|
('localization', 'false'),
|
|
('nav2', LaunchConfiguration('nav2')),
|
|
('rviz', LaunchConfiguration('rviz'))
|
|
]
|
|
)
|
|
|
|
rtabmap = IncludeLaunchDescription(
|
|
PythonLaunchDescriptionSource([rtabmap_launch]),
|
|
launch_arguments=[
|
|
('rtabmap_viz', LaunchConfiguration('rtabmap_viz')),
|
|
('localization', LaunchConfiguration('localization')),
|
|
('use_sim_time', 'true')
|
|
]
|
|
)
|
|
|
|
# Create launch description and add actions
|
|
ld = LaunchDescription(ARGUMENTS)
|
|
ld.add_action(rtabmap) # put it first so that localization arg is not overwritten by the same used by ignition
|
|
ld.add_action(ignition)
|
|
return ld
|