ROS中欧拉角和四元数之间的转换

引用头文件

#include "tf/transform_datatypes.h"

数据格式

四元数

tf::Quaternion orientation

欧拉角

doule roll, pitch, yaw;

常用为 yaw 角(偏航角)

四元数转换为偏航角

yaw=tf::getYaw(orientation);

偏航角转换为四元数

orientation=tf::createQuaternionMsgFromYaw(yaw);

欧拉角转换为四元数

orientation=tf::createQuaternionMsgFromRollPitchYaw(roll,pitch,yaw);

ROS中欧拉角和四元数之间的转换
http://example.com/2022/04/21/rosangel/
作者
WanXing
发布于
2022年4月21日
许可协议