Im using robotic toolbox to simulate my robot, but i always confused when i see the value of rpy. It always different if i compare with tr2rpy and tr2eul. What kind of rotation used in SerialLink.teach?

a = 40/1000;
b = 81/1000;
c = 130/1000;
d = 18/1000;
e = 166/1000;
f = 31/1000;
g = 95/1000;
p = SerialLink([...
'name','6 DOF')
p.teach([0 deg2rad(90) 0 deg2rad(20) deg2rad(10.8) 0]);
  • In Simulation = -159.669 -10.142 3.733
  • tr2eul = -160 10.8 0
  • tr2rpy = 0 10.8 -160

Or what am i missed?


1 Answer 1


By default teach() displays orientation using XYZ order roll-pitch-yaw angles, since this is compatible with older textbooks on arm robots, eg. Paul, Spong, Siciliano. By default tr2rpy() uses ZYX order. You can pass the 'xyz' option to tr2rpy() to make the two angular representations agree.

Alternatively you can pass the option 'rpy/zyx' to teach().

It's unfortunate that the term roll-pitch-yaw angles is underspecified, many sources just use the term without giving the details. To add to the confusion, different areas of robotics seem to adopt different conventions. Check out the implementation of rpy2tr() to see the difference.

  • $\begingroup$ its the same value now.. thank you sir :) can i use the algorithm from tr2rpy for feedback on inverse jacobian from jacob0 to control the rotational velocity? $\endgroup$
    – Albert H M
    Jun 3, 2019 at 14:37
  • $\begingroup$ This might be better as a new question $\endgroup$ Jun 6, 2019 at 17:46
  • $\begingroup$ okay............ $\endgroup$
    – Albert H M
    Jun 7, 2019 at 6:30
  • $\begingroup$ I already create new question for this, would you like to answer it... $\endgroup$
    – Albert H M
    Jun 11, 2019 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.