ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange

# What's the difference between getEulerYPR, getEulerZYX and getRPY?

Hello everyone, I noticed tf::Matrix3x3 provides 3 distinct methods (getEulerYPR, getEulerZYX and getRPY) and they all seem to give the very same results :

The output of the following snippet is given below :

   double roll, pitch, yaw;
tf::Matrix3x3(transform.getRotation()).getRPY(roll, pitch, yaw);

std::cout<<"getRPY():      "<<roll<<" "<<pitch<<" "<<yaw<<"\n";
tf::Matrix3x3(transform.getRotation()).getEulerYPR(yaw, pitch, roll);
std::cout<<"getEulerYPR(): "<<roll<<" "<<pitch<<" "<<yaw<<"\n";
tf::Matrix3x3(transform.getRotation()).getEulerZYX(yaw, pitch, roll);
std::cout<<"getEulerZYX(): "<<roll<<" "<<pitch<<" "<<yaw<<"\n";


outputs:

getRPY():      0.000254904 -0.00770209 -0.0312527
getEulerYPR(): 0.000254904 -0.00770209 -0.0312527
getEulerZYX(): 0.000254904 -0.00770209 -0.0312527


Why do we have duplicate methods that seem to do exactly one thing? Can somebody please shed some light on this? Thanks a lot in advance

edit retag close merge delete

Sort by ยป oldest newest most voted

__attribute__((deprecated)) void getEulerZYX(tfScalar& yaw, tfScalar& pitch, tfScalar& roll, unsigned int solution_number = 1) const { getEulerYPR(yaw, pitch, roll, solution_number); };

  void getRPY(tfScalar& roll, tfScalar& pitch, tfScalar& yaw, unsigned int solution_number = 1) const
{
getEulerYPR(yaw, pitch, roll, solution_number);
}


No difference according to the code

No real cost maintenanceto allow different functions that just have different argument names to the same underlying function.

more