美文网首页
ROS——RPY角转四元数(python)

ROS——RPY角转四元数(python)

作者: proud2008 | 来源:发表于2021-07-16 17:06 被阅读0次

https://blog.csdn.net/qq_45779334/article/details/115520925

#!/usr/bin/python
#coding=utf-8
from math import pi
from tf.transformations import quaternion_from_euler
from geometry_msgs.msg import Pose

# 创建位姿实例
pos = Pose()
# 角度转弧度
DE2RA = pi / 180
# RPY的单位是角度值
roll = 0
pitch = 0.0
yaw = 1
# RPY转四元素
q = quaternion_from_euler(roll * DE2RA, pitch * DE2RA, yaw * DE2RA)

print q

相关文章

网友评论

      本文标题:ROS——RPY角转四元数(python)

      本文链接:https://www.haomeiwen.com/subject/ehsbpltx.html