forcedimension_core.containers module

Submodules

class forcedimension_core.containers.DOFFloat(initializer: Iterable[float] = (0, 0, 0, 0, 0, 0, 0, 0))[source]

Bases: array

Represents an array of floats, one for each degree-of-freedom as a array.array. Typically used by functions that request joint angles or linear/angular velocities for each degree-of-freedom.

property ptr: LP_c_double

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.DOFInt(initializer: Iterable[int] = (0, 0, 0, 0, 0, 0, 0, 0))[source]

Bases: array

Represents an array of C ints, one for each degree-of-freedom as a Python array.array. Typically used by functions that get encoder values for each degree-of-freedom.

property ptr: LP_c_int

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.DOFMotor(initializer: Iterable[int] = (0, 0, 0, 0, 0, 0, 0, 0))[source]

Bases: array

Represents an array of C unsigned shorts, one for each degree-of-freedom as a Python array.array. Typically used by functions that request motor commands for each degree-of-freedom.

property ptr: LP_c_ushort

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.Enc3(initializer: Iterable[int] = (0, 0, 0))[source]

Bases: array

Represents an array of three C ints as a array.array. Typically used by functions which return information about encoders from the WRIST or DELTA structure.

property ptr: LP_c_int

A pointer to the front of the array.

property ptrs: Tuple[LP_c_int, LP_c_int, LP_c_int]

A tuple of pointers to each element of the array in order.

class forcedimension_core.containers.Enc4(initializer: Iterable[int] = (0, 0, 0, 0))[source]

Bases: array

Represents an array of four C ints as a array.array. Typically used functions which convert gripper motor commands to forces and vice versa.

property ptr: LP_c_int

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.Mat3x3(initializer: Iterable[float] = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))[source]

Bases: array

Represents the type of a 3x3 matrix of floats array.array. Typically used to represent a 3x3 coordinate frame matrix.

property ptr: LP_c_double

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.Mat6x6(initializer: Iterable[float] = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))[source]

Bases: array

Represents the type of a 6x6 matrix of floats array.array. Typically used to represent a 6x6 inertia matrix.

property ptr: LP_c_double

A pointer to the front of the underlying contiguous data.

class forcedimension_core.containers.Mot3(initializer: Iterable[int] = (0, 0, 0))[source]

Bases: array

Represents an array of three C ushorts as a array.array. Typically used functions which take motor commands or convert motor commands to forces (and vice versa). In those functions, represents an array of motor commands for each axis of the delta or wrist structure.

property ptr: LP_c_ushort

A pointer to the front of the array.

property ptrs: Tuple[LP_c_ushort, LP_c_ushort, LP_c_ushort]

A tuple of pointers to each element of the array in order.

class forcedimension_core.containers.Status(*args, **kwargs)[source]

Bases: Structure

Adapts the status array returned by forcedimension.bindings.dhd.getStatus()

axis_checked: int

A bit vector that indicates the validation status of each axis. The validation status of all device axes can be assessed by calling the drd.checkInit() function in the Force Dimension Robotic SDK (DRD). Each bit of the status value returned corresponds to a the validation status of the corresponding axis:

brake: int

1 if device controller is in break mode or not, 0 otherwise

connected: int

Indicates if the device is connected or not.

error: int

1 if an error happend on the device controller, 0 otherwise

force: int

1 if the device controller is in force mode or not, 0 otherwise

forceoffcause: int

The event that caused forces to be disabled on the device (the last time forces were turned off).

gravity: int

1 if the gravity compensation option is enabled, 0 otherwise

idle: int

1 if the device controller is in idle mode or not, 0 otherwise

locks: int

The status of the locks on supported devices. The value can be either 1 if the locks are engaged, 0 if the locks are disengagned, or -1 if the status of the locks is unknown.

power: int

Indicates if the device is powered or not.

property ptr: LP_c_int
redundancy: int

1 if the redundant encoder check was successful. For devices that don’t op redundant encoders, this value is 0.

reset: int

1 if the device controller is in RESET mode, 0 otherwise

started: int

Indicates if the device controller is running or not.

timeguard: int

1 if the TimeGuard option is enabled, 0 otherwise

torque: int

1 if torques are active when the device is in force mode, 0 otherwise

wrist_detected: int

1 if the device has a wrist, 0 otherwise.

wrist_init: int

1 if the device wrist is initialized, 0 otherwise.

class forcedimension_core.containers.Vec3(initializer: Iterable[float] = (0.0, 0.0, 0.0))[source]

Bases: array

Represents an array of three C floats as a array.array. Typically used by functions which return a vector or take a vector. Can also be used by functions which convert a set of 3 float such as in the functions which get orientation. Has convinence “x”, “y”, and “z” properties to access the 0th, 1st, and 2nd elements, respectively.

property ptr: LP_c_double

A pointer to the front of the array.

property ptrs: Tuple[LP_c_double, LP_c_double, LP_c_double]

A tuple of pointers to each element of the array in order.

property x: float

Alias to 0th element

property y: float

Alias to 1st element

property z: float

Alias to 2nd element

class forcedimension_core.containers.VersionTuple(major: int, minor: int, release: int, revision: int)[source]

Bases: NamedTuple

Adapts the four seperate number return into a single grouped typing.NamedTuple.

major: int

Alias for field number 0

minor: int

Alias for field number 1

release: int

Alias for field number 2

revision: int

Alias for field number 3