Regular API function

simGetObjectPosition / sim.getObjectPosition

Description Retrieves the position of an object. See also the other matrix/transformation functions.
C synopsis simInt simGetObjectPosition(simInt objectHandle,simInt relativeToObjectHandle,simFloat* position)
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 position. Specify -1 to retrieve the absolute position, sim.handle_parent to retrieve the position relative to the object's parent, or an object handle relative to whose reference frame we want the position. If this handle is the handle of a joint, then the position relative to the joint's moving frame will be returned (unless objectHandle is combined with sim.handleflag_reljointbaseframe, in which case the position relative to the joint's base frame will be returned).
position: pointer to 3 values (x, y and z)
C return value
-1 if operation was not successful
Lua synopsis table[3] position=sim.getObjectPosition(int objectHandle,int relativeToObjectHandle)
Lua parameters
Similar to the C-function counterpart
Lua return values
position: table of 3 values (x, y and z)
Remote API equiv.
Legacy remote API: simxGetObjectPosition