Regular API function

simSetJointTargetPosition / sim.setJointTargetPosition

Description Sets the target linear/angular position of a joint. When in kinematic mode, the joint will move according to a motion profile that respects maximum velocity, acceleration and jerk values. In dynamic and position/custom control mode, the controller is instructed about the desired position. See also sim.getJointTargetPosition and sim.setJointPosition.
C/C++
synopsis
simInt simSetJointTargetPosition(simInt objectHandle,simFloat targetPosition)
C/C++
parameters
objectHandle: handle of the joint object
targetPosition: target position of the joint
C/C++
return value
-1 if operation was not successful
Lua
synopsis
sim.setJointTargetPosition(int objectHandle,float targetPosition,float[] motionParams={})
Lua
parameters
objectHandle: handle of the joint object
targetPosition: target position of the joint
motionParams: when in kinematic mode: the maximum allowed velocity, acceleration and jerk. When in dynamics mode, can be the upperVelocityLimit, P, I and D parameters (PID control), or the maximum allowed velocity, acceleration and jerk (motion profile control). Can be nil for default values. See also sim.getObjectFloatParam and sim.jointfloatparam_maxvel, sim.jointfloatparam_maxvel and sim.jointfloatparam_maxjerk
Lua
return values
Python
synopsis
sim.setJointTargetPosition(int objectHandle,float targetPosition,float[] motionParams=[])