init: ROS2 learning suite
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
full_demo_launch.py —— 整合所有 demo(全套启动)。
|
||||
|
||||
启动的节点:
|
||||
- 4 个 pub/sub 节点(pubsub)
|
||||
- add_two_ints server(srv)
|
||||
- fibonacci action server(action)
|
||||
- 3 节点 URDF TF2(robot)
|
||||
- fake_camera + image_processor(vision)
|
||||
|
||||
总计 ~10 个节点同时运行,展示整个 ROS2 通信栈。
|
||||
"""
|
||||
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import IncludeLaunchDescription
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch_ros.substitutions import FindPackageShare
|
||||
from launch.substitutions import PathJoinSubstitution
|
||||
|
||||
|
||||
def _include(pkg_name, launch_file):
|
||||
pkg = FindPackageShare(pkg_name)
|
||||
path = PathJoinSubstitution([pkg, 'launch', launch_file])
|
||||
return IncludeLaunchDescription(PythonLaunchDescriptionSource(path))
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
return LaunchDescription([
|
||||
_include('py_pubsub', 'pubsub_launch.py'),
|
||||
_include('cpp_pubsub', 'pubsub_launch.py'),
|
||||
_include('py_srv', 'srv_launch.py'),
|
||||
_include('py_action_demo', 'action_launch.py'),
|
||||
_include('cpp_robot_tf2', 'robot_tf2_launch.py'),
|
||||
_include('py_vision_demo', 'vision_launch.py'),
|
||||
])
|
||||
Reference in New Issue
Block a user