forcedimension_core.dhd.expert.direct module
- forcedimension_core.dhd.expert.direct.deltaEncoderToPosition(enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
This routine computes and returns the position of the end-effector about the X, Y, and Z axes (in [m]) for a given set of encoder values.
- Parameters:
enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to raw encoder values on axis 0, 1, and 2, respectively.ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the position about the X, Y, and Z axes (in [m]).
- Raises:
ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaEncodersToJointAngles(enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
This routine computes and returns the DELTA joint angles (in [rad]) for a given set of encoder values.
- Parameters:
enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to encoder values on axis 0, 1, and 2, respectively.ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the DELTA joint angles (in [rad]) about axes 0, 1, and 2.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaForceToMotor(f: Array[int, float], enc: Array[int, int], out: SupportsPtrs3[c_ushort], ID=-1) int[source]
This routine computes and returns the motor commands necessary to obtain a given force on the end-effector at a given position (defined by encoder readings).
- Parameters:
f (Array[int, float]) – Sequence of
(fx, fy, fz)wherefx,fy, andfzare the force on the DELTA end-effector on the X, Y, and Z axes, respectively (in [N]).enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to encoder values on axis 0, 1, and 2, respectively.out (SupportsPtrs3[ctypes.c_ushort]) – An output buffer to store the motor commands on axes 0, 1, and 2.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If any element of
fis not implicitly convertible to a C double.IndexError – If
len(f) < 3.TypeError – If
fis not subscriptable.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_ushort]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.MOTOR_SATURATEDon success, and -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaJointAnglesToEncoders(joint_angles: Array[int, float], out: SupportsPtrs3[c_int], ID: int = -1) int[source]
This routine computes and returns the DELTA encoder values for a given set of joint angles (in [rad]).
- Parameters:
enc (Array[int, float]) – Sequence of
(j0, j1, j1)wherej0,j1, andj2refer to DELTA joint angles (in [rad]) for axes 0, 1, and 2, respectively.ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the DELTA encoder values.
- Raises:
ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to a C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaJointAnglesToJacobian(joint_angles: Array[int, float], out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the 3x3 jacobian matrix for the DELTA structure based on a given joint configuration. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
joint_angles (Array[int, float]) – Sequence of (j0, j1, j2) where
j0,j1, andj2refer to the joint angles (in [rad]) for axis 0, 1, and 2, respectively.ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An output buffer to store the Jacobian.
- Raises:
AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not of type Pointer[c_double]ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaJointTorquesExtrema(joint_angles: Array[int, float], minq_out: SupportsPtr[c_double], maxq_out: SupportsPtr[c_double], ID: int = -1) int[source]
Compute the range of applicable DELTA joint torques (in [Nm]) for a given DELTA joint angle configuration (in [rad]). Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
joint_angles (Array[int, float]) – Sequence of (j0, j1, j2) where
j0,j1, andj2refer to the joint angles (in [rad]) for axis 0, 1, and 2, respectively.minq_out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the minimum appliable DELTA joint torques about axes 0, 1, and 2 (in [Nm]).
maxq_out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the maximum appliable DELTA joint torques about axes 0, 1, and 2 (in [Nm]).
- Raises:
AttributeError – If
minq_out.ptrsis not a valid attribute ofminq_outTypeError – If
minq_out.ptrsis not iterable.ctypes.ArgumentError – If
minq_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.AttributeError – If
maxq_out.ptrsis not a valid attribute ofmaxq_outTypeError – If
maxq_out.ptrsis not iterable.ctypes.ArgumentError – If
maxq_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to a C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaMotorToForce(mot: Array[int, int], enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
This routine computes and returns the force applied to the end-effector about the X, Y, and Z axes (in [N]) for a given set of motor commands at a given position (defined by encoder readings)
- Parameters:
mot (Array[int, int]) – Sequence of
(mot0, mot1, mot2)wheremot0,mot1, andmot2are the axis 0, 1, and 2 DELTA motor commands, respectively.enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to encoder values on axis 0, 1, and 2, respectively.out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the force applied to the end effector about the X, Y, and Z axes (in [N])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
TypeError – If
outdoes not support item assignment either because it’s immutable or not subscriptable.IndexError – If
len(out) < 3.ctypes.ArgumentError – If any element of
outputis not implicitly convertible to a C ushort.IndexError – If
len(output) < 3.TypeError – If
outputis not subscriptable.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C char.IndexError – If
len(enc) < 3TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.deltaPositionToEncoder(pos: Array[int, float], out: SupportsPtrs3[c_int], ID: int = -1) int[source]
Computes and returns the encoder values of the end-effector for a given end-effector position.
- Parameters:
pos (Array[int, float]) – Sequence of
(px, py, pz)wherepx,py, andpzrefer to the end-effector position on the X, Y, and Z axes, respectively (in [m]).ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_int]) – An output buffer to store the delta encoder values.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
posis not implicitly convertible to a C double.IndexError – If
len(pos) < 3.TypeError – If
posis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.getDeltaEncoders(out: SupportsPtrs3[c_int], ID: int = -1) int[source]
Read all encoders values of the DELTA structure.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_int]) – An output buffer to store the delta encoder values.
- Raises:
IndexError – If
len(out) < 3.AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, and -1 otherwise.
- forcedimension_core.dhd.expert.direct.getDeltaJacobian(out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the 3x3 jacobian matrix for the DELTA structure based on the current end-effector position. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An output buffer to store the Jacobian.
- Raises:
AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not of type Pointer[c_double]ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.getDeltaJointAngles(out: SupportsPtrs3[c_double], ID: int = -1) int[source]
Retrieve the joint angles (in [rad]) for the DELTA structure.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the joint angles (in [rad]) of the DELTA structure for axes 0, 1, and 2.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.getEnc(out: SupportsPtr[c_int], mask: int = 255, ID: int = -1) int[source]
Get a selective list of encoder values. Particularly useful when using the generic controller directly, without a device model attached.
- Parameters:
out (SupportsPtr[c_int]) – An output buffer to store the encoder values.
mask (int) – Bitwise mask of which motor should be set.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not of typePointer[c_int]ctypes.ArgumentError – If
maskis not implicitly convertible to a C uchar.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.getEncVelocities(out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the encoder angle velocities (in [inc/s]) for all sensed degrees-of-freedom of the current device.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An output buffer to store the encoder velocities (in [inc/s]) for all sensed degrees-of-freedom of the current device.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple offorcedimension_core.constants.MAX_DOFPointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.getJointAngles(out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the joint angles (in [rad]) for all sensed degrees-of-freedom of the current device.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An output buffer to store the joint angles (in [rad]) for all sensed degrees-of-freedom for the current device.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple offorcedimension_core.constants.MAX_DOFPointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
See also
- forcedimension_core.dhd.expert.direct.getJointVelocities(out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the joint angle velocities (in [rad/s]) for all sensed degrees-of-freedom of the current device.
- Parameters:
out (SupportsPtr[c_double]) – An output buffer to store the joint velocities (in [rad/s]) for all sensed degrees-of-freedom of the current device.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple offorcedimension_core.constants.MAX_DOFPointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
See also
- forcedimension_core.dhd.expert.direct.getWristEncoders(out: SupportsPtrs3[c_int], ID: int = -1) int[source]
Read all encoders values of the wrist structure.
Note
This feature only applies to devices with a wrist. See the Device Types section for more details.
- Parameters:
out (SupportsPtrs3[ctypes.c_int]) – An output buffer to store the wrist encoder values.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
See also
forcedimension_core.dhd.wristEncodersToOrientation()forcedimension_core.dhd.wristEncodersToJointAngles()forcedimension_core.dhd.wristOrientationToEncoder()
- forcedimension_core.dhd.expert.direct.getWristJacobian(out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the 3x3 jacobian matrix for the wrist structure based on the current end-effector position. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An output buffer to store the Jacobian.
- Raises:
AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not aPointer[c_double]type.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, and -1 otherwise.
- forcedimension_core.dhd.expert.direct.getWristJointAngles(out: SupportsPtrs3[c_double], ID: int = -1) int[source]
Retrieve the joint angles (in [rad]) for the wrist structure.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the wrist joint angles.
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
See also
forcedimension_core.dhd.expert.direct.dhdWristJointAnglesToJacobian()forcedimension_core.dhd.expert.direct.dhdWristJointTorquesExtrema()
- forcedimension_core.dhd.expert.direct.gripperForceToMotor(f: float, enc_wrist_grip: SupportsPtr[c_int], out: c_ushort, ID: int = -1) Tuple[int, int][source]
Given a desired force to be displayed by the force gripper, this routine computes and returns the refering motor command.
Note
This feature only applies to devices with an active gripper. See the Device Types section for more details.
- Parameters:
- Raises:
ctypes.ArgumentError – If
fis not implicitly convertible to a C double.AttributeError – If
enc_wrist_grip.ptris not a valid attribute ofenc_wrist_gripctypes.ArgumentError – If
enc_wrist_grip.ptris not of type Pointer[c_int]ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
A tuple in the form
(cmd, err).cmdis the motor command on the gripper axis.erris 0 orforcedimension_core.constants.MOTOR_SATURATEDon success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.gripperMotorToForce(cmd: int, enc_wrist_grip: SupportsPtr[c_int], out: c_double, ID: int = -1) int[source]
Computes the force applied to the end-effector (in [N]) for a given motor command.
Note
This feature only applies to devices with an active gripper. See the Device Types section for more details.
- Parameters:
output (int) – Motor command on gripper axis.
enc_wrist_grip (SupportsPtr[c_int]) – Buffer which contains the encoder values about wrist joints 0, 1, and 2 as well as the encoder value of the gripper.
out (c_ushort) – Output buffer to store the force applied to the end-effector (in [N]).
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
cmdis not implicitly convertible to a C ushort.AttributeError – If
enc_wrist_grip.ptris not a valid attribute ofenc_wrist_gripctypes.ArgumentError – If
enc_wrist_grip.ptris not of type Pointer[c_int]ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.jointAnglesToGravityJointTorques(joint_angles: SupportsPtr[c_double], out: SupportsPtr[c_double], mask: int = 255, ID: int = -1) int[source]
This function computes the joint torques (in [Nm]) required to provide gravity compensation on all actuated degrees-of-freedom of the current device for a given joint angles configuration (in [rad])
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
mask (int) – Bitwise mask of which joint torques should be computed.
joint_angles (SupportsPtr[c_double]) – Output buffer for the joint torques required to provide gravity compensation (in [Nm]).
out (SupportsPtr[c_double]) – Output buffer for the joint torques required to provide gravity compensation (in [Nm]).
- Raises:
AttributeError – If
joint_angles.ptrsis not a valid attribute ofjoint_anglesTypeError – If
joint_angles.ptrsis not subscriptable.ctypes.ArgumentError – If
joint_angles.ptris not of typePointer[c_double].AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not aPointer[c_double]type.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.jointAnglesToIntertiaMatrix(joint_angles: SupportsPtr[c_double], out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the inertia matrix based on a given joint configuration. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtr[c_double]) – An array of joint angles (in [rad]) containing joint angles for all degrees of freedom.
out – An output buffer for the 6x6 inertia matrix.
- Raises:
AttributeError – If
joint_angles.ptrsis not a valid attribute ofjoint_anglesTypeError – If
joint_angles.ptrsis not subscriptable.ctypes.ArgumentError – If
joint_angles.ptris not of typePointer[c_double].AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not aPointer[c_double]type.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.preloadMot(cmds: SupportsPtr[c_ushort], mask: int = 255, ID: int = -1) int[source]
Program motor commands to a selection of motor channels. Unlike
forcedimension_core.dhd.expert.setMot(), this function saves the requested commands internally for later application by callingforcedimension_core.dhd.setForce()and the friends.- Parameters:
cmds (SupportsPtr[c_ushort]) – An input buffer to store the motor command values.
mask (int) – Bitwise mask of which motor should be set.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
cmds.ptris not of typePointer[c_ushort]IndexError – If
len(cmds) < MAX_DOF.TypeError – If
cmdsis not subscriptable.ctypes.ArgumentError – If
maskis not implicitly convertible to a C char.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise
See also
forcedimension_core.containers.DOFMotforcedimension_core.containers.numpy.DOFMot
- forcedimension_core.dhd.expert.direct.setJointTorques(q: SupportsPtr[c_double], mask: int = 255, ID: int = -1)[source]
Sets all joint torques on all active axes.
- Parameters:
q (SupportsPtr[c_double]) – An input buffer to store the Joint torques for each degree-of-freedom (in [Nm]).
mask (int) – Bitwise mask of which joints should be set
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If any element of
cmdsis not implicitly convertible to a C double.IndexError – If
len(cmds) < MAX_DOF.ctypes.ArgumentError – If
q.ptris not of typePointer[c_double]ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
See also
- forcedimension_core.dhd.expert.direct.setMot(cmds: SupportsPtr[c_ushort], mask: int = 255, ID: int = -1) int[source]
Program motor commands to a selection of motor channels. Particularly useful when using the generic controller directly, without a device model attached.
- Parameters:
cmds (SupportsPtr[c_ushort]) – An input buffer to store the motor command values.
mask (int) – Bitwise mask of which motor should be set.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
cmds.ptris not of typePointer[c_int]IndexError – If
len(cmds) < MAX_DOF.ctypes.ArgumentError – If
maskis not implicitly convertible to a C uchar.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise
See also
forcedimension_core.containers.DOFMotforcedimension_core.containers.numpy.DOFMot
- forcedimension_core.dhd.expert.direct.wristEncoderToOrientation(enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
For devices with a wrist structure, compute the individual angle of each joint (in [rad]), starting with the one located nearest to the wrist base plate. For the
forcedimension_core.constants.DeviceType.OMEGA6and theforcedimension_core.constants.DeviceType.OMEGA6_LEFTdevices, angles are computed with respect to their internal reference frame, which is rotated 45 degrees or π/4 radians about the Y axis. Please refer to your device user manual for more information on your device coordinate system.Note
This feature only applies to devices with a wrist. See the Device Types section for more details.
- Parameters:
enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to wrist encoder values on the first, second, and third joint, respectivelyout (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the wrist end-effector orientation about the first, second, and third wrist joints (in [rad]).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.wristEncodersToJointAngles(enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
This routine computes and returns the wrist joint angles (in [rad]) for a given set of encoder values.
- Parameters:
enc (Array[int, int]) – Sequence of (enc0, enc1, enc2) where
enc0,enc1, andenc2refer to encoder values on wrist axes 0, 1, and 2, respectively.out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the joint angles (in [rad]) about wrist joint axes 0, 1, and 2.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.wristJointAnglesToEncoders(joint_angles: Array[int, float], out: SupportsPtrs3[c_int], ID: int = -1) int[source]
This routine computes and returns the wrist encoder values for a given set of wrist joint angles (in [rad]).
- Parameters:
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_int]types.ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to a C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.wristJointAnglesToJacobian(joint_angles: Array[int, float], out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the 3x3 jacobian matrix for the wrist structure based on a given joint configuration. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
joint_angles (Array[int, float]) – Sequence of
(j0, j1, j2)wherej0,j1, andj2refer to the joint angles for wrist axis 0, 1, and 2, respectively.out (SupportsPtr[c_double]) – An output buffer to store the wrist jacobian.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptris not a valid attribute ofoutctypes.ArgumentError – If
out.ptris not aPointer[c_double]type.ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to a C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
- forcedimension_core.dhd.expert.direct.wristJointTorquesExtrema(joint_angles: Array[int, float], minq_out: SupportsPtr[c_double], maxq_out: SupportsPtr[c_double], ID: int = -1) int[source]
Compute the range of applicable wrist joint torques for a given wrist joint angle configuration. Please refer to your device user manual for more information on your device coordinate system.
- Parameters:
joint_angles (Array[int, float]) – Sequence of
(j0, j1, j2)wherej0,j1,j2refer to the joint angles for wrist axes 0, 1, and 2, respectively.minq_out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the minimum appliable DELTA joint torques about axes 0, 1, and 2 (in [Nm]).
maxq_out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the maximum appliable DELTA joint torques about axes 0, 1, and 2 (in [Nm]).
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If any element of
joint_anglesis not implicitly convertible to C double.IndexError – If
len(joint_angles) < 3.TypeError – If
joint_anglesis not subscriptable.AttributeError – If
minq_out.ptrsis not a valid attribute ofminq_outTypeError – If
minq_out.ptrsis not iterable.ctypes.ArgumentError – If
minq_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.AttributeError – If
maxq_out.ptrsis not a valid attribute ofmaxq_outTypeError – If
maxq_out.ptrsis not iterable.ctypes.ArgumentError – If
maxq_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise.
See also
- forcedimension_core.dhd.expert.direct.wristMotorToTorque(output: Array[int, int], enc: Array[int, int], out: SupportsPtrs3[c_double], ID: int = -1) int[source]
This routine computes and returns the torque applied to the wrist end-effector about the, X, Y, and Z axes (in [Nm]) for a given set of motor commands at a given orientation (defined by encoder values)
Note
This feature only applies to devices with an active wrist. See the Device Types section for more details.
- Parameters:
cmd (Array[int, int]) – Sequence of
(cmd0, cmd1, cmd2)wherecmd0,cmd1, andcmd2are the axis 0, 1, and 2 DELTA motor commands, respectively.enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to encoder values on axis 0, 1, and 2, respectively.ID (int) – Device ID (see Support for Multiple Devices section for details).
out (SupportsPtrs3[ctypes.c_double]) – An output buffer to store the torques applied to the wrist about the X, Y, and Z axes (in [Nm]).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If any element of
cmdis not implicitly convertible to a C ushort.IndexError – If
len(cmd) < 3.TypeError – If
cmdis not subscriptable.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1, otherwise.
- forcedimension_core.dhd.expert.direct.wristOrientationToEncoder(orientation: Array[int, float], out: SupportsPtrs3[c_int], ID: int = -1) int[source]
For devices with a wrist structure, compute the encoder values from the individual angle of each joint, starting with the one located nearest to the wrist plate base.
Note
For the
forcedimension_core.constants.DeviceType.OMEGA6andforcedimension_core.constants.DeviceType.OMEGA6_LEFTdevices, angles must be expressed with respect to their internal reference frame, which is rotated 45 degrees or π/4 radians about the Y axis. Please refer to your device user manual for more information on your device coordinate system.Note
This feature only applies to devices with an wrist. See the Device Types section for more details.
- Parameters:
orientation (Array[int, float]) – Sequence of
(oa, ob, og)whereoa,ob, andogrefer to wrist end effector orientation (in [rad]) around the X, Y, and Z axes, respectively.out (SupportsPtrs3[ctypes.c_int]) – An output buffer to store the encoder values.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_int]types.ctypes.ArgumentError – If any element of
orientationis not implicitly convertible to a C double.IndexError – If
len(orientation) < 3.TypeError – If
orientationis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise
See also
forcedimension_core.dhd.expert.direct.wristEncodersToOrientation()
- forcedimension_core.dhd.expert.direct.wristTorqueToMotor(t: Array[int, float], enc: Array[int, int], out: SupportsPtrs3[c_ushort], ID: int = -1) int[source]
This routine computes and returns the wrist motor commands necessary to obtain a given torque on the wrist end-effector about the X, Y, and Z axes (in [Nm]) at a given orientation (defined by encoder values)
Note
This feature only applies to the following devices:
forcedimension_core.constants.DeviceType.SIGMA7_RIGHTforcedimension_core.constants.DeviceType.SIGMA7_LEFT- Parameters:
t (Array[int, float]) – Sequence of
(t0, t1, t2)wheret0,t1, andt2are the DELTA axis torque commands (in [Nm]) for axes 0, 1, and 2, respectively.enc (Array[int, int]) – Sequence of
(enc0, enc1, enc2)whereenc0,enc1, andenc2refer to encoder values on axis 0, 1, and 2, respectively.out (SupportsPtrs3[ctypes.c_ushort]) – An output buffer to store the wrist motor commands.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
out.ptrsis not a valid attribute ofoutTypeError – If
out.ptrsis not iterable.ctypes.ArgumentError – If
out.ptrsdoes not expand into a tuple of 3Pointer[c_ushort]types.ctypes.ArgumentError – If any element of
tis not implicitly convertible to a C double.IndexError – If
len(t) < 3.TypeError – If
tis not subscriptable.ctypes.ArgumentError – If any element of
encis not implicitly convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise