BaseConfiguration

class compas_fab.fab.robots.BaseConfiguration[source]

Bases: object

Represents the configuration of a robot based on its joint angle values and external axes values (if any).

joint_values

list of float – Joint values expressed in degrees.

external_axes

list of float – Position on the external axis system (if available).

Examples

>>> from compas_fab.fab.robots import BaseConfiguration
>>> config = BaseConfiguration.from_data({'joint_values': [90., 0., 0.]})
>>> config.joint_values
[90.0, 0.0, 0.0]
>>> from compas_fab.fab.robots import BaseConfiguration
>>> config = BaseConfiguration.from_data({'joint_values': [90., 0., 0., 0., 180., 45.],                                                 'external_axes': [8312.0]})
>>> str(config)
'joints: [90.0, 0.0, 0.0, 0.0, 180.0, 45.0], external_axes: [8312.0]'
data

dict – The data representing the configuration.

By assigning a data dict to this property, the current data of the configuration will be replaced by the data in the dict. The data getter and setter should always be used in combination with each other.

classmethod from_data(data)[source]

Construct a configuration from its data representation.

Parameters:data (dict) – The data dictionary.
Returns:Configuration – A Configuration instance.
classmethod from_joints(joint_values)[source]

Construct a configuration from joint values.

Parameters:joint_values (list of float) – Joint values expressed in degrees.
Returns:Configuration – A Configuration instance.
classmethod from_joints_and_external_axes(joint_values, external_axes=None)[source]

Construct a configuration from joint values and external axes values.

Parameters:
  • joint_values (list of float) – Joint values expressed in degrees.
  • external_axes (list of float) – Position on the external axis system (if available).
Returns:

Configuration – A Configuration instance.

to_data()[source]

Return the data dict that represents the configuration, and from which it can be reconstructed.