Orientation around robot's z-axis

Typically: "How do I... ", "How can I... " questions
Post Reply
JoakimMagnusson

Orientation around robot's z-axis

Post 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?

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

Re: Orientation around robot's z-axis

Post 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

Post Reply