forcedimension_core.dhd.direct module

forcedimension_core.dhd.direct.getAngularVelocityDeg(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the estimated angular velocity (in [deg/s]).

Note

The velocity estimator requires at least 2 position updates during the time interval defined in forcedimension_core.dhd.configAngularVelocity() in order to be able to compute the estimate. Otherwise, if there are no calls to:func:forcedimension_core.dhd.getPosition() or forcedimension_core.dhd.getAngularVelocityDeg(), this function will error with forcedimension_core.constants.ErrorNum.TIMEOUT. For more information refer to Velocity Estimator.

Parameters:
Raises:
Returns:

0 on success, -1 otherwise.

forcedimension_core.dhd.direct.getAngularVelocityRad(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the estimated angular velocity (in [rad/s]).

Note

The velocity estimator requires at least 2 position updates during the time interval defined in forcedimension_core.dhd.configAngularVelocity() in order to be able to compute the estimate. Otherwise, if there are no calls to:func:forcedimension_core.dhd.getPosition() or forcedimension_core.dhd.getAngularVelocityRad(), this function will return error with forcedimension_core.constants.ErrorNum.TIMEOUT. For more information refer to Velocity Estimator.

Parameters:
Raises:
Returns:

0 on success, -1 otherwise.

forcedimension_core.dhd.direct.getForce(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the force vector applied to the end-effector (in [N]) about the X, Y, and Z axes Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
  • AttributeError – If out.ptrs is not a valid attribute of out

  • TypeError – If out does not support item assignment either because its immutable or not subscriptable.

  • TypeError – If out.ptrs is not iterable.

  • ctypes.ArgumentError – If out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • ctypes.ArgumentError – If ID is not implicitly convertible to C char.

Returns:

0 on success, -1 otherwise.

See also

forcedimension_core.dhd.direct.setForce()
forcedimension_core.dhd.direct.setForceAndTorque()
forcedimension_core.dhd.direct.setForceAndTorqueAndGripperForce()
forcedimension_core.dhd.direct.getForceAndTorque(f_out: SupportsPtrs3[c_double], t_out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the forces (in [N]) and torques (in [Nm]) applied to the device end-effector about the X, Y, and Z axes. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
Returns:

0, on success, -1 otherwise.

See also

forcedimension_core.dhd.direct.setForce()
forcedimension_core.dhd.direct.setForceAndTorque()
forcedimension_core.dhd.direct.setForceAndTorqueAndGripperForce()
forcedimension_core.dhd.direct.getForceAndTorqueAndGripperForce(f_out: SupportsPtrs3[c_double], t_out: SupportsPtrs3[c_double], fg_out: c_double, ID: int = -1) int[source]

Retrieve the forces (in [N]) and torques (in [Nm]) applied to the device end-effector as well as the gripper force (in [N]). Forces and torques are about the X, Y, and Z axes.

Parameters:
Raises:
Returns:

0, on success, -1 otherwise.

forcedimension_core.dhd.direct.getGripperFingerPos(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Read the position (in [m]) of forefinger rest location about the X, Y, and Z axes of the force gripper structure if present.

Note

This feature only applies to devices with a gripper. See the Device Types section for more details.

Parameters:
Raises:
Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getGripperThumbPos(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Read the position (in [m]) of thumb rest location about the X, Y, and Z axes of the force gripper structure if present.

Note

This feature only applies to devices with a gripper. See the Device Types section for more details.

Parameters:
Raises:
Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getLinearVelocity(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the estimated instanteous linear velocity (in [m/s]).

Note

The velocity estimator requires at least 2 position updates during the time interval defined in forcedimension_core.dhd.configLinearVelocity() in order to be able to compute the estimate. Otherwise, if there are no calls to forcedimension_core.dhd.getPosition() or forcedimension_core.dhd.getLinearVelocity(), this function will error with forcedimension_core.constants.ErrorNum.TIMEOUT. For more information refer to Velocity Estimator.

Parameters:
Raises:
Returns:

0 on success, -1 otherwise.

See also

forcedimension_core.dhd.direct.configLinearVelocity()
forcedimension_core.dhd.direct.getOrientationDeg(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

For devices with a wrist structure, retrieve individual angle (in [deg]) of each joint, starting with the one located nearest to the wrist base plate.

Note

This feature only applies to devices with a wrist. See the Device Types section for more details.

Note

forcedimension_core.constants.DeviceType.OMEGA6_RIGHT and forcedimension_core.constants.DeviceType.OMEGA6_LEFT have angles that are instead computed with respect to their internal reference frame, which is rotated π/4 radians around the Y axis. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
  • AttributeError – If out.ptrs is not a valid attribute of out

  • TypeError – If out does not support item assignment either because its immutable or not subscriptable.

  • TypeError – If out.ptrs is not iterable.

  • ctypes.ArgumentError – If out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • ctypes.ArgumentError – If ID is not implicitly convertible to C char.

Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getOrientationFrame(out: SupportsPtr[c_double], ID: int = -1) int[source]

Retrieve the rotation matrix of the wrist structure. The identity matrix is returned for devices that do not support orientations.

Parameters:
Raises:
Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getOrientationRad(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

For devices with a wrist structure, retrieve individual angle (in [rad]) of each joint, starting with the one located nearest to the wrist base plate.

Note

This feature only applies to devices with a wrist. See the Device Types section for more details.

Note

forcedimension_core.constants.DeviceType.OMEGA6_RIGHT and forcedimension_core.constants.DeviceType.OMEGA6_LEFT have angles that are instead computed with respect to their internal reference frame, which is rotated π/4 radians around the Y axis. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
  • AttributeError – If out.ptrs is not a valid attribute of out

  • TypeError – If out does not support item assignment either because its immutable or not subscriptable.

  • TypeError – If out.ptrs is not iterable.

  • ctypes.ArgumentError – If out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • ctypes.ArgumentError – If ID is not implicitly convertible to C char.

Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getPosition(out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the position of the end-effector about the X, Y, and Z axes. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
Returns:

0 or forcedimension_core.dhd.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getPositionAndOrientationDeg(p_out: SupportsPtrs3[c_double], o_out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the position (in [m]) and for devices with a wrist structure, retrieve individual angle of each joint (in [deg]), starting with the one located nearest to the wrist base plate.

Note

This feature only applies to devices with a wrist. See the Device Types section for more details.

Note

forcedimension_core.constants.DeviceType.OMEGA6_RIGHT and forcedimension_core.constants.DeviceType.OMEGA6_LEFT have angles that are instead computed with respect to their internal reference frame, which is rotated π/4 radians around the Y axis. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
  • AttributeError – If p_out.ptrs is not a valid attribute of out

  • TypeError – If p_out.ptrs is not iterable.

  • ctypes.ArgumentError – If p_out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • AttributeError – If o_out.ptrs is not a valid attribute of out

  • TypeError – If o_out does not support item assignment either because its immutable or not subscriptable.

  • TypeError – If o_out.ptrs is not iterable.

  • ctypes.ArgumentError – If o_out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • ctypes.ArgumentError – If ID is not implicitly convertible to C char.

Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getPositionAndOrientationFrame(p_out: SupportsPtrs3[c_double], matrix_out: SupportsPtr[c_double], ID: int = -1) int[source]

Retrieve the position (in [m]) and orientation matrix of the end-effector about the X, Y, and Z axes. 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.

Note

forcedimension_core.constants.DeviceType.OMEGA6_RIGHT and forcedimension_core.constants.DeviceType.OMEGA6_LEFT have angles that are instead computed with respect to their internal reference frame, which is rotated π/4 radians around the Y axis. 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).

Raises:
Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.

forcedimension_core.dhd.direct.getPositionAndOrientationRad(p_out: SupportsPtrs3[c_double], o_out: SupportsPtrs3[c_double], ID: int = -1) int[source]

Retrieve the position (in [m]) and for devices with a wrist structure, retrieve individual angle of each joint (in [rad]), starting with the one located nearest to the wrist base plate.

Note

This feature only applies to devices with a wrist. See the Device Types section for more details.

Note

forcedimension_core.constants.DeviceType.OMEGA6_RIGHT and forcedimension_core.constants.DeviceType.OMEGA6_LEFT have angles that are instead computed with respect to their internal reference frame, which is rotated π/4 radians around the Y axis. Please refer to your device user manual for more information on your device coordinate system.

Parameters:
Raises:
  • AttributeError – If p_out.ptrs is not a valid attribute of out

  • TypeError – If p_out.ptrs is not iterable.

  • ctypes.ArgumentError – If p_out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • AttributeError – If o_out.ptrs is not a valid attribute of out

  • TypeError – If o_out does not support item assignment either because its immutable or not subscriptable.

  • TypeError – If o_out.ptrs is not iterable.

  • ctypes.ArgumentError – If o_out.ptrs does not expand into a tuple of 3 Pointer[c_double] types.

  • ctypes.ArgumentError – If ID is not implicitly convertible to C char.

Returns:

0 or forcedimension_core.constants.TIMEGUARD on success, -1 otherwise.