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

2021-07-16  本文已影响0人  proud2008

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

上一篇 下一篇

猜你喜欢

热点阅读