init: ROS2 learning suite

This commit is contained in:
xs
2026-08-03 18:09:35 +08:00
commit 5ef38ab508
95 changed files with 13322 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
"""
srv_launch.py —— 启动 add_two_ints 服务端的 launch 文件。
注意:client 不在这里启动,因它是"一次性调用",通常在终端或脚本里跑。
client 用法:
source install/setup.bash
ros2 run py_srv add_two_ints_client 1 2 # 默认参数
ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 3, b: 5}"
"""
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='py_srv',
executable='add_two_ints_server',
name='add_two_ints_server_py',
output='screen',
),
])