Files
rtabmap_ros/rtabmap_demos/launch/champ/champ_sim_vslam.launch.py
T
matlabbe 3f6adad463 ROS2 various QOL updates (preparing new binary release) (#1225)
* 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
2024-11-30 17:28:16 -08:00

88 lines
3.0 KiB
Python

# Requires installed https://github.com/chvmp/champ/tree/ros2
#
# Example:
# 1) Launch simulator (gazebo, nav2 and rtabmap):
# $ ros2 launch rtabmap_demos champ_sim_vslam.launch.py
#
# Note that the first time we launch gazebo, it may take a
# while to download all assets. You may need to restart the
# launch to make sure all nodes are started after the sim is ready.
#
# 2) Move the robot:
# b) By sending goals with RVIZ's "Nav2 Goal" button in action bar.
# a) By teleoperating:
# $ ros2 launch champ_teleop teleop.launch.py
#
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction, OpaqueFunction
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.substitutions import FindPackageShare
import os
def launch_setup(context, *args, **kwargs):
sim_launch_path = PathJoinSubstitution(
[FindPackageShare('champ_config'), 'launch', 'gazebo.launch.py']
)
gz_pkg_share = FindPackageShare(package="champ_gazebo").find("champ_gazebo")
champ_vslam = PathJoinSubstitution(
[FindPackageShare('rtabmap_demos'), 'launch', 'champ', 'champ_vslam.launch.py']
)
rviz = LaunchConfiguration('rviz').perform(context)
world = LaunchConfiguration('world').perform(context)
return [
TimerAction(
actions = [
IncludeLaunchDescription(
PythonLaunchDescriptionSource(champ_vslam),
launch_arguments={
'use_sim_time': 'true',
'rviz': rviz,
'rtabmap_viz': LaunchConfiguration('rtabmap_viz'),
'localization': LaunchConfiguration('localization'),
}.items()
)], period = 5.0), # Wait 5 sec to make sure simulator is ready
IncludeLaunchDescription(
PythonLaunchDescriptionSource(sim_launch_path),
launch_arguments={'rviz': 'false',
'world': os.path.join(gz_pkg_share, f"worlds/{world}.world")}.items()
),
]
def generate_launch_description():
return LaunchDescription([
DeclareLaunchArgument(
name='rviz',
default_value='true',
description='Run rviz'
),
DeclareLaunchArgument(
name='rtabmap_viz',
default_value='true',
description='Run rtabmap_viz'
),
DeclareLaunchArgument(
'localization', default_value='false', choices=['true', 'false'],
description='Launch rtabmap in localization mode (a map should have been already created).'),
DeclareLaunchArgument(
'world', default_value='playground',
choices=['outdoor', 'playground'],
description='Champ gazebo world.'),
OpaqueFunction(function=launch_setup)
])