python 使用PyKDL 四元數轉歐拉角


 

安裝:

sudo apt-get install ros-indigo-kdl-parser-py

使用:

import PyKDL
import math def quat_to_angle(quat): rot
= PyKDL.Rotation.Quaternion(quat.x, quat.y, quat.z, quat.w) return rot.GetRPY()[2] def normalize_angle(angle): res = angle while res > math.pi: res -= 2.0*math.pi while res < -math.pi: res += 2.0*math.pi return res https://github.com/gt-ros-pkg/hrl-kdl
https://www.programcreek.com/python/example/99836/sensor_msgs.msg.Imu

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM