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?

Thanks!

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

## Convert Eulers to At,Right,Up Vectors

### Re: Convert Eulers to At,Right,Up Vectors

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:

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.

Cheers

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

Code: Select all

```
m=simGetObjectMatrix(objectHandle,-1)
xAxis={m[1],m[5],m[9]}
yAxis={m[2],m[6],m[10]}
zAxis={m[3],m[7],m[11]}
```

Cheers