roboglia.base.Joint¶
-
class
Joint(name='JOINT', device=None, pos_read=None, pos_write=None, activate=None, inverse=False, offset=0.0, minim=None, maxim=None, auto=True, **kwargs)[source]¶ Bases:
objectA Joint is a convenient class to represent a positional device.
A Joint class provides an abstract access to a device providing:
access to arbitrary registers in device to retrieve / set the position
possibility to invert coordinates
possibility to add an offset so that the 0 of the joint is different from the 0 of the device
include max and min range in joint coordinates to reflect physical limitation of the joint
- Parameters
name (str) – The name of the joint
device (BaseDevice or subclass) – The device object connected to the joint
pos_read (str) – The register name used to retrieve current position
pos_write (str) – The register name used to write desired position
activate (str or
None) – The register name used to control device activation. Optional.inverse (bool) – Indicates inverse coordinate system versus the device; default
Falseoffset (float) – Offset of the joint from device’s 0; default 0.0
minim (float or
None) – Introduces a minimum limit for the joint value; ignored ifNonewhich is also the defaultmaxim (float or
None) – Introduces a maximum limit for the joint value; ignored ifNonewhich is also the defaultauto (bool) – The joint should activate automatically when the robot starts; defaults to
True
-
__init__(name='JOINT', device=None, pos_read=None, pos_write=None, activate=None, inverse=False, offset=0.0, minim=None, maxim=None, auto=True, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
name¶ (read-only) Joint’s name.
-
property
device¶ (read-only) The device used by joint.
-
property
position_read_register¶ (read-only) The register for current position.
-
property
position_write_register¶ (read-only) The register for desired position.
-
property
activate_register¶ (read-only) The register for activation control.
-
property
active¶ (read-write) Accessor for activating the joint. If the activation registry was not specified (
None) the method will returnTrue(assumes the joints are active by default if not controllable.The setter will log a warning if you try to assign a value to this property if there is no register assigned to it.
- Returns
Value of the activate register or
Trueif no register was specified when the joint was created.- Return type
bool
-
property
auto_activate¶ Indicates if the joint should automatically be activated when the robot starts.
-
property
inverse¶ (read-only) Joint uses inverse coordinates versus the device.
-
property
offset¶ (read-only) The offset between joint coords and device coords.
-
property
range¶ (read-only) Tuple (min, max) of joint limits.
- Returns
A tuple with the min and max limits for the joints.
Noneindicates that the joint does not have a particular limit set.- Return type
(min, max)
-
property
position¶ Getter uses the read register and applies inverse and offset transformations, setter clips to (min, max) limit if set, applies offset and inverse and writes to the write register.
-
property
desired_position¶ (read-only) Retrieves the desired position from the write register.
-
property
value¶ Generic accessor / setter that uses tuples to interact with the joint. For position only joints only position is set.
-
property
desired¶ Generic accessor for desired joint values. Always a tuple. For position only joints only position attribute is used.