dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.56k stars 1.44k forks source link

Vehicle body rates and quaternion and its rates #793

Open dinesh286 opened 6 years ago

dinesh286 commented 6 years ago

I am using dronekit python in RPi3 connected with PIXHAWK for a fixed wing airplane. I need current body rates (p,q,r), current quaternion and current quaternion rates to implement a control algorithm. How to get the above things using dronekit python.

pietrodn commented 6 years ago

For the current quaternion, you could get an Attitude object by getting vehicle.attitude and convert the (roll, pitch, yaw) triplet to a quaternion.

Alternatively, you could add a listener for the ATTITUDE_QUATERNION MAVLink message.