Convert Eulers to At,Right,Up Vectors

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 4
Joined: 02 Sep 2014, 04:01

Convert Eulers to At,Right,Up Vectors

Post by cmayer777 »

I figured out by trial and error that V-Rep uses X, Y, Z right handed for it's Euler angles.
(Is this in the docs somewhere that I missed?)
(Why don't you call it X Y Z, instead of alpha beta gamma, which is useless info.)

I want to determine if my robot is face down or face up, so I need to convert to an At, Right, Up matrix. I really only need the At vector for now, so if the Z component of the At vector is positive, he's face up. (The closer to 1.0 the better of course.)

So far, no one has posted this common and useful code. Does anyone already have this and would like to share?


Oh, BTW, my robot's orientation, when Euler's are (0, 0, 0), is At = (1, 0, 0), Right = (0, -1, 0), Up (0, 0, 1).

Site Admin
Posts: 7977
Joined: 14 Dec 2012, 00:25

Re: Convert Eulers to At,Right,Up Vectors

Post by coppelia »

it is not called X Y Z to avoid confusion with the X Y Z coordinates.

Have a look also at simGetObjectMatrix. The you can retrieve your desired X, Y and Z vectors with:

Code: Select all

It is a right-handed system, so you will have to adjust some signs. Basically the xAxis, yAxis and zAxis represent the red, green and blue arrows of a selected object.


Post Reply