Page 1 of 1

Orientation around robot's z-axis

Posted: 26 Jun 2018, 08:29
by JoakimMagnusson
Hi,
I have a hexapod robot in V-rep and having troubles getting the right orientation of the robot. I can read the angle around the z-axis (reference frame world). The problem is that If I rotate the robot around the y-axis the angle around the z-axis will change as well. Why is this happening? What I want is the angle around the robot's own z-axis. Maybe I need to convert to roll, pitch and jaw-angles?

Re: Orientation around robot's z-axis

Posted: 27 Jun 2018, 10:31
by coppelia
Hello,

this is because Euler angles can be complicated to use. But if you have a robot that only rotates around one axis at all times, then simply attach a dummy on top of that robot (with its Z-axis pointing up). Then, you can get the orientation of the robot/dummy with:

Code: Select all

local euler=sim.getObjectOrientation(dummyHandle,-1)
local zRotation=euler[3]
Cheers