ros

1 篇文章 0 订阅

Filesystem Tools

  1. rospack find xxx
  2. roscd xxx
  3. roscd log
  4. rosls xxx

Creating a ros package

  1. That package.xml file provides meta information about the package
  2. Catkin metapackages must have a boilerplate CMakeLists.txt file

workspace_folder/        -- WORKSPACE
  src/                   -- SOURCE SPACE
    CMakeLists.txt       -- 'Toplevel' CMake file, provided by catkin
    package_1/
      CMakeLists.txt     -- CMakeLists.txt file for package_1
      package.xml        -- Package manifest for package_1
    ...
    package_n/
      CMakeLists.txt     -- CMakeLists.txt file for package_n
      package.xml        -- Package manifest for package_n
Creating a workspace for catkin

  1. mkdir -p ~/catkin_ws/src
  2. cd ~/catkin_ws/src
  3. catkin_init_workspace
  4. cd ~/catkin_ws/
  5. catkin_make

Creating a catkin package

  1. cd ~/catkin_ws/src
  2. catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

package dependencies

  1. rospack depends1 beginner_tutorials
  2. rospack depends beginner_tutorials
    

These dependencies for a package are stored in the package.xml file, look at it.

Building package

  1. catkin_make [make_targets] [-DCMAKE_VARIABLES=...]

ros node

A node really isn't much more than an executable file within a ROS package.

roscore is the first thing you should run when using ROS

  1. roscore
  2. rosnode list
  3. rosnode info
  4. rosrun [package_name] [node_name]
  5. rosnode ping my_turtle

ros topics == message/events

  1. rosrun turtlesim turtlesim_node
  2. rosrun rqt_graph rqt_graph
  3. rostopic -h
  4. rostopic echo [topic]
  5. rostopic list -h
  6. rostopic list -v
  7. rostopic type [topic]
  8. rosmsg show geometry_msgs/Twist
  9. rostopic type /turtle1/command_velocity
  10. rosmsg show turtlesim/Velocity
  11. rostopic pub [topic] [msg_type] [args]
  12. rostopic pub -1 /turtle1/command_velocity turtlesim/Velocity  -- 2.0  1.8
  13. rostopic pub /turtle1/command_velocity turtlesim/Velocity -r 1 -- 2.0  -1.8
  14. rostopic hz [topic]
  15. rostopic hz /turtle1/pose
  16. rostopic type /turtle1/command_velocity | rosmsg show

sql_plot

rqt_plot displays a scrolling time plot of the data published on topics

rosrun rqt_plot rqt_plot

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值