ethz-asl / data-driven-dynamics

Data Driven Dynamics Modeling for Aerial Vehicles
Other
100 stars 15 forks source link

Direction of Attitude Quaternion #22

Closed manumerous closed 3 years ago

manumerous commented 3 years ago

Out of the log file I get a quaternion q = [q0, q1, q2, q3]. If I convert this quaternion to a rotation matrix do i get the rotation from the body to the world frame or vise versa?

Is there some documentation about that somewhere? I Somehow didn't find any.

Jaeyoung-Lim commented 3 years ago

@manumerous I believe it is following the mavlink spec: https://mavlink.io/en/messages/common.html#MAV_FRAME

Also this might help? https://docs.px4.io/master/en/ros/external_position_estimation.html

manumerous commented 3 years ago

Okay thanks. I found multiple mavlink message types containing quaternions. Unfortunately no of them explains anything about what kind of quaternion it is, exept that it is related to the aeronautical frame.

Screenshot from 2021-04-06 11-03-27

I would expect that the quaternion related the NED world frame (MAV_FRAME_LOCAL_NED i guess?) to the body frame (MAV_FRAME_BODY_FRD). Am I right here? Did I miss something in the specs?

Jaeyoung-Lim commented 3 years ago

Probably with MAV_FRAME_BODY_NED? but you can verify this by looking at the data. You can look at the direction of acceleration which should be aligned with the z axis most of the time

manumerous commented 3 years ago

Wouldn't the quat be equivalent between MAV_FRAME_BODY_NED and MAV_FRAME_LOCAL_NED? As far as I understood they only differ in translation and not orientation.

Not sure how I can determine the direction of the quad from the acceleration in z direction. Would you maybe have time for a quick sync this afternoon?

Jaeyoung-Lim commented 3 years ago

Sure, I am available before 3

the two framea are not equivalent

The local origin is set when you arm and the ned actually points to north east down while body is attached to the fmu

manumerous commented 3 years ago

Solving this issue was outsourced to:

https://github.com/PX4/PX4-Autopilot/issues/17347