How do I get the angle in radians (0 to 2pi) from a quaternion?
I'm trying to get the angle of a position model in Stage in radians from the Odometry message published to the "odom" topic.
This is how I've done it:
theta = 2 * asin(msg.pose.pose.orientation.z);
This sort of works in getting the angle in radians, but whenever the angle is below the x axis it gives me a negative angle.
Is there anyway of getting the angle in radians going from 0 to 2pi, starting from the positive x axis going anti-clockwise?
Thanks.