ROS 学习笔记第三篇。参考https://rsl.ethz.ch/education-students/lectures/ros.html ROS教程
1. TF Transformation System
- tool for keeping track of coordinate frames over time
- maintains relationship between coordinate frames in a tree structure buffered in time
- lets the user transform points, vector, etc. between coordinate frames at desired time
- implemented as publisher/subscriber model on the topics /tf and /tf_static
1 | tf2_msgs/TFMessage.msg |
1 | rosmsg 解析: rosmsg show geometry_msg/Twist |
2. rqt 用户端口
- User interface based on Qt
- Custom interfaces can be setup
- Lots of plugins exit
- Simple to write own plugins
1 | 启动rqt: |
3.URDF unified robot description format
- defines an XML format for representing a robot model
- URDF generation can be scripted with XACRO
- the robot description is stored on the parameter server under /robot_description
4. Simulation Descriptions
simulation description format (SDF)
- defines an XML format to describe: environments, objects, sensors, robots
- sdf is the standard format for gazebo
- gazebo converts a URDF to SDF automatically
5. ros:init()
这是ROS程序调用的第一个函数,用于对ROS程序的初始化。是在定义一个ROS node过程中进入main函数后第一个函数。
在创建ros::NodeHandle之前必须先对ROS程序进行初始化ros::init( argc, argv, string package_name, uint32_t options);
6. ROS 创建 Subscriber 和 Publisher
Subscriber和Publisher都是ros::NodeHandle下定义的类。
1 | 首先,定义 |
Subscriber自动监听topic,在callback函数中进行后续操作。
Publisher需要进行pub_.publish(msgs) 才能对外广播。
7. 汽车坐标系
汽车的前进方向为x轴,对应侧倾角,滚转角 roll;
指向汽车左侧方向为y轴,对应俯仰角,pitch;
指向汽车正上方为z轴,对应偏航角,yaw;