Ask Your Question

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

asked 2021-07-03 06:27:21 -0500

Rika gravatar image

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";


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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-07-03 06:54:15 -0500

bob-ROS gravatar image

updated 2021-07-03 07:00:19 -0500

__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.

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



Asked: 2021-07-03 06:27:21 -0500

Seen: 184 times

Last updated: Jul 03 '21