ROS2 command line

ROS2-NODE

ros2 run turtlesim turtlesim_node

ros2 run turtlesim turtle_teleop_key

ros2 node list

ros2 run turtlesim turtlesim_node --ros-args --remap __node:=my_turtle

ros2 node info /my_turtle

rqt_graph

ros2 topic

ros2 topic list -t

ros2 topic echo <topic_name>

ros2 topic info /turtle1/cmd_vel

ros2 interface show geometry_msgs/msg/Twist

ros2 topic pub <topic_name> <msg_type> '<args>'

ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}"

ros2 topic pub --rate 1 /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}"

ros2 topic echo /turtle1/pose

ros2 topic hz /turtle1/pose

ROS2-SERVICE

ros2 service type <service_name>

ros2 service list -t

ros2 service find <type_name>

ros2 interface show <type_name>

ros2 service call <service_name> <service_type> <arguments>

ros2 service call /spawn turtlesim/srv/Spawn "{x: 2, y: 2, theta: 0.2, name: ''}"

ROS2-PARAM

ros2 param list

ros2 param get <node_name> <parameter_name>

ros2 param set <node_name> <parameter_name> <value>

ros2 param set /turtlesim background_r 150

ros2 param dump <node_name>

ros2 param load <node_name> <parameter_file>

ros2 run <package_name> <executable_name> --ros-args --params-file <file_name>

ros2 run turtlesim turtlesim_node --ros-args --params-file ./turtlesim.yaml

ROS2-ACTINON

ros2 action list

ros2 action list -t

ros2 action info /turtle1/rotate_absolute

ros2 interface show turtlesim/action/RotateAbsolute

ros2 action send_goal <action_name> <action_type> <values>

ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: 1.57}"

ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: -1.57}" –feedback

ROS2-rqt_console

ros2 run rqt_console rqt_console

ros2 run turtlesim turtlesim_node --ros-args --log-level WARN

ROS2-launch file

touch launch/turtlesim_mimic_launch.py

ROS2-CREATE A PACKAGE

ros2 pkg create --build-type ament_cmake <package_name>

ros2 pkg create --build-type ament_python <package_name>

ros2 pkg create --build-type ament_cmake --node-name my_node my_package

ros2 pkg create --build-type ament_python --node-name my_node my_package

ros2 pkg create --build-type ament_cmake --node-name my_node my_package

ros2 pkg create --build-type ament_python --node-name my_node my_package

cd ~/dev_ws

colcon build

colcon build --packages-select my_package

ros2 run my_package my_node

crosdep install -i --from-path src --rosdistro galactic -y

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值