版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baidu_28455067/article/details/80602673
今天,项目中利用aruco来识别二维码来确定相机姿态,我就详细研究了一下相机坐标系。
(一)相机坐标系
(二)如何在ROS中进行四元数和欧拉角转化
- 将geometry_msgs::Quaternion转化为tf::Quaternion类型
tf::Quaternion quat;
tf::quaternionMsgToTF(bucket_mark_poses->orientation,quat);
- 通过tf::Quaternion,将四元数转化为欧拉角
double roll, pitch, yaw;
tf::Matrix3x3(quat).getRPY(roll, pitch, yaw);
mark_rpy_.x = roll; //绕x轴
mark_rpy_.y = pitch; //绕y轴
mark_rpy_.z = yaw; //绕z轴
//发布欧拉角的主题,消息类型为<geometry_msgs::Vector3>
rpy_pub_.publish(mark_rpy_);
- 参考
TF库说明