# Rotation at SerialLink.teach Robotic Toolbox

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;
%MDH
Revolute('d',b,'a',0,'alpha',0,'modified');...
Revolute('d',0,'a',c,'alpha',0,'modified');...
'name','6 DOF')
tr2rpy(FK,'deg')
tr2eul(FK,'deg')

• In Simulation = -159.669 -10.142 3.733
• tr2eul = -160 10.8 0
• tr2rpy = 0 10.8 -160

Or what am i missed?

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.

• 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? – Albert H M Jun 3 at 14:37
• This might be better as a new question – Peter Corke Jun 6 at 17:46
• okay............ – Albert H M Jun 7 at 6:30
• I already create new question for this, would you like to answer it... – Albert H M Jun 11 at 17:04