赞
踩
node
查看活动的节点列表:ros2 node list
查看节点详细信息:ros2 node info <node_name>
列出话题:ros2 topic list 显示话题信息:ros2 topic info <topic_name> 查看话题消息类型:ros2 topic type <topic_name> 按消息类型查找话题:ros2 topic find -c <message_type> 命令加-c参数,只统计并显示数量 查阅发布频率:ros2 topic hz <topic_name> 查阅话题带宽:ros2 topic bw <topic_name> 通过header中的时间戳计算消息延迟:ros2 topic delay <topic_name> 打印话题:ros2 topic echo <topic_name> 发布话题: ros2 topic pub <topic_name> <message_type> <message_content> ros2 topic pub -1 <topic_name> <message_type> <message_content>//参数-1只发布一次 ros2 topic pub -t 5 <topic_name> <message_type> <message_content>//参数-t 5循环发布5次结束 ros2 topic pub -r 5 <topic_name> <message_type> <message_content>//参数-r 5以5Hz的频率循环发布 ros2 topic pub --once <topic_name> <message_type> <message_content>//参数--once发布一次退出 命令如下: $ ros2 topic pub control_node/action geometry_msgs/msg/TwistStamped "{header: {stamp:{sec: 0, nanosec: 0}, frame_id: control_node}, twist: {linear: {x: 0.3, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}}"
msg/srv/action
ros2 interface list
命令功能:f分类显示系统内所有的接口,包括消息(Messages)、服务(Services)、动作(Actions)
bag
//查看bag信息:ros2 bag info bag_name
//正常播包命令:ros2 bag play bag_name
//二倍速播包命令:ros2 bag play bag_name -r 2
//循环播包命令:ros2 bag play bag_name -l
//播放单个topic:ros2 bag play bag_name --topics /topic_name
//录制特定topic的包:ros2 bag record topic_name
//录制多个topic的包:ros2 bag record -o new_bag_name topic1_name topic2_name
//录制所有topic的包:ros2 bag record -a
service
//查看服务列表:ros2 service list # 加-t可显示服务消息类型
//查看服务的数据类型:ros2 service type service_name
//查找使用指定数据类型的服务:ros2 service find type_name
//通过命令行调用服务:ros2 service call <service_name> <service_type> <args>
//eg:ros2 service call /spawn turtlesim/srv/Spawn “{x: 2, y: 2, theta: 0.2, name: ‘’}”
action
//列出域内可用的动作列表:ros2 action list # 加 -t 可显示动作消息类型
//查看指定action的信息:ros2 action info action_name
//模拟客户端手动发起动作请求:ros2 action send_goal <action_name> <type_name> <goal_data> <--feedback> --feedback指定是否显示反馈主题信息
//eg ros2 action send_goal /crossing_acton duckietown_interface/action/Crossing “{speed: 0.2, direction: ‘right’}” --feedback
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。