forcedimension_core.drd package
Module contents
Submodules
- forcedimension_core.drd.autoInit(ID: int = -1) int[source]
Performs automatic initialization of that particular robot by robotically moving to a known position and reseting encoder counters to their correct values.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.checkInit(ID: int = -1) int[source]
Check the validity of that particular robot initialization by robotically sweeping all endstops and comparing their joint space position to expected values (stored in each device internal memory). If the robot is not yet initialized, this function will first perform the same initialization routine as
forcedimension_core.drd.autoInit()before running the endstop check.- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.close(ID: int = -1) int[source]
Close the connection to a particular device.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.enableFilter(enabled: bool, ID: int = -1) int[source]
Enable or disable motion filtering for subsequent calls to
forcedimension_core.drd.trackPos()andforcedimension_core.drd.trackEnc()- Parameters:
enabled (bool) –
Trueto enable motion filtering,Falseto disable it.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
enabledis not implicitly convertible to a C int.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.getCtrlFreq(ID: int = -1) float[source]
This function returns the average refresh rate of the control loop (in [kHz]) since the function was last called.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
The control frequency on success, and -1.0 otherwise.
- forcedimension_core.drd.getDeviceID() int[source]
Return the ID of the current default device.
- Returns:
The device ID on success, -1 otherwise.
See also
- forcedimension_core.drd.getEncDGain(ID: int = -1) float[source]
Retrieve the D term of the PID controller that regulates the base joint positions.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
The D term of the PID controller that regulates the base joint positions.
See also
forcedimension_core.setEncDGain()
- forcedimension_core.drd.getEncIGain(ID: int = -1) float[source]
Retrieve the P term of the PID controller that regulates the base joint positions.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
The I term of the PID controller that regulates the base joint positions.
See also
forcedimension_core.setEncIGain()
- forcedimension_core.drd.getEncMoveParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve encoder positioning trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setEncMoveParam()forcedimension_core.setEncTrackParam()forcedimension_core.getEncTrackParam()
- forcedimension_core.drd.getEncPGain(ID: int = -1) float[source]
Retrieve the P term of the PID controller that regulates the base joint positions.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
The P term of the PID controller that regulates the base joint positions.
See also
forcedimension_core.getEncPGain()
- forcedimension_core.drd.getEncTrackParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve encoder tracking trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setEncMoveParam()forcedimension_core.setEncTrackParam()forcedimension_core.getEncMoveParam()
- forcedimension_core.drd.getGripMoveParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian positioning trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setGripMoveParam()forcedimension_core.setGripTrackParam()forcedimension_core.getGripTrackParam()
- forcedimension_core.drd.getGripTrackParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian tracking trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity acceeleration. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setGripMoveParam()forcedimension_core.setGripTrackParam()forcedimension_core.getGripMoveParam()
- forcedimension_core.drd.getMotRatioMax(ID: int = -1) float[source]
Retrieve the maximum joint torque applied to all regulated joints expressed as a fraction of the maximum torque available for each joint.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
The maximum joint torque ratio (between
0.0and1.0)
See also
forcedimension_core.setMotRatioMax()
- forcedimension_core.drd.getPosMoveParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian positioning trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setPosMoveParam()forcedimension_core.setPosTrackParam()forcedimension_core.getPosTrackParam()
- forcedimension_core.drd.getPosTrackParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian tracking trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setPosMoveParam()forcedimension_core.setPosTrackParam()forcedimension_core.getPosMoveParam()
- forcedimension_core.drd.getPositionAndOrientation(p_out: MutableArray[int, float], o_out: MutableArray[int, float], pg_out: c_double, matrix_out: Array[int, MutableArray[int, float]], 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 the Regulation section.- Parameters:
p_out (MutableArray[int, float]) – Output buffer to store the end-effector position (in [m]).
o_out (MutableArray[int, float]) – Output buffer to store the angle of each joint (in [rad]).
pg_out (c_double) – Output buffer to store the device gripper opening gap (in [m]).
matrix_out (Array[int, MutableArray[int, float]]) – Output buffer to store the orientation matrix.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
TypeError – If
p_outdoes not support item assignment either because its immutable or not subscriptable.IndexError – If
len(p_out) < 3.TypeError – If
o_outdoes not support item assignment either because its immutable or not subscriptable.IndexError – If
len(o_out) < 3.TypeError – If
matrix_outdoes not support item assignment, either because it is not subscriptable or because it is not mutable.IndexError – If any dimension of
matrix_outis less than length 3.ValueError – If
IDis not implicitly convertible to a C int.
- Returns:
0 or
forcedimension_core.constants.TIMEGUARDon success, -1 otherwise.
- forcedimension_core.drd.getPriorities(ID: int = -1) Tuple[int, int, int][source]
This function makes it possible to retrieve the priority of the control thread and the calling thread. Thread priority is system dependent, as described in thread priorities.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.getRotMoveParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian positioning trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setRotMoveParam()forcedimension_core.setRotTrackParam()forcedimension_core.getRotTrackParam()
- forcedimension_core.drd.getRotTrackParam(ID: int = -1) Tuple[float, float, float, int][source]
Retrieve cartesian tracking trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Tuple of
(v_max, a_max, jerk_max, err)where v_max (in [m/s]), a_max (in [m/s^2]), and jerk (in [m/s^3]) are the max velocity, acceeleration, and jerk. err is 0 on success and -1 otherwise.
See also
forcedimension_core.setRotMoveParam()forcedimension_core.setRotTrackParam()forcedimension_core.getRotMoveParam()
- forcedimension_core.drd.getVelocity(v_out: MutableArray[int, float], w_out: MutableArray[int, float], 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 the Regulation section.- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
v_out (MutableArray[int, float]) – Output buffer for the linear velocity (in [m/s]).
w_out (MutableArray[int, float]) – Output buffer for the angular velocity (in [rad/s]).
vg_out (MutableArray[int, float]) – Output buffer for the gripper linear velocity (in [m/s]).
- Raises:
TypeError – if
v_outdoes not support item assignment either because its immutable or not support item assignmentIndexError – If
len(v_out) < 3.TypeError – If w_out does not support item assignment either because its immutable or does not support item assignment
IndexError – If
len(w_out) < 3.ValueError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success and -1 otherwise.
- forcedimension_core.drd.hold(ID: int = -1) int[source]
Immediately make the robot hold its current position. All motion commands are abandoned.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
See also
- forcedimension_core.drd.isFiltering(ID: int = -1) bool[source]
Checks whether the particular robot control thread is applying a motion filter while tracking a target using
forcedimension_core.drd.trackPos()orforcedimension_core.drd.trackEnc().- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Trueif the motion filter is enabled,Falseotherwise.
See also
- forcedimension_core.drd.isInitialized(ID: int = -1) bool[source]
Checks the initialization status of a particular robot. The initialization status reflects the status of the controller RESET LED. The robot can be (re)initialized by calling
forcedimension_core.drd.autoInit().- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Trueif the robot is initialized,Falseotherwise.
See also
- forcedimension_core.drd.isMoving(ID: int = -1) bool[source]
Checks whether the particular robot is moving (following a call to
forcedimension_core.drd.moveToPos(),forcedimension_core.drd.moveToEnc(),forcedimension_core.drd.trackPos()orforcedimension_core.drd.trackEnc()), as opposed to holding the target position after successfully reaching it.- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Trueif the robot is moving,Falseotherwise.
- forcedimension_core.drd.isRunning(ID: int = -1) bool[source]
Checks the state of the robotic control thread for a particular device.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
Trueif the control thread is running,Falseotherwise.
- forcedimension_core.drd.isSupported(ID: int = -1) bool[source]
Determine if the device is supported out-of-the-box by the DRD. The regulation gains of supported devices are configured internally so that such devices are ready to use.
Note
Unsupported devices can still be operated with the DRD, but their regulation gains must first be configured using the
forcedimension_core.drd.setEncPGain(),forcedimension_core.drd.setEncIGain(), andforcedimension_core.drd.setEncDGain()functions.- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.- Returns:
Trueif the device is supported,Falseotherwise.
- forcedimension_core.drd.lock(enable: bool, init: bool, ID: int = -1) int[source]
Depending on the value of the mask parameter, either:
Move the device to its park position and engage the locks, or
Removes the locks
Upon success, the robotic regulation is running when the function returns.
Note
This function only applies to devices equipped with mechanical locks, and will return an error when called on other devices.
Note
It is recommended to set the
initargument toTruewhen engaging the lock.When this funnction returns, the robotic regulation is running and the device is held in its current position (locked or unlocked). Unless, the device is to be used in robotic mode (e.g. to move to a desired position after unlocking),
forcedimension_core.drd.stop()should be called to disable regulation.- Parameters:
enable (bool) –
Trueto engage the locks,Falseto disable the locks.init (bool) – If
True, then the device will auto-initialize before the locks are engaged or after the locks are disengaged.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
enableis not convertible to a C bool.ctypes.ArgumentError – If
initis not convertible to a C bool.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.moveTo(pos: Array[int, float], 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 (float) – 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:
ValueError – If any member of
pis not convertible to a C double.IndexError – If
len(p) < MAX_DOF.TypeError – If
pis not subscriptable.ValueError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.moveToAllEnc(enc: Array[int, int], block: bool, ID: int = -1)[source]
Send the robot end-effector to a desired encoder position. The motionfollows 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.
- Parameters:
enc (int) – Target encoder positions.
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:
ValueError – If any member of
encis not convertible to a C int.IndexError – If
len(enc) < MAX_DOF.TypeError – If
encis not subscriptable.ValueError – If any of elements of enc are not implicitly convertible to a C int.
ValueError – If ID is not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.moveToEnc(enc: Array[int, int], block: bool, ID: int = -1) int[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.trackEnc(). For more information see Regulation.- Parameters:
enc (int) – A vector of
(enc0, enc1, enc2)whereenc0,enc1, andenc2are the target encoder position on axis 0, 1, and 2.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:
ctypes.ArgumentError – If any member of
encis not convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If any of elements of enc are not implicitly convertible to a C int.
ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.moveToGrip(pg: float, block: bool, ID: int = -1)[source]
Send the robot gripper to a desired opening distance. The motion is executed 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.trackGrip(). For more information see Regulation.- Parameters:
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.pg (float) – Target gripper opening distance (in [m]).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
See also
- forcedimension_core.drd.moveToPos(pos: Array[int, float], block: bool, ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian position. The motion follows a straight line, 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.trackPos(). For more information see Regulation.- Parameters:
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.pos (Array[int, float]) – A vector of
[px, py, pz]wherepx,py, andpzare the position (in [m]) about the X, Y, and Z axes, respectively.
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
See also
- forcedimension_core.drd.moveToRot(orientation: Array[int, float], block: bool, ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian rotation. The motion follows a straight curve, 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.trackRot()- Parameters:
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.orientation (Array[int, float]) – A vector of
[oa, ob, og]whereoa,ob, andogare the device orientation (in [rad]) around the first, second, and third joints, respectively.
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
See also
- forcedimension_core.drd.open() int[source]
Open a connection to the first available device connected to the system. The order in which devices are opened persists until devices are added or removed.
If this call is successful, the default device ID is set to the newly opened device. See the Support for Multiple Devices section for more information on using multiple devices on the same computer.
- Returns:
The device ID on success, -1 otherwise.
- forcedimension_core.drd.openID(ID: int) int[source]
Open a connection to one particular device connected to the system. The order in which devices are opened persists until devices are added or removed. If the device at the specified index is already opened, its device ID is returned.
If this call is successful, the default device ID is set to the newly opened device. See the Support for Multiple Devices section for more information.
- Parameters:
ID (int) – The device enumeration index, as assigned by the underlying operating system (must be between 0 and the number of devices connected to the system).
- Raises:
ctypes.ArgumentError – If
IDis not implicitly convertible to a C byte.- Returns:
The device ID on success, -1 otherwise.
- forcedimension_core.drd.precisionInit(ID: int = -1) int[source]
This function performs automatic initialization of supported devices byrobotically moving each axis to a known position and reseting its encoder counter to its correct values. This initialization is carried out for each device axis in turn, and validates the initialization by asserting the position of a validation reference for each axis.
Note
The execution of this implementation takes longer than
forcedimension_core.drd.autoInit(), but includes the same validation asforcedimension_core.drd.checkInit(). As a result, callingforcedimension_core.drd.checkInit()is not necessary if this function succeeds.- returns:
0 on success, -1 otherwise
- forcedimension_core.drd.regulateGrip(enable: bool, ID: int = -1) int[source]
Enable/disable robotic regulation of the device gripper. If regulation is disabled, the gripper can move freely and will display any force set using
forcedimension_core.drd.setForceAndTorqueAndGripperForce(). If it is enabled, gripper orientation is locked and can be controlled by calling all robotic functions (e.g.forcedimension_core.drd.moveTo()).Note
By default, gripper regulation is enabled.
- Parameters:
enable (bool) –
Trueto enable gripper regulation,Falseto disable it.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
valis not implicitly convertible to a C int.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.regulatePos(enable: bool, ID: int = -1) int[source]
Enable/disable robotic regulation of the device delta base, which provides translations. If regulation is disabled, the base can move freely and will display any force set using
forcedimension_core.drd.setForceAndTorqueAndGripperForce(). If it is enabled, base position is locked and can be controlled by calling all robotic functions (e.g.forcedimension_core.drd.moveToPos()).Note
By default, delta base regulation is enabled.
- Parameters:
enable (bool) –
Trueto enable base regulation,Falseto disable it.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
valis not implicitly convertible to a C int.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.regulateRot(enable: bool, ID: int = -1) int[source]
Enable/disable robotic regulation of the device wrist. If regulation is disabled, the wrist can move freely and will display any torque set using
forcedimension_core.drd.setForceAndTorqueAndGripperForce(). If it is enabled, wrist orientation is locked and can be controlled by calling all robotic functions (e.g.forcedimension_core.drd.moveTo()).Note
By default, wrist regulation is enabled.
- Parameters:
enable (bool) –
Trueto enable wrist regulation,Falseto disable it.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
valis not implicitly convertible to a C int.ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.setDevice(ID: int) int[source]
Select the default device that will receive the API commands. The API supports multiple devices. This routine allows the programmer to decide which device the API single-device calls will address by default. APIs call that do not specify the ID paremeter will instead address the default device.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not implicitly convertible to a C int.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.setEncDGain(gain: float, ID: int = -1) int[source]
Set the D term of the PID controller that regulates the base joint positions. In practice, this affects the velocity of the regulation.
- Parameters:
gain (float) – D parameter of the PID regulator.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
gainis not convertible to a C int.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getEncDGain()
- forcedimension_core.drd.setEncIGain(gain: float, ID: int = -1) int[source]
Set the I term of the PID controller that regulates the base joint positions. In practice, this affects the precision of the regulation.
- Parameters:
gain (float) – I parameter of the PID regulator.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
gainis not convertible to a C int.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getEncIGain()
- forcedimension_core.drd.setEncMoveParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the encoder positioning trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getEncTrackParam()forcedimension_core.getEncMoveParam()forcedimension_core.setEncTrackParam()
- forcedimension_core.drd.setEncPGain(gain: float, ID: int = -1) int[source]
Set the P term of the PID controller that regulates the base joint positions. In practice, this affects the stiffness of the regulation.
- Parameters:
gain (float) – P parameter of the PID regulator.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
gainis not convertible to a C int.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.setEncPGain()
- forcedimension_core.drd.setEncTrackParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the encoder tracking trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getEncTrackParam()forcedimension_core.getEncMoveParam()forcedimension_core.setEncMoveParam()
- forcedimension_core.drd.setForceAndTorqueAndGripperForce(f: Array[int, float], t: Array[int, float], fg: float, ID: int = -1) int[source]
Set the desired force and torque vectors to be applied to the device end-effector and gripper.
Note
Unlike
forcedimension_core.dhd.expert.setForceAndWristJointTorquesAndGripperForce()this function returns immediately. The function sets an internal buffer for the robotic control loop to send out to the device. For more information about regulation see the Regulation section.- Parameters:
f (Array[int, float]) – Translational force vector
(fx, fy, fz)wherefx,fy, andfzare the translation force (in [N]) on the end-effector about the X, Y, and Z axes, respectively.t (Array[int, float]) – Torque vector
(tx, ty, tz)wheretx,ty, andtzare the torque (in [Nm]) on the end-effector about the X, Y, and Z axes, respectively.fg (float) – Grasping force of the gripper (in [N]).
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not implicitly convertible to C char.ctypes.ArgumentError – If any elements of
fis not implicitly convertible to a C double.IndexError – If
len(f) < 3.TypeError – If
fis not subscriptable.ctypes.ArgumentError – If any elements of
tis not implicitly convertible to a C double.IndexError – If
len(t) < 3.TypeError – If
tis not subscriptable.ctypes.ArgumentError – If
gripper_forceis not implicitly convertible to a C double.IndexError – If
len(f) < 3.IndexError – If
len(t) < 3.
- Returns:
0 or
forcedimension_core.constants.MOTOR_SATURATEDon success, and -1 otherwise.
- forcedimension_core.drd.setForceAndWristJointTorquesAndGripperForce(f: Array[int, float], t: Array[int, float], fg: float, ID: int = -1) int[source]
Set Cartesian force, wrist joint torques, and gripper force
Note
Unlike
forcedimension_core.dhd.setForceAndTorqueAndGripperForce()this function returns immediately. The function sets an internal buffer for the robotic control loop to send out to the device. For more information about regulation see the Regulation section.- Parameters:
f (Array[int, float]) – Sequence of
(fx, fy, fz)wherefx,fy, andfzare the translation forces (in [N]) to be applied to the DELTA end-effector on the X, Y, and Z axes respectively.t (Array[int, float]) – Sequence of (t0, t1, t2) where
t0,t1,t2are the wrist joint torques (in [Nm]) to be applied to the wrist end-effector for axes 0, 1, and 2, respectively.fg (float) – Gripper force (in [N]).
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
tis not implicitly convertible to a C double.IndexError – If
len(t) < 3.TypeError – If
tis not subscriptable.ctypes.ArgumentError – If
gripper_forceis not implicitly convertible to a C double.ctypes.ArgumentError – If
IDis not implicitly convertible to a C char.
- Returns:
0 on success, -1 otherwise
- forcedimension_core.drd.setGripMoveParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the gripper trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getGripTrackParam()forcedimension_core.getGripMoveParam()forcedimension_core.setGripTrackParam()
- forcedimension_core.drd.setGripTrackParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the gripper trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getGripTrackParam()forcedimension_core.getGripMoveParam()forcedimension_core.setGripMoveParam()
- forcedimension_core.drd.setMotRatioMax(scale: float, ID: int = -1) int[source]
Set the maximum joint torque applied to all regulated joints expressed as a fraction of the maximum torque available for each joint.
In practice, this limits the maximum regulation torque (in joint space), making it potentially safer to operate in environments where humans or delicate obstacles are present.
- Parameters:
scale (float) – The joint torque scaling factor (must be between
0.0and1.0).ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
scaleis not convertible to a C int.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getMotRatioMax()
- forcedimension_core.drd.setPosMoveParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the cartesian positioning trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getPosTrackParam()forcedimension_core.getPosMoveParam()forcedimension_core.setPosTrackParam()
- forcedimension_core.drd.setPosTrackParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the cartesian tracking trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getPosTrackParam()forcedimension_core.getPosMoveParam()forcedimension_core.setPosMoveParam()
- forcedimension_core.drd.setPriorities(prio: int, ctrlprio: int, ID: int = -1) int[source]
This function makes it possible to adjust the priority of the control thread and the calling thread. Thread priority is system dependent, as described in thread priorities.
Note
Administrator/superuser access is required on many platforms in order to increase thread priority. The first argument,
priois always applied to the calling thread, even when the call returns an error.- Parameters:
prio (int) – Calling thread priority level (value is system dependent).
ctrlprio (int) – Control thread priority level (value is system dependent).
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
priois not convertible to a C int.ctypes.ArgumentError – If
ctrlpriois not convertible to a C int.ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.setRotMoveParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the cartesian rotation trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getRotTrackParam()forcedimension_core.getRotMoveParam()forcedimension_core.setRotTrackParam()
- forcedimension_core.drd.setRotTrackParam(vmax: float, amax: float, jerk: float, ID: int = -1) int[source]
Sets the cartesian rotation tracking trajectory generation parameters.
- Parameters:
vmax (float) – max velocity (in [m/s])
amax (float) – max acceleration (in [m/s^2])
jerk (float) – jerk (in [m/s^3])
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.ctypes.ArgumentError – If
vmaxis not convertible to a C int.ctypes.ArgumentError – If
amaxis not convertible to a C int.ctypes.ArgumentError – If
jerkis not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
See also
forcedimension_core.getRotTrackParam()forcedimension_core.getRotMoveParam()forcedimension_core.setRotMoveParam()
- forcedimension_core.drd.start(ID: int = -1) int[source]
Start the robotic control loop for the given robot.
Note
The robot must be initialized before this function can be called successfully.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.stop(force_on: bool, ID: int = -1) int[source]
Stop the robotic control loop for the given robot.
- Parameters:
force_on (bool) – If
False, puts the device in BRAKE mode upon exiting. Otherwise leaves the device in FORCE mode. See Device Modes for more details.ID (int) – Device ID (see the Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
See also
- forcedimension_core.drd.track(pos: Array[int, float], 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 the Regulation section.
- Parameters:
pos (float) – 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:
ValueError – If any member of
pis not convertible to a C double.IndexError – If
len(p) < MAX_DOF.TypeError – If
pis not subscriptable.ValueError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.trackAllEnc(enc: Array[int, 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 the Regulation section.
- Parameters:
enc (int) – Target encoder positions.
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ValueError – If any member of
encis not convertible to a C int.IndexError – If
len(enc) < MAX_DOF.TypeError – If
encis not subscriptable.ValueError – If any of elements of enc are not implicitly convertible to a C int.
ValueError – If ID is not convertible to a C int.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.trackEnc(enc: Array[int, int], ID: int = -1) int[source]
Send the robot end-effector to a desired encoder position. If motion filters are enabled, the motion 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 the Regulation section.
- Parameters:
enc (int) – A vector of
(enc0, enc1, enc2)whereenc0,enc1, andenc2are the target encoder position on axes 0, 1, and 2.ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If any member of
encis not convertible to a C int.IndexError – If
len(enc) < 3.TypeError – If
encis not subscriptable.ctypes.ArgumentError – If any of elements of enc are not implicitly convertible to a C int.
ctypes.ArgumentError – If
IDis not convertible to a C char.
- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.trackGrip(pg: float, ID: int = -1)[source]
Send the robot gripper to a desired opening distance. 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.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
pg (float) – Target gripper opening distance (in [m]).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.trackPos(pos: Array[int, float], ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian position. If motion filters are enabled, the motion follows a smooth acceleration/deceleration constraint on each Cartesian axis. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
pos (Array[int, float]) – A vector of
[px, py, pz]wherepx,py, andpzare the position (in [m]) about the X, Y, and Z axes, respectively.
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.trackRot(orientation: Array[int, float], ID: int = -1)[source]
Send the robot end-effector to a desired Cartesian rotation. If motion filters are enabled, the motion follows a smooth acceleration/deceleration curve along each Cartesian axis. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
orientation (Array[int, float]) – A vector of
[oa, ob, og]whereoa,ob, andogare the device orientation (in [rad]) around the first, second, and third joints, respectively.
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.- Returns:
0 on success, and -1 otherwise.
- forcedimension_core.drd.waitForTick(ID: int = -1)[source]
Puts the current thread to sleep until the next iteration of the robotic control loop begins.
- Parameters:
ID (int) – Device ID (see Support for Multiple Devices section for details).
- Raises:
ctypes.ArgumentError – If
IDis not convertible to a C char.