sim.moveToPose

Generates object movement data using the Ruckig online trajectory generator, 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 a script running in a thread, since this is a blocking operation

Synopsis

list endP/endM, float t = sim.moveToPose(int flags, list currentP/currentM, list maxVel, list maxAccel, list maxJerk, list targetP/targetM, func callback, auxData, list metric = None, float timeStep = 0) float[7]/float[12] endP/endM, float t = sim.moveToPose(int flags, float[7]/float[12] currentP/currentM, float[] maxVel, float[] maxAccel, float[] maxJerk, float[7]/float[12] targetP/targetM, func/string callback, auxData, float[4] metric = nil, float timeStep = 0)

Arguments

  • flags: Ruckig flags. -1 for default flags.
  • currentP/currentM: the start pose, specified via a pose [x y z qx qy qz qw] or transformation matrix [Vx0 Vy0 Vz0 P0 Vx1 Vy1 Vz1 P1 Vx2 Vy2 Vz2 P2]
  • maxVel: the maximum allowed velocity. If metric is specified, then this is an array of size 1, otherwse an array of size 4. If sim.ruckig_minVel is specified in flags, then this array should contain twice as many values, first the values for the maximum velocity, then the values for the minimum velocity.
  • maxAccel: the maximum allowed acceleration. If metric is specified, then this is an array of size 1, otherwse an array of size 4. If sim.ruckig_minAccel is specified in flags, then this array should contain twice as many values, first the values for the maximum acceleration, then the values for the minimum acceleration.
  • maxJerk: the maximum allowed jerk. If metric is specified, then this is an array of size 1, otherwse an array of size 4.
  • targetP/targetM: the goal pose, specified via a pose [x y z qx qy qz qw] or transformation matrix [Vx0 Vy0 Vz0 P0 Vx1 Vy1 Vz1 P1 Vx2 Vy2 Vz2 P2]
  • 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 None/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.

Return values

  • endP/endM: the pose at the end of the movement, specified via a pose [x y z qx qy qz qw] or transformation matrix [Vx0 Vy0 Vz0 P0 Vx1 Vy1 Vz1 P1 Vx2 Vy2 Vz2 P2]
  • t: the leftover time in current simulation step, i.e. the remaining time that was not used for movement.


See also: