init: ROS2 learning suite
This commit is contained in:
@@ -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',
|
||||
),
|
||||
])
|
||||
Reference in New Issue
Block a user