
This collection of functions allows to perform the same kinematic calculations as you are able to do from within V-REP. Exception to this is the obstacle avoidance functionality which is only supported from within V-REP.
The idea is to normally build your kinematic tasks inside V-REP, then to export the kinematic content of a scene, which can then directly be used with the embeddable functions below. The required source code is located in the programming/externalIk folder. Make sure to include all files into your project, and include extIk.h in the files where you need access to the functions. Make also sure you know how to use the kinematics functionality from within V-REP first! If you have access to the regular API, then you won't need this auxiliary API, since all following functions have their regular API equivalent.
The external IK source code is not directly part of V-REP, and carries separate licensing conditions. Refer to the source code header sections for details.
Follow the method below to perform kinematic calculations from within your own external application:
Build your kinematic tasks within V-REP. Test them.
Export the kinematic content of the scene with [Menu bar --> File --> Export --> IK content...]
Include the external kinematics code in your own application (the code is located in the programming/externalIk folder)
Call simEmbLaunch at application start-up, and simEmbShutDown at application end.
Call simEmbStart to import the previously exported file. simEmbStart may be called as often as desired to reset the kinematic scene. A kinematic scene is similar to a scene in V-REP, except that it is stripped of everything non-kinematic.
Call various functions to shift / rotate the target dummies (e.g. with simEmbSetObjectTransformation), or to move non-active joints, i.e. joints that are not in IK mode (e.g. with simEmbSetJointPosition).
Call simEmbHandleIkGroup to perform one calculation pass (i.e. effectively bringing dummy tips onto their targets). In case you are searching for a specific robot configuration, or need to instantaneously jump to a new end-effector pose, then call simEmbGetConfigForTipPose.
Repeat above last 2 steps as often as required. Make sure to check for return values to detect errors.
If you have several instances of a same robot, then you can call simEmbLaunch several times to initialize several instances of the embedded kinematics. You can then switch from one instance to another with simEmbSwitch.
Refer also to the example applications programming/externalIkDemo1 and programming/externalIkDemo2. Those demo applications use the external kinematics routines described here, combined with the remote API functionality to control two different robots in inverse/forward kinematics mode. The demo scenes externalIkDemo1.ttt and externalIkDemo2.ttt launch the externalIkDemo1, respectively externalIkDemo2 applications automatically.
simEmbEulerAnglesToQuaternion
simEmbGetConfigForTipPose
simEmbGetIkGroupHandle
simEmbGetJointInterval
simEmbGetJointPosition
simEmbGetJointTransformation
simEmbGetJointMatrix
simEmbGetObjectHandle
simEmbGetObjectParent
simEmbGetObjectTransformation
simEmbGetObjectMatrix
simEmbGetRotationAxis
simEmbGetRotationAxis_matrix
simEmbHandleIkGroup
simEmbInterpolateTransformations
simEmbInterpolateMatrices
simEmbInvertTransformation
simEmbInvertMatrix
simEmbLaunch
simEmbMatrixToTransformation
simEmbMultiplyTransformations
simEmbMultiplyMatrices
simEmbMultTransformationWithVector
simEmbMultMatrixWithVector
simEmbQuaternionToEulerAngles
simEmbRotateAroundAxis
simEmbRotateAroundAxis_matrix
simEmbSetIkElementProperties
simEmbSetIkGroupExplicitHandling
simEmbSetIkGroupProperties
simEmbSetJointInterval
simEmbSetJointMode
simEmbSetJointPosition
simEmbSetObjectParent
simEmbSetObjectTransformation
simEmbSetObjectMatrix
simEmbSetSphericalJointQuaternion
simEmbSetSphericalJointMatrix
simEmbShutDown
simEmbStart
simEmbSwitch
simEmbTransformationToMatrix
simEmbEulerAnglesToQuaternion (regular API equivalent: simGetEulerAnglesFromMatrix)
Description
|
Retrieves a quaternion based on Euler angles. See also simEmbQuaternionToEulerAngles and simEmbTransformationToMatrix. |
C++ synopsis
|
int simEmbEulerAnglesToQuaternion(const real* euler,real* quaternion) |
parameters |
euler (input): the 3 Euler angles (alpha, beta, gamma)
quaternion (output): the 4 values of a quaternion (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbGetConfigForTipPose (regular API equivalent: simGetConfigForTipPose)
Description
|
Searches for a manipulator configuration that matches a given end-effector position/orientation in space. Search is randomized. |
C++ synopsis
|
int simEmbGetConfigForTipPose(int ikGroupHandle,int jointCnt,const int* jointHandles,real thresholdDist,int maxIterations,real* retConfig,const real* metric,const int* jointOptions,void* reserved) |
parameters |
ikGroupHandle (input): the handle of an IK group that is in charge of bringing the manipulator's tip onto a target. The IK group can also be marked as explicit handling if needed
jointCnt (input): the number of joint handles provided in the jointHandles array
jointHandles (input): an array with jointCnt entries, that specifies the joint handles for the joints we wish to retrieve the values calculated by the IK
thresholdDist (input): a distance indicating when IK should be computed in order to try to bring the tip onto the target: since the search algorithm proceeds by generating random configurations, many of them produce a tip pose that is too far from the target pose to run IK successfully. Choosing a large value will result in slow calculations, choosing a small value might produce a smaller subset of solutions. Distance between two poses is calculated using a metric
maxIterations (input): the maximum number of calculation iterations before the function returns
retConfig (output): an array with jointCnt entries, that will receive the IK calculated joint values, as specified by the jointHandles array
metric (input): an array to 4 values indicating a metric used to compute pose-pose distances: distance=sqrt((dx*metric[0])^2+(dy*metric[1])^2+(dz*metric[2])^2+(angle*metric[3])^2). Can be NULL for a default metric of {1.0,1.0,1.0,0.1}
jointOptions (input): a bit-coded value corresponding to each specified joint handle. Bit 0 (i.e. 1) indicates the corresponding joint is dependent of another joint. Can be NULL.
reserved (input/output): reserved for future extensions. Set to NULL
|
return value
|
-1 in case of an error, 0 if no result was found, otherwise 1.
|
simEmbGetIkGroupHandle (regular API equivalent: simGetIkGroupHandle)
Description
|
Retrieves the handle of an IK group based on its name. Specify the full IK group name, including suffixes. |
C++ synopsis
|
int simEmbGetIkGroupHandle(const char* ikGroupName) |
parameters |
ikGroupName (input): the name of the IK group
|
return value
|
-1 if operation failed, otherwise the handle of the IK group.
|
simEmbGetJointInterval (regular API equivalent: simGetJointInterval)
Description
|
Retrieves the limits of a joint. See also simEmbSetJointInterval |
C++ synopsis
|
int simEmbGetJointInterval(int jointHandle,real* interval) |
parameters |
jointHandle (input): handle of the joint
interval (output): pointer to 2 values: the low limit, and the range (i.e. highLimit = lowLimit + range). If the joint is cyclic, then the interval has no meaning.
|
return value
|
-1 if operation failed, 0 if the limits are valid, or 1 if the joint is cyclic.
|
simEmbGetJointPosition (regular API equivalent: simGetJointPosition)
Description
|
Retrieves the intrinsic position of a joint. This function cannot be used with spherical joints (use simEmbGetJointTransformation instead). See also simEmbSetJointPosition |
C++ synopsis
|
int simEmbGetJointPosition(int jointHandle,real* position) |
parameters |
jointHandle (input): handle of the joint
position (output): intrinsic position of the joint. This is a one-dimensional value: if the joint is revolute, the rotation angle is returned, if the joint is prismatic, the translation amount is returned, etc.
|
return value
|
-1 if operation failed
|
simEmbGetJointMatrix (regular API equivalent: simGetJointMatrix)
Description
|
Retrieves the intrinsic matrix of a joint (the transformation matrix caused by the joint movement). See also simEmbSetSphericalJointMatrix and simEmbGetJointTransformation. |
C++ synopsis
|
int simEmbGetJointMatrix(int jointHandle,real* matrix) |
parameters |
jointHandle (input): handle of the joint
matrix (output): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbGetJointTransformation (regular API equivalent: simGetJointMatrix)
Description
|
Retrieves the intrinsic transformation of a joint (the transformation caused by the joint movement). See also simEmbSetSphericalJointQuaternion and simEmbGetJointMatrix. |
C++ synopsis
|
int simEmbGetJointTransformation(int jointHandle,real* position,real* quaternion) |
parameters |
jointHandle (input): handle of the joint
position (output): the position component of the transformation (x, y, z)
quaternion (output): the orientation component of the transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbGetObjectHandle (regular API equivalent: simGetObjectHandle)
Description
|
Retrieves an object handle based on its name. Specify the full object name, including suffixes. |
C++ synopsis
|
int simEmbGetObjectHandle(const char* objectName) |
parameters |
objectName (input): name of the object
|
return value
|
-1 if operation failed, otherwise the handle of the object
|
simEmbGetObjectParent (regular API equivalent: simGetObjectParent)
Description
|
Retrieves the handle of an object's parent object. See also simEmbSetObjectParent. |
C++ synopsis
|
int simEmbGetObjectParent(int objectHandle) |
parameters |
objectHandle (input): handle of the object
|
return value
|
-1 if operation failed, otherwise the handle of the parent object
|
simEmbGetObjectMatrix (regular API equivalent: simGetObjectMatrix)
Description
|
Retrieves the matrix of an object. See also simEmbSetObjectMatrix and simEmbGetObjectTransformation. |
C++ synopsis
|
int simEmbGetObjectMatrix(int objectHandle,int relativeToObjectHandle,real* matrix) |
parameters |
objectHandle (input): handle of the object
relativeToObjectHandle (input): indicates relative to which reference frame we want the transformation. Specify -1 to retrieve the absolute transformation, sim_handle_parent to retrieve the transformation relative to the object's parent, or an object handle relative to whose reference frame we want the transformation.
matrix (output): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbGetObjectTransformation (regular API equivalent: simGetObjectMatrix)
Description
|
Retrieves the transformation (position / orientation) of an object. See also simEmbSetObjectTransformation and simEmbGetObjectMatrix. |
C++ synopsis
|
int simEmbGetObjectTransformation(int objectHandle,int relativeToObjectHandle,real* position,real* quaternion) |
parameters |
objectHandle (input): handle of the object
relativeToObjectHandle (input): indicates relative to which reference frame we want the transformation. Specify -1 to retrieve the absolute transformation, sim_handle_parent to retrieve the transformation relative to the object's parent, or an object handle relative to whose reference frame we want the transformation.
position (output): the position component of the transformation (x, y, z)
quaternion (output): the orientation component of the transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbGetRotationAxis_matrix (regular API equivalent: simGetRotationAxis)
Description
|
Retrieves an axis and rotation angle that brings one matrix onto another one. The translation part of the matrix is ignored. This function, when used in combination with simEmbRotateAroundAxis_matrix, can be used to build interpolations between matrices. See also simEmbGetRotationAxis. |
C++ synopsis
|
int simEmbGetRotationAxis_matrix(const real* matrixStart,const real* matrixGoal,real* axis,real* angle) |
parameters |
matrixStart (input): the first matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
matrixGoal (input): the second matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
axis (output): the rotation axis (x, y, z vector)
angle (output): the rotation angle
|
return value
|
-1 if operation failed
|
simEmbGetRotationAxis (regular API equivalent: simGetRotationAxis)
Description
|
Retrieves an axis and rotation angle that brings one transformation onto another one. The translation part of the transformations is ignored. This function, when used in combination with simEmbRotateAroundAxis, can be used to build interpolations between transformations. See also simEmbGetRotationAxis_matrix. |
C++ synopsis
|
int simEmbGetRotationAxis(const real* positionStart,const real* quaternionStart,const real* positionGoal,const real* quaternionGoal,real* axis,real* angle) |
parameters |
positionStart (input): the position component of the first transformation (x, y, z)
quaternionStart (input): the orientation component of the first transformation (x, y, z, w)
positionGoal (input): the position component of the second transformation (x, y, z)
quaternionGoal (input): the orientation component of the second transformation (x, y, z, w)
axis (output): the rotation axis (x, y, z vector)
angle (output): the rotation angle
|
return value
|
-1 if operation failed
|
simEmbHandleIkGroup (regular API equivalent: simHandleIkGroup)
Description
|
Handles (i.e. solves) an IK group (i.e. by trying to respect the given constraints). |
C++ synopsis
|
int simEmbHandleIkGroup(int ikGroupHandle) |
parameters |
ikGroupHandle (input): handle of the IK group or sim_handle_all or sim_handle_all_except_explicit. (sim_handle_all will handle all IK groups, while sim_handle_all_except_explicit will only handle those that are not marked as "explicit handling")
|
return value
|
number of performed calculations (i.e. when IK group calculation results are different from sim_ikresult_not_performed) if no specific IK group was specified, or a value of type IK result if a specific IK group was specified, -1 in case of an error (a failed IK group calculation is not considered as an error)
|
simEmbInterpolateMatrices (regular API equivalent: simInterpolateMatrices)
Description
|
Computes the interpolated matrix between 2 matrices. See also simEmbInterpolateTransformations. |
C++ synopsis
|
int simEmbInterpolateMatrices(const real* matrix1,const real* matrix2,real interpolFactor,real* matrixOut) |
parameters |
matrix1 (input): the first matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
matrix2 (input): the second matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
interpolFactor (input): the interpolation factor, a value between 0.0 and 1.0 (0.0--> transformationOut=transformationIn1, 1.0--> transformationOut=transformationIn2)
matrixOut (output): the interpolated matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbInterpolateTransformations (regular API equivalent: simInterpolateMatrices)
Description
|
Computes the interpolated transformation between 2 transformations. See also simEmbInterpolateMatrices. |
C++ synopsis
|
int simEmbInterpolateTransformations(const real* position1,const real* quaternion1,const real* position2,const real* quaternion2,real interpolFactor,real* positionOut,real* quaternionOut) |
parameters |
position1 (input): the position component of the first transformation (x, y, z)
quaternion1 (input): the orientation component of the first transformation (x, y, z, w)
position2 (input): the position component of the second transformation (x, y, z)
quaternion2 (input): the orientation component of the second transformation (x, y, z, w)
interpolFactor (input): the interpolation factor, a value between 0.0 and 1.0 (0.0--> transformationOut=transformationIn1, 1.0--> transformationOut=transformationIn2)
positionOut (output): the position component of the interpolated transformation (x, y, z)
quaternionOut (output): the orientation component of the interpolated transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbInvertMatrix (regular API equivalent: simInvertMatrix)
Description
|
Inverts a transformation matrix. See also simEmbInvertTransformation. |
C++ synopsis
|
int simEmbInvertMatrix(real* matrix) |
parameters |
matrix (input/output): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbInvertTransformation (regular API equivalent: simInvertMatrix)
Description
|
Inverts a transformation. See also simEmbInvertMatrix. |
C++ synopsis
|
int simEmbInvertTransformation(real* position,real* quaternion) |
parameters |
position (input/output): the position component of the transformation (x, y, z)
quaternion (input/output): the orientation component of the transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbLaunch
Description
|
Initializes a new instance of the external kinematics routines. Should be the very first function called. See also simEmbShutDown and simEmbSwitch. |
C++ synopsis
|
int simEmbLaunch() |
parameters |
none
|
return value
|
A value <1 if operation failed, otherwise the handle of the created instance. Several instances can be created, but only one instance will be active at a given time. You can switch from one to another instance with simEmbSwitch.
|
simEmbMatrixToTransformation
Description
|
Retrieves a position and a quaternion from a matrix. See also simEmbTransformationToMatrix and simEmbQuaternionToEulerAngles. |
C++ synopsis
|
int simEmbMatrixToTransformation(const real* matrix,real* position,real* quaternion) |
parameters |
matrix (input): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted)
position (output): the 3 values of a position (x, y, z)
quaternion (output): the 4 values of a quaternion (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbMultiplyMatrices (regular API equivalent: simMultiplyMatrices)
Description
|
Multiplies two matrices. See also simEmbMultiplyTransformations. |
C++ synopsis
|
int simEmbMultiplyMatrices(const real* matrix1,const real* matrix2,real* matrixOut) |
parameters |
matrix1 (input): the first matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
matrix2 (input): the second matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
matrixOut (output): the resulting matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbMultiplyTransformations (regular API equivalent: simMultiplyMatrices)
Description
|
Multiplies two transformation. See also simEmbMultiplyMatrices. |
C++ synopsis
|
int simEmbMultiplyTransformations(const real* position1,const real* quaternion1,const real* position2,const real* quaternion2,real* positionOut,real* quaternionOut) |
parameters |
position1 (input): the position component of the first transformation (x, y, z)
quaternion1 (input): the orientation component of the first transformation (x, y, z, w)
position2 (input): the position component of the second transformation (x, y, z)
quaternion2 (input): the orientation component of the second transformation (x, y, z, w)
positionOut (output): the position component of the multiplication (x, y, z)
quaternionOut (output): the orientation component of the multiplication (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbMultMatrixWithVector (regular API equivalent: simTransformVector)
Description
|
Multiplies a vector with a matrix (v=m*v). See also simEmbMultTransformationWithVector. |
C++ synopsis
|
int simEmbMultMatrixWithVector(const real* matrix,real* vect) |
parameters |
matrix (input): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
vect (input/output): the vector to transform (x, y, z)
|
return value
|
-1 if operation failed
|
simEmbMultTransformationWithVector (regular API equivalent: simTransformVector)
Description
|
Multiplies a vector with a transformation (v=tr*v). See also simEmbMultMatrixWithVector. |
C++ synopsis
|
int simEmbMultTransformationWithVector(const real* position,const real* quaternion,real* vect) |
parameters |
position (input): the position component of the transformation (x, y, z)
quaternion (input): the orientation component of the transformation (x, y, z, w)
vect (input/output): the vector to transform (x, y, z)
|
return value
|
-1 if operation failed
|
simEmbQuaternionToEulerAngles (regular API equivalent: simGetQuaternionFromMatrix)
Description
|
Retrieves Euler angles based on a quaternion. See also simEmbEulerAnglesToQuaternion and simEmbMatrixToTransformation. |
C++ synopsis
|
int simEmbQuaternionToEulerAngles(const real* quaternion,real* euler) |
parameters |
quaternion (input): the 4 values of a quaternion (x, y, z, w)
euler (output): the 3 Euler angles (alpha, beta, gamma)
|
return value
|
-1 if operation failed
|
simEmbRotateAroundAxis_matrix (regular API equivalent: simRotateAroundAxis)
Description
|
Rotates a matrix around a specific axis in space. This function, when used in combination with simEmbGetRotationAxis_matrix, can be used to build interpolations between matrices. See also simEmbRotateAroundAxis. |
C++ synopsis
|
int simEmbRotateAroundAxis_matrix(const real* matrixIn,const real* axisVector,const real* axisPosition,real angle,real* matrixOut) |
parameters |
matrixIn (input): the input matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
axisVector (input): the axis vector (x, y, z)
axisPosition (input): the axis position (x, y, z)
angle (input): the desired rotation angle
matrixOut (output): the output matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbRotateAroundAxis (regular API equivalent: simRotateAroundAxis)
Description
|
Rotates a transformation around a specific axis in space. This function, when used in combination with simEmbGetRotationAxis, can be used to build interpolations between transformations. See also simEmbRotateAroundAxis_matrix. |
C++ synopsis
|
int simEmbRotateAroundAxis(const real* positionIn,const real* quaternionIn,const real* axisVector,const real* axisPosition,real angle,real* positionOut,real* quaternionOut) |
parameters |
positionIn (input): the position component of a transformation (x, y, z)
quaternionIn (input): the orientation component of a transformation (x, y, z, w)
axisVector (input): the axis vector (x, y, z)
axisPosition (input): the axis position (x, y, z)
angle (input): the desired rotation angle
positionOut (output): the position component of the rotated transformation (x, y, z)
quaternionOut (output): the orientation component of the rotated transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbSetIkElementProperties (regular API equivalent: simSetIkElementProperties)
Description
|
Sets properties of a specific IK element. See also simEmbSetIkGroupProperties and simEmbGetIkGroupHandle. |
C++ synopsis
|
int simEmbSetIkElementProperties(int ikGroupHandle,int tipDummyHandle,int constraints,const real* precision,const real* weight) |
parameters |
ikGroupHandle (input): handle of the IK group
tipDummyHandle (input): handle of the tip dummy object of the IK element
constraints (input): the constraints of the ik element. sim_ik_avoidance_constraint is not allowed
precision (input): an array of two values where the first represents the linear precision, and the second the angular precision. Can be NULL to keep current settings.
weight (input): an array of two values that represent the linear and angular resolution weights. Can be NULL to keep current settings
|
return value
|
-1 if operation failed
|
simEmbSetIkGroupExplicitHandling (regular API equivalent: simSetExplicitHandling)
Description
|
Sets the explicit handling flags for an IK group. An IK group flagged as "explicit handling" will only be handled or solved when called explicitely with simEmbHandleIkGroup(ikGroupHandle) or simEmbHandleIkGroup(sim_handle_all). |
C++ synopsis
|
int simEmbSetIkGroupExplicitHandling(int ikGroupHandle,bool explicitHandling) |
parameters |
ikGroupHandle (input): handle of the IK group
explicitHandling (input): the desired explicit handling state
|
return value
|
-1 if operation failed
|
simEmbSetIkGroupProperties (regular API equivalent: simSetIkGroupProperties)
Description
|
Sets properties of an IK group. See also simEmbSetIkElementProperties |
C++ synopsis
|
int simEmbSetIkGroupProperties(int ikGroupHandle,int resolutionMethod,int maxIterations,real damping) |
parameters |
ikGroupHandle (input): handle of the IK group
maxIterations (input): the maximum number of iterations for the calculations
damping (input): the DLS damping factor
|
return value
|
-1 if operation failed
|
simEmbSetJointInterval (regular API equivalent: simSetJointInterval)
Description
|
Sets the limits of a joint. See also simEmbGetJointInterval |
C++ synopsis
|
int simEmbSetJointInterval(int jointHandle,int cyclic,real* interval) |
parameters |
jointHandle (input): handle of the joint
cyclic (input): 1 if the joint should be cyclic (i.e. without limits), 0 otherwise.
interval (input): pointer to 2 values: the low limit, and the range (i.e. highLimit = lowLimit + range).
|
return value
|
-1 if operation failed.
|
simEmbSetJointMode (regular API equivalent: simSetJointMode)
Description
|
Sets the operation mode of a joint. Might have as side-effect the change of additional properties of the joint. |
C++ synopsis
|
int simEmbSetJointMode(int jointHandle,int jointMode) |
parameters |
jointHandle (input): handle of the joint
|
return value
|
-1 if operation failed
|
simEmbSetJointPosition (regular API equivalent: simSetJointPosition)
Description
|
Sets the intrinsic position of a joint. This function cannot be used with spherical joints (use simEmbSetSphericalJointQuaternion instead). See also simEmbGetJointPosition |
C++ synopsis
|
int simEmbSetJointPosition(int jointHandle,real position) |
parameters |
jointHandle (input): handle of the joint
position (input): position of the joint (angular or linear value depending on the joint type)
|
return value
|
-1 if operation failed
|
simEmbSetObjectParent (regular API equivalent: simSetObjectParent)
Description
|
Sets an object's parent object. See also simEmbGetObjectParent. |
C++ synopsis
|
int simEmbSetObjectParent(int objectHandle,int parentObjectHandle,bool keepInPlace) |
parameters |
objectHandle (input): handle of the object that will become child of the parent object
parentObjectHandle (input): handle of the object that will become parent, or -1 if the object should become parentless
keepInPlace (input): indicates whether the object's absolute position and orientation should stay same
|
return value
|
-1 if operation failed
|
simEmbSetObjectMatrix (regular API equivalent: simSetObjectMatrix)
Description
|
Sets the matrix of an object. See also simEmbGetObjectMatrix and simEmbSetObjectTransformation. |
C++ synopsis
|
int simEmbSetObjectMatrix(int objectHandle,int relativeToObjectHandle,const real* matrix) |
parameters |
objectHandle (input): handle of the object
relativeToObjectHandle (input): indicates relative to which reference frame the transformation is specified. Specify -1 to set the absolute transformation, sim_handle_parent to set the transformation relative to the object's parent, or an object handle relative to whose reference frame the transformation is specified.
matrix (input): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbSetObjectTransformation (regular API equivalent: simSetObjectMatrix)
Description
|
Sets the transformation (position / orientation) of an object. See also simEmbGetObjectTransformation and simEmbSetObjectMatrix. |
C++ synopsis
|
int simEmbSetObjectTransformation(int objectHandle,int relativeToObjectHandle,const real* position,const real* quaternion) |
parameters |
objectHandle (input): handle of the object
relativeToObjectHandle (input): indicates relative to which reference frame the transformation is specified. Specify -1 to set the absolute transformation, sim_handle_parent to set the transformation relative to the object's parent, or an object handle relative to whose reference frame the transformation is specified.
position (input): the position component of the transformation (x, y, z)
quaternion (input): the orientation component of the transformation (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbSetSphericalJointMatrix (regular API equivalent: simSetSphericalJointMatrix )
Description
|
Sets the intrinsic matrix of a spherical joint object. This function cannot be used with non-spherical joints (use simEmbSetJointPosition instead). See also simEmbGetJointMatrix and simEmbSetSphericalJointQuaternion. |
C++ synopsis
|
int simEmbSetSphericalJointMatrix(int jointHandle,const real* matrix) |
parameters |
jointHandle (input): handle of the joint
matrix (input): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted))
|
return value
|
-1 if operation failed
|
simEmbSetSphericalJointQuaternion (regular API equivalent: simSetSphericalJointMatrix )
Description
|
Sets the intrinsic quaternion of a spherical joint object. This function cannot be used with non-spherical joints (use simEmbSetJointPosition instead). See also simEmbGetJointTransformation and simEmbSetSphericalJointMatrix. |
C++ synopsis
|
int simEmbSetSphericalJointQuaternion(int jointHandle,const real* quaternion) |
parameters |
jointHandle (input): handle of the joint
quaternion (input): the quaternion (x, y, z, w)
|
return value
|
-1 if operation failed
|
simEmbShutDown
Description
|
Deinitializes the active instance of the external kinematics routines. Should be the very last function called. See also simEmbLaunch and simEmbSwitch. |
C++ synopsis
|
int simEmbShutDown() |
parameters |
none
|
return value
|
-1 if operation failed, otherwise the handle of the newly active instance (or 0 if there is no active instance left).
|
simEmbStart
Description
|
Imports a previously exported kinematic scene content. Can be called at any time to reset the object/joint configurations. |
C++ synopsis
|
int simEmbStart(unsigned char* data,int dataLength) |
parameters |
data (input): pointer to the data to import
dataLength (input): the size of the data to import
|
return value
|
-1 if operation failed, otherwise the number of imported objects
|
simEmbSwitch
Description
|
Switches to another instance of an exported kinematic scene content. See also simEmbLaunch. |
C++ synopsis
|
bool simEmbSwitch(int instanceHandle) |
parameters |
instanceHandle (input): the handle of a kinematic scene content instance, previously returned from simEmbLaunch.
|
return value
|
false if operation failed.
|
simEmbTransformationToMatrix
Description
|
Retrieves a matrix from a position and a quaternion. See also simEmbMatrixToTransformation and simEmbEulerAnglesToQuaternion. |
C++ synopsis
|
int simEmbTransformationToMatrix(const real* position,const real* quaternion,real* matrix) |
parameters |
position (input): the 3 values of a position (x, y, z)
quaternion (input): the 4 values of a quaternion (x, y, z, w)
matrix (output): the matrix (Xx, Yx, Zx, Px, Xy, Yy, Zy, Py, Xz, Yz, Zz, Pz. (last row, i.e. 0, 0, 0, 1 is omitted)
|
return value
|
-1 if operation failed
|
|