Orientation around robot's z-axis

Typically: "How do I... ", "How can I... " questions
Post Reply
JoakimMagnusson
Posts: 11
Joined: 09 May 2018, 10:31

Orientation around robot's z-axis

Post by JoakimMagnusson » 26 Jun 2018, 08:29

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: 7020
Joined: 14 Dec 2012, 00:25

Re: Orientation around robot's z-axis

Post by coppelia » 27 Jun 2018, 10:31

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