Ask Your Question

Revision history [back]

How should RPY converted from an IMU look like?

What angles should be there?

0°-360° ?

-180° - 0° - 180° ?

Or something else?

I am for example using this code and I am getting weired results...

void cb_imu(const sensor_msgs::Imu::ConstPtr &msg)
{
    double roll, pitch, yaw;

    tf::Quaternion q;
    tf::quaternionMsgToTF(msg->orientation, q);
    tf::Matrix3x3(q).getRPY(roll, pitch, yaw);
}
ROS_INFO_STREAM("RPY: "<<roll*180.0/M_PI<<" "<<pitch*180.0/M_PI<<" "<<yaw*180.0/M_PI);

My Results of YAW show two times zero, for one half of the circle the values are negative (go up to -40°) and for the other half the same for positive values.

Regards,

Christian