simSetOrientation doesn't seem to work correctly

Report crashes, strange behaviour, or apparent bugs
Post Reply
IanCol
Posts: 12
Joined: 18 Aug 2016, 04:03

simSetOrientation doesn't seem to work correctly

Post by IanCol »

Hi There,

I am writing a plugin that sets up a scene before starting a simulation. In order to set up an object I call simSetObjectOrientation and then simSetObjectPosition right after.

The object always gets placed in the exact position I specify, but the orientation does not seem to work. I pass in an orientation of {0.0, 0.0, 80.04} to simSetObjectOrientation but when I select the object in VREP it reports an orientation of (0.0, 0.0, -94.04). I can then use the "object/item rotate" gui button to set to {0.0, 0.0, 80.04} and it goes perfectly where it should. I've tried everything but can't get it to work.

edit: I even printed the output of simGetObjectOrientation right after setting it and it reports the wrong orientation:

SET rotation, x: 0.000000, y: 0.000000, z: 80.040001
GET rotation, x: -0.000000, y: 0.000000, z: -1.641408

What am I doing wrong?
I'm using Vrep 3.3.1 if that helps.

Thanks,
Ian

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: simSetOrientation doesn't seem to work correctly

Post by coppelia »

Hello Ian,

angles are displayed as degrees in the user interfaces (for readability), but the API expects radians. I guess this is what is happening.

Cheers

IanCol
Posts: 12
Joined: 18 Aug 2016, 04:03

Re: simSetOrientation doesn't seem to work correctly

Post by IanCol »

wow, can't believe I didn't try that! guess I shouldn't be debugging late into the night :D

It is all in radians indeed. May I request that someone updates the documentation though?
Both simGetObjectOrientation and simSetObjectOrientation don't mention anything about the units used.

Thanks!
Ian

Post Reply