forcedimension_core.drd.direct module
- forcedimension_core.drd.direct.getPositionAndOrientation(p_out: SupportsPtrs3[c_double], o_out: SupportsPtrs3[c_double], pg_out: c_double, matrix_out: SupportsPtr[c_double], ID: int = -1) int[source]
Retrieve the position (in [m]) about the X, Y, and Z axes, the angle of each joint (in [rad]), (if applicable) the gripper position (in [m]), and orientation frame matrix of the end-effector. Please refer to your device user manual for more information on your device coordinate system.
Note
Unlike
forcedimension_core.dhd.getPositionAndOrientation(), this function returns immediately. It loads from an internal buffer that is refreshed by the robotic control loop. For more information about regulation see Regulation.- Parameters:
p_out (SupportsPtrs3[ctypes.c_double]) – Output buffer to store the end-effector position (in [m]).
o_out (SupportsPtrs3[ctypes.c_double]) – Output buffer to store the angle of each joint (in [rad]).
pg_out (ctypes.c_double) – Output buffer to store the gripper opening gap (in [m]).
matrix_out (MutableFloatMatrixLike) – Output buffer to store the orientation matrix.
ID (int) – Device ID (see Support for Multiple Devices section for details)
- Raises:
AttributeError – If
p_out.ptrsis not a valid attribute ofp_outAttributeError – If
o_out.ptrsis not a valid attribute ofo_outAttributeError – If
matrix_out.ptrsis not a valid attribute ofmatrix_outTypeError – If
p_out.ptrsis not iterable.TypeError – If
o_out.ptrsis not iterable.ctypes.ArgumentError – If
p_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
o_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
matrix_out.ptris not a Pointer[c_double] typectypes.ArgumentError – If
pg_outis not a c_double type.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.drd.direct.getVelocity(v_out: SupportsPtrs3[c_double], w_out: SupportsPtrs3[c_double], vg_out: c_double, ID: int = -1) int[source]
Retrieve the linear velocity of the end-effector (in [m/s]) as well as the angular velocity (in [rad/s]) about the X, Y, and Z axes. Please refer to your device user manual for more information on your device coordinate system.
Note
Unlike
forcedimension_core.dhd.getLinearVelocity(),forcedimension_core.dhd.getAngularVelocityRad(), andforcedimension_core.dhd.getAngularVelocityDeg()this function returns immediately. It loads from an internal buffer that is refreshed by the robotic control loop. For more information about regulation see Regulation.- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details)
v_out (SupportsPtrs3[ctypes.c_double]) – Output buffer for the linear velocity (in [m/s]).
w_out (SupportsPtrs3[ctypes.c_double]) – Output buffer for the angular velocity (in [rad/s]).
vg_out (SupportsPtrs3[ctypes.c_double]) – Output buffer for the gripper linear velocity (in [m/s]).
- Raises:
AttributeError – If
v_out.ptrsis not a valid attribute ofv_outAttributeError – If
w_out.ptrsis not a valid attribute ofw_outTypeError – If
p_out.ptrsis not iterable.TypeError – If
o_out.ptrsis not iterable.ctypes.ArgumentError – If
p_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
o_out.ptrsdoes not expand into a tuple of 3Pointer[c_double]types.ctypes.ArgumentError – If
pg_outis not a c_double type.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success and -1 otherwise.
- forcedimension_core.drd.direct.moveTo(pos: SupportsPtr[c_double], block: bool, ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian 7-DOF configuration. The motion uses smooth acceleration/deceleration. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
Note
The paths generated by this function are not guarunteed to be continuous if a command is interrupted by another call to this function while still in the process of being executed. If you want to guaruntee continuity use
forcedimension_core.drd.track(). For more information see Regulation.- Parameters:
pos (SupportsPtr[ctypes.c_double]) – Buffer of target positions/orientations for each DOF. DOFs 0-2 correspond to position about the X, Y, and Z axes (in [m]). DOFs 3-6 correspond to the target orientation about the first, second and third joints (in [rad]). DOF 7 corresponds to the gripper gap (in [m]).
block (bool) – If
True, the call blocks until the destination is reached. IfFalse, the call returns immediately.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
pos.ptris not a valid attribute ofposctypes.ArgumentError – If
pos.ptris not aPointer[c_double]type.ctypes.ArgumentError – If
IDis not convertible to a C char.’
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.direct.moveToAllEnc(enc: SupportsPtr[c_int], block: bool, ID: int = -1)[source]
Send the robot end-effector to a desired encoder position. The motion follows a straight line in the encoder space, with smooth acceleration/deceleration. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
Note
The paths generated by this function are not guarunteed to be continuous if a command is interrupted by another call to this function while still in the process of being executed. If you want to guaruntee continuity use
forcedimension_core.drd.trackAllEnc(). For more information see Regulation.- Parameters:
enc (SupportsPtr[ctypes.c_int]) – Target encoder positions.
ID (int) – Device ID (see Support for Multiple Devices section for details).
block (bool) – If
True, the call blocks until the destination is reached. IfFalse, the call returns immediately.
- Raises:
AttributeError – If
enc.ptris not a valid attribute ofencValueError – If
enc.ptris not aPointer[c_int]type.ctypes.ArgumentError – If
IDis not implicitly convertible to C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.direct.track(pos: SupportsPtr[c_double], ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian 7-DOF configuration. If motion filters are enabled, the motion follows a smooth acceleration/deceleration. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
Note
For more information see Regulation.
- Parameters:
pos (SupportsPtr[ctypes.c_double]) – Buffer of target positions/orientations for each DOF. DOFs 0-2 correspond to position about the X, Y, and Z axes (in [m]). DOFs 3-6 correspond to the target orientation about the first, second and third joints (in [rad]). DOF 7 corresponds to the gripper gap (in [m]).
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
AttributeError – If
pos.ptris not a valid attribute ofpos.ctypes.ArgumentError – If
pos.ptris not aPointer[c_double]type.ctypes.ArgumentError – If
IDis not convertible to a C char.’
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.direct.trackAllEnc(enc: SupportsPtr[c_int], ID: int = -1)[source]
Send the robot end-effector to a desired encoder position. If motion filters are enabled, th emotion follows a smooth acceleration/deceleration constraint on each encoder axis. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
Note
For more information see Regulation.
- Parameters:
enc (SupportsPtr[ctypes.c_int]) – Target encoder positions.
ID (int) – Device ID (see Support for Multiple Devices section for details)
- Raises:
AttributeError – If
enc.ptris not a valid attribute ofencctypes.ArgumentError – If
enc.ptris not aPointer[c_int]type.ctypes.ArgumentError – If
IDis not implicitly convertible to C char.
- Returns:
0 on success, and -1 otherwise.