ROS中geometry_msgs消息类型、nav_msg消息

2023-05-16

ROS中geometry_msgs消息类型、nav_msg消息

参考: 链接: https://blog.csdn.net/ganbaoni9yang/article/details/50060343.

官方文档:http://docs.ros.org/en/api/geometry_msgs/html/index-msg.html

目录

  • ROS中geometry_msgs消息类型、nav_msg消息
    • 1.geometry_msgs Msg 消息类型
      • geometry_msgs/Point
      • geometry_msgs/Pose
      • geometry_msgs/Pose2D
      • geometry_msgs/PoseWithCovariance
      • geometry_msgs/Quaternion
      • geometry_msgs/TransformStamped
    • 2.nav_msg Msg/Srv 消息类型
      • nav_msgs/Odometry
    • 3.diagnostic_msgs Msg/Srv消息类型
      • diagnostic_msgs/DiagnosticArray
    • 4.sensor_msgs Msg/Srv消息类型
      • sensor_msgs/Imu

1.geometry_msgs Msg 消息类型

节点之间仅支持使用消息通讯

### Message types
Accel
AccelStamped
AccelWithCovariance
AccelWithCovarianceStamped
Inertia
InertiaStamped
Point
Point32
PointStamped
Polygon
PolygonStamped
Pose
Pose2D
PoseArray
PoseStamped
PoseWithCovariance
PoseWithCovarianceStamped
Quaternion
QuaternionStamped
Transform
TransformStamped
Twist
TwistStamped
TwistWithCovariance
TwistWithCovarianceStamped
Vector3
Vector3Stamped
Wrench
WrenchStamped

geometry_msgs/Point

float64 x
float64 y
float64 z

geometry_msgs/Pose

geometry_msgs/Point position # 调用的上面的Point
	float64 x
	float64 y
	float64 z
geometry_msgs/Quaternion orientation #调用的下面的Quarternion
	float64 x
	float64 y
	float64 z
	float64 w

geometry_msgs/Pose2D

	float64 x
	float64 y
	float64 theta

geometry_msgs/PoseWithCovariance

Header header
    uint32 seq
    time stamp
    string frame_id
PoseWithCovariance pose
    geometry_msgs/Pose pose
        geometry_msgs/Point position
            float64 x
            float64 y
            float64 z
        geometry_msgs/Quaternion orientation
            float64 x
            float64 y
            float64 z
            float64 w
    float64[36] covariance
#这表示具有不确定性的自由空间中的姿势。
#6x6协方差矩阵的行主要表示
#方向参数使用固定轴表示。
#按顺序,参数为:
 # (x,y,z,绕X轴旋转,绕Y轴旋转,绕Z轴旋转)
 # geometry_msgs/Pose pose #这个又用的是Pose的消格式
 # float64[36] covariance #表示协方差

geometry_msgs/Quaternion

以四元数形式表示自由空间中的方向

float64 x
float64 y
float64 z
float64 w

geometry_msgs/TransformStamped

这表示从坐标框架header.frame_id到坐标框架child_frame_id的转换
此消息主要由tf软件包使用。

包含内容:

std_mags/Header header 
    uint32 seq #存储原始数据类型
    time stamp #存储ROS中的时间戳信息
    string frame_id #用于表示和此数据关联的帧,在坐标系变化中可以理解为数据所在的坐标系名称
string child_frame_id   # the frame id of the child frame
geometry_msgs/Transform transform
    geometry_msgs/Vector3 translation # x,y,z 位置
        float64 x
        float64 y
        float64 z
    geometry_msgs/Quaternion rotation #四元数
        float64 x
        float64 y
        flaot64 z
        float64 w
        */

以后用一点补一点吧 真题内容太多了 官网里都有
官方文档:http://docs.ros.org/en/api/geometry_msgs/html/index-msg.html

2.nav_msg Msg/Srv 消息类型

支持节点之间服务和消息通讯

### Message types
Path
MapMetaData
OccupancyGrid
GridCells
Odometry
### Service types
GetPlan
GetMap

nav_msgs/Odometry

Header header
    uint32 seq
    time stamp
    string frame_id
string child_frame_id
geometry_msgs/PoseWithCovariance pose
    geometry_msgs/Pose pose
        geometry_msgs/Point position
            float64 x
            float64 y
            float64 z
        geometry_msgs/Quaternion orientation
            float64 x
            float64 y
            float64 z
            float64 w
    float64[36] covariance
geometry_msgs/TwistWithCovariance twist
    geometry_msgs/Twist twist
        geometry_msgs/Vector3 linear
            float64 x
            float64 y
            float64 z
        geometry_msgs/Vector3 angular
            float64 x
            float64 y
            float64 z
    float64[36] covariance

很多消息都是用的geometry里面的msg
比如这句话

nav_msgs::Odometry odom;
odom.pose.pose.position.x = x_pos_;

odom的消息包含:

Header header
string child_frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/TwistWithCovariance twist

官网: http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom#The_nav_msgs.2FOdometry_Message

第一个.pose用的 geometry_msgs/PoseWithCovariance pose
第二个.pose用的 geometry_msgs/Pose pose
第三个.position用的 geometry_msgs/Point position
第四个.x用的geometry_msgs/Point position中的float64 x
需要一层层耐心查看

3.diagnostic_msgs Msg/Srv消息类型

节点通讯支持消息和服务

## Message types
DiagnosticArray
DiagnosticStatus
KeyValue
## Service types
AddDiagnostics
SelfTest

diagnostic_msgs/DiagnosticArray

std_msgs/Header header
	uint32 seq ##序列id
	time stamp ##秒和纳秒计时
	string frame_id ##TF_frame
diagnostic_msgs/DiagnosticStatus[] status
	byte OK=0
	byte WARN=1
	byte ERROR=2
	byte STALE=3
	byte level
	string name
	string message
	string hardware_id
	diagnostic_msgs/KeyValue[] values
	## 与状态关联的值数组
		string key
		string value        

4.sensor_msgs Msg/Srv消息类型

节点通讯支持消息和服务

### Message types
NavSatStatus
JointState
CameraInfo
PointCloud2
Imu
NavSatFix
LaserScan
PointCloud
Range
PointField
Image
RegionOfInterest
CompressedImage
ChannelFloat32
### Service types
SetCameraInfo

sensor_msgs/Imu

Header header
    uint32 seq
    time stamp
    string frame_id
geometry_msgs/Quaternion orientation
    float64 x
    float64 y
    float64 z
    float64 w
float64[9] orientation_covariance
geometry_msgs/Vector3 angular_velocity
    float64 x
    float64 y
    float64 z
float64[9] angular_velocity_covariance
geometry_msgs/Vector3 linear_acceleration
    float64 x
    float64 y
    float64 z
float64[9] linear_acceleration_covariance

持续补充中

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ROS中geometry_msgs消息类型、nav_msg消息 的相关文章

  • 以有效的方式找到最近点

    我在 2d 平面上有一个点 例如 x0 y0 和一组 n 点 x1 y1 xn yn 我想在 a 中找到距离 x0 y0 最近的点比尝试所有要点要好得多 有什么解决办法吗 我还应该说我的观点是这样排序的 bool less point a
  • 跨线反映点的算法

    给定一个点 x1 y1 和一条直线的方程 y mx c 我需要一些伪代码来确定反映直线上第一个点的点 x2 y2 花了大约一个小时试图弄清楚但没有运气 请参阅此处的可视化 http www analyzemath com Geometry
  • 如何检查一个盒子是否适合另一个盒子(允许任何旋转)

    假设我有两个盒子 每个盒子都是一个长方体 http en wikipedia org wiki Rectangular cuboid aka长方体 我需要编写一个函数来决定盒子是否具有尺寸 一 二 三 可以装入具有尺寸的盒子中 甲 乙 丙
  • 优雅的折线“左移”测试

    Given X Y 坐标 即车辆的位置 X Y 数组 它们是折线中的顶点 请注意 折线仅由直线段组成 没有圆弧 我想要的是 计算车辆是在折线的左侧还是右侧 当然还是在顶部 我的做法 迭代所有线段 并计算到每个线段的距离 然后 对于最近的段
  • 通过非 sf 列内连接两个 sf 对象

    我尝试使用内连接或左连接连接两个 sf 数据帧 这些数据框内部都有几何列 我不断收到错误 check join x y 中的错误 y 应该是一个数据框 对于空间连接 请使用 st joinFALSE 下面的可重现示例 df1 lt data
  • 确定解决迷宫问题的最小线段数

    我有一个问题 我需要定义一个具有最少数量的顶点的多边形 该多边形与不透明的图像中的每个像素相交或包含每个像素 令 N 为图像中的像素数 我唯一的假设是图像的边界 孔 内不能包含透明像素 并且至少有两个像素是不透明的 举个例子 假设我有以下图
  • 谷歌地图颤动检查点是否在多边形内

    我正在使用 google maps flutter 插件开发 flutter 项目 我想检查用户位置是否位于我在地图上创建的多边形内 有一个简单的方法使用 JavaScript api con tainsLocation 方法 但对于 fl
  • 如何从矩形点计算旋转角度?

    我有4分1 2 3 4闭合一个矩形 这些点按以下方式排列在数组中 x1 y1 x2 y2 x3 y3 x4 y4 我遇到的问题是矩形可以旋转一定角度 如何计算原始点 灰色轮廓 和角度 我试图在 javascript css3 transfo
  • 最接近 x,y 的线上的点[重复]

    这个问题在这里已经有答案了 可能的重复 如何判断一个点是否在某条线附近 https stackoverflow com questions 910882 how can i tell if a point is nearby a certa
  • 带孔的多边形三角剖分

    我正在寻找一种算法或库 更好 将多边形分解为三角形 我将在 Direct3D 应用程序中使用这些三角形 最好的可用选项是什么 这是我到目前为止发现的 本 迪斯科的笔记 http www vterrain org Implementation
  • 哪种算法可以有效地找到路径一定距离内的一组点?

    给定一组点s 一组 x y 坐标 和由连接一组点的线段组成的路径l 描述一种有效的算法 可用于从s在指定距离内d路径的l 其实际应用可能是查找沿城市之间的公路旅行路径 10 英里内任意位置的餐馆列表 For example in the f
  • 将球面坐标转换为笛卡尔坐标然后再转换回笛卡尔坐标并不能给出所需的输出

    我正在尝试编写两个函数来将笛卡尔坐标转换为球面坐标 反之亦然 以下是我用于转换的方程式 也可以在此找到维基百科页面 https en wikipedia org wiki Spherical coordinate system And 这是
  • 路径描边算法(转换为三角形/四边形)或其他建议

    有谁知道将矢量路径转换为由三角形 四边形面组成的描边路径的好算法 最好采用圆线连接 基本上 我试图绘制一条粗路径 其颜色基于随路径距离变化的值 我正在考虑将路径转换为三角形 四边形 并通过提供沿路径的距离作为一维纹理坐标来映射它 然后可以使
  • 如何计算某物是否位于某人的视野中

    我有一个对象 它在 2D 空间中具有位置和速度 两者都由向量表示 对象的视野每侧均为 135 度 它看起来与移动的方向相同 速度矢量 我有一些对象 其在 2D 空间中的位置由向量表示 在图中 蓝色背景上的对象是可见的 红色背景上的对象对主体
  • 给定一个点向量(可能无序),找到多边形(不是凸包)

    我目前有一个点向量 vector
  • 加载内容时在 ImageView 中使用“动画圆圈”

    我目前在我的应用程序中使用一个列表视图 可能需要一秒钟才能显示 我目前所做的是使用列表视图的 id android empty 属性来创建 正在加载 文本
  • 球体表面上(经度、纬度)点的凸包

    标准凸包算法不适用于 经度 纬度 点 因为标准算法假设您需要一组笛卡尔点的包 纬度 经度点是not笛卡尔坐标系 因为经度在反子午线处 环绕 180 度 即 东经 179 度以东 2 度为 179 因此 如果您的点集恰好横跨反子午线 您将错误
  • 如何连接重叠的圆圈?

    我想在视觉上连接两个重叠的圆圈 以便 becomes 我已经有部分圆的方法 但现在我需要知道每个圆的重叠角度有多大 但我不知道该怎么做 有人有主意吗 Phi ArcTan Sqrt 4 R 2 d 2 d HTH Edit 对于两个不同的半
  • 如何在 MATLAB 中绘制纹理映射三角形?

    我有一个三角形 u v 图像中的坐标 我想在 3D 坐标处绘制这个三角形 X Y Z 与图像中的三角形进行纹理映射 Here u v X Y Z都是具有三个元素的向量 代表三角形的三个角 我有一个非常丑陋 缓慢且令人不满意的解决方案 其中我
  • 射线与三角形相交

    我看到了快速最小存储射线 三角形交集 http www cs virginia edu gfx Courses 2003 ImageSynthesis papers Acceleration Fast 20MinimumStorage 20

随机推荐