Regular API function

simGetObjectPose / sim.getObjectPose

Description Retrieves the pose of an object. See also the other matrix/transformation functions.
C synopsis simInt simGetObjectPose(simInt objectHandle,simInt relativeToObjectHandle,simFloat* pose)
C parameters
objectHandle: handle of the object. Can be combined with sim_handleflag_reljointbaseframe (see next argument)
relativeToObjectHandle: indicates relative to which reference frame we want the pose. Specify -1 to retrieve the absolute pose, sim_handle_parent to retrieve the pose relative to the object's parent, or an object handle relative to whose reference frame we want the pose. If this handle is the handle of a joint, then the pose relative to the joint's moving frame will be returned (unless objectHandle is combined with sim_handleflag_reljointbaseframe, in which case the pose relative to the joint's base frame will be returned).
pose: pointer to 7 values (x,y,z,qx,qy,qz,qw)
C return value
-1 if operation was not successful
Lua synopsis table[7] pose=sim.getObjectPose(int objectHandle,int relativeToObjectHandle)
Lua parameters
objectHandle: handle of the object. Can be combined with sim.handleflag_reljointbaseframe (see next argument)
relativeToObjectHandle: indicates relative to which reference frame we want the pose. Specify -1 to retrieve the absolute pose, sim.handle_parent to retrieve the pose relative to the object's parent, or an object handle relative to whose reference frame we want the pose. If this handle is the handle of a joint, then the pose relative to the joint's moving frame will be returned (unless objectHandle is combined with sim.handleflag_reljointbaseframe, in which case the pose relative to the joint's base frame will be returned).
Lua return values
pose: table of 7 numbers (x,y,z,qx,qy,qz,qw)