ROS概览

ROS概念与基础操作

ROS的基本概念

  • Publisher/Subscriber
  • Node
  • Topic
  • Service
  • Action
  • Parameter
  • Launch

ROS、Rviz、Gazebo的关系,ROS软件包的配置

ROS本体和Rviz(搭配Moveit),Gazebo对于ROS而言相对独立

ROS在通信时使用的数据类型

rostopic与rosservice

  • 两者的不同
    • rostopic:同步的,回调式的机制,实时更新,适合对实时性要求高,数据量小的情况(如随时更新位置数据)
    • rosservice:异步的,阻塞式的调用机制,有需要再请求,适合对实时性要求低,数据量大的情况(如定时更新地图数据)

URDF

  • 查看URDF
    check_urdf `rospack find pr2_description`/robots/pr2.urdf.xacro > pr2.urdf
    
  • 将URDF可视化(以PR2为例)
    rosrun xacro xacro `rospack find pr2_description`/robots/pr2.urdf.xacro > pr2.urdf
    urdf_to_graphiz pr2.urdf
    
    • 如果没有urdf文件,先将xacro导出为URDF,然后将其输出为PDF文件

TF and TF2

tf.transformations is a fork of https://github.com/cgohlke/transformations/ This package has been deprecated “Transformations.py is no longer actively developed and has a few known issues and numerical instabilities.”

One of their recommended alternatives is to use transforms3d https://matthew-brett.github.io/transforms3d/

This is currently available as a pip dependency: https://index.ros.org/d/python-transforms3d-pi via rosdep.

Effort to package this into a ROS package to make it more resuable would be appreciated. Or to push it into upstream packaging efforts would also work.

  • 替代方案

    • PyKDL +tf_conversions
    • Tranforms3d
      • 安装:pip install transforms3d (注意是transforms3d,transform3d是另外一个包)
      • 使用:
      from transforms3d import euler
      q = euler.euler2quat(pi, 0, -pi/2, 'sxyz')
  • 查看当前的TF状态

    • 以一个TF为基准(如world),输出另一个TF相对于这个TF的状态(如gripper_l_base): rosrun tf tf_echo world gripper_l_base 旋转为RPY(相对世界坐标系),对应的变换为’sxyz’(好像不是)?

      描述坐标系{B}相对于参考坐标系{A}的姿态有两种方式。第一种是绕固定(参考)坐标轴旋转:假设开始两个坐标系重合,先将{B}绕{A}的X轴旋转γ,然后绕{A}的Y轴旋转β,最后绕{A}的Z轴旋转α,就能旋转到当前姿态。可以称其为X-Y-Z fixed angles或RPY角(Roll横滚, Pitch俯仰, Yaw航向)。

      由于是绕固定坐标系旋转,则旋转矩阵为

      欧拉角使用最简单的x,y,z值来分别表示在x,y,z轴上的旋转角度,其取值为0-360(或者0-2pi),一般使用roll,pitch,yaw来表示这些分量的旋转值。需要注意的是,这里的旋转是针对世界坐标系说的,这意味着第一次的旋转不会影响第二、三次的转轴。

      欧拉角容易出现的问题是 1)不易在任意方向的旋转轴插值; 2)万向节死锁;3)旋转的次序无法确定

RViz

MoveIt!

仿真

仿真环境概览

Gazebo

RViz + MoveIt + Gazebo

传感器

2D planning流程

2D的导航

生成地图

  • Map
    • Occupancy Grid - gives probability of obstacles
    • Mapserver Loads a map rosrun map_server map_server mymap.yaml
      • 数据类型nav_msgs/OccupancyGrid 以0~100为范围显示Occupancy Probability
  • GridCells
    • Useful to show cells on a map for visualization of
      • Obstatcles (that our node thinks are obstacles)
      • Inflated obstacles
      • explored area
    • Can be shown in different colors using rviz
    • 数据类型nav_msgs/GridCells

里程计Odom

3D planning流程

其它

资源汇总

(过时)在18.04下编译Kinetic

ROS与ROS2