Getting Rotation Angle in Planar Motion

Typically: "How do I... ", "How can I... " questions
Post Reply
mhr_azizi
Posts: 24
Joined: 18 Jan 2022, 16:25

Getting Rotation Angle in Planar Motion

Post by mhr_azizi »

Hello,
I have an object that moves in x-z plane and rotate about its Y axis. I want to obtain its rotation angle around the Y axis. So, I use sim.getObjectOrientation() function and use the second element of its output as the rotation angle of the object. However, this value is between -90 to 90 degrees. Is there a function to give me the rotation angle of the object around the Y axis as a number between [0, 360]?
Thank you.
fferri
Posts: 1334
Joined: 09 Sep 2013, 19:28

Re: Getting Rotation Angle in Planar Motion

Post by fferri »

I couldn't reproduce your issue.

sim.getObjectOrientation returns angles in -180...180 deg range.

Try using a different reference frame, or measure angle on another axis, e.g. Z
Post Reply