Ask Your Question
0

Invalid arguments, Convert from Quaternion to Euler

asked 2012-06-21 04:07:39 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi everyone, I used the section code for convert from Quaternion to Euler as :

void Nav::compassCallback(const sensor_msgs::Imu::ConstPtr& msg)
{
    // Convert quaternion to RPY.
    btQuaternion q;
    double roll, pitch, yaw;
    tf::quaternionMsgToTF(msg->orientation, q);
    btMatrix3x3(q).getRPY(roll, pitch, yaw);
    ROS_DEBUG("RPY = (%lf, %lf, %lf)", roll, pitch, yaw);
} // end compassCallback()

I get it from: link text

but I got this error from Eclipse :

Invalid arguments ' Candidates are: void getRPY(float &, float &, float &, unsigned int) '

I tried to used make on console on ROS and everything was good without error.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2012-06-21 05:17:03 -0500

Lorenz gravatar image

If everything worked when you compiled using make in the terminal, it's probably just a problem with Eclipse which you can safely ignore.

However, the code above won't work with Fuerte since TF now provides its own data types. The corresponding code looks like this:

void Nav::compassCallback(const sensor_msgs::Imu::ConstPtr& msg)
{
    // Convert quaternion to RPY.
    tf::Quaternion q;
    double roll, pitch, yaw;
    tf::quaternionMsgToTF(msg->orientation, q);
    tf::Matrix3x3(q).getRPY(roll, pitch, yaw);
    ROS_DEBUG("RPY = (%lf, %lf, %lf)", roll, pitch, yaw);
} // end compassCallback()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-06-21 04:07:39 -0500

Seen: 3,231 times

Last updated: Jun 21 '12