Terrapin-Rocket-Team / Multi-Mission-Flight-Software

An arudino library used by the Terrapin Rocket Team as the foundation of the team's flight software.
4 stars 0 forks source link

IMU.cpp to Euler needs to be revisited #58

Open mallamacimj opened 1 week ago

mallamacimj commented 1 week ago
imu::Vector<3> convertToEuler(const imu::Quaternion &orientation)
{
    imu::Vector<3> euler = orientation.toEuler();
    // reverse the vector, since it returns in z, y, x
    euler = imu::Vector<3>(euler.x(), euler.y(), euler.z());
    return euler;
}

What euler angles are being return? 3-2-1?

DrewBrandt commented 3 hours ago

This was done originally because we expected the angles to be x, y, z, but the way this is done here is I think wrong because the order the angles are applied in matter. Simply re-ordering them like this doesn't really work, I don't think. You're right that it needs to be revisited.