Regular API function

sim.moveToPose

Description Generates object movement data using the Reflexxes Motion Library type II or IV, by performing interpolations between two poses. The function can operate by handling 4 movement variables (x,y,z and angle between the two poses), or a single movement variable (t, which requires a metric to be specified for distance calculation between the two poses). This function can only be called from child scripts running in a thread or from a coroutine (since this is a blocking operation). See also sim.moveToConfig, and sim.rmlPos.
C synopsis
C parameters
C return value
Lua synopsis table[7]/table[12] endPose/endMatrix,float timeLeft=sim.moveToPose(int flags,table[7]/table[12] currentPose/currentMatrix,table[] maxVel,table[] maxAccel,table[] maxJerk,table[7]/table[12] targetPose/targetMatrix,function callback,auxData,table[4] metric=nil,float timeStep=0)
Lua parameters
flags: RML flags. -1 for default flags.
currentPose/currentMatrix: the start pose, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).
maxVel: the maximum allowed velocity. If metric is specified, then this is a table of size 1, otherwse a table of size 4.
maxAccel: the maximum allowed acceleration. If metric is specified, then this is a table of size 1, otherwse a table of size 4.
maxJerk: the maximum allowed jerk. If metric is specified, then this is a table of size 1, otherwse a table of size 4. With the RML type II plugin, the max. jerk will however always be infinite.
targetPose/targetMatrix: the goal pose, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).
callback: a callback function that will be called for each movement step. The arguments provided to the callback function are: currentPose/currentMatrix, currentVel, currentAccel, auxData.
auxData: random data that will be forwarded to the callback function.
metric: an optional metric, used to compute a pose-pose distance. If metric is nil, the movement calculation happens in the 4-dimensional space (x,y,z,angle), otherwise it happens in the 1-dimensional space (t).
timeStep: the desired time step size. A value of 0 indicates that the current simulation time step will be used.
Lua return values
endPose/endMatrix: the pose at the end of the movement, specified via a pose (x,y,z,qx,qy,qz,qw) or transformation matrix (the last row of the 4x4 matrix is omitted).
timeLeft: the leftover time in current simulation step, i.e. the remaining time that was not used for movement.