236 字
1 分钟
ros2——service 终端命令
Service 命令
ros2 service -husage: ros2 service [-h] [--include-hidden-services] Call `ros2 service <command> -h` for more detailed usage. ...
Various service related sub-commands
options: -h, --help show this help message and exit --include-hidden-services Consider hidden services as well
Commands: call Call a service find Output a list of available services of a given type list Output a list of available services type Output a service's typelist 输出活动服务列表
ros2 service listros2 service list -tfind 找出某种类型的服务
ros2 service find <type_name>示例:
ros2 service find std_srvs/srv/Emptyros2 service find std_srvs/srv/Empty/clear/resettype 输出服务的接口类型
ros2 service type <service_name>示例:
ros2 service type /clearstd_srvs/srv/Emptycall 调用服务
ros2 service call -husage: ros2 service call [-h] [-r N] service_name service_type [values]
Call a service
positional arguments: values Values to fill the service request with in YAML format (e.g. '{a: 1, b: 2}'), otherwise the service request will be published with default values
options: -h, --help show this help message and exit -r N, --rate N Repeat the call at a specific rate in Hz示例:
/spawn [turtlesim/srv/Spawn]
ros2 interface show turtlesim/srv/Spawnfloat32 xfloat32 yfloat32 thetastring name # Optional. A unique name will be created and returned if this is empty---string nameros2 service call /spawn turtlesim/srv/Spawn "{x: 1.5, y: 2.6}"ros2——service 终端命令
https://blog.wangmasterai.com/posts/ros2系列/服务-service/terminal/分享文章
生成精美分享图或复制链接,与更多人分享本文。
继续阅读
换条路线
从其他文章中稳定抽取
最后更新于 ,距今已过 32 天
部分内容可能已过时