ConfigurationTarget.generate_default_tolerances

classmethod ConfigurationTarget.generate_default_tolerances(configuration, tolerance_prismatic, tolerance_revolute)[source]

Generates tolerances values for the target configuration based on the joint types.

The parameters tolerance_prismatic and tolerance_revolute are used to generate the list of values for tolerances_above, tolerances_below. The length of the list is equal to the number of joints in the target configuration.

This function will not override the existing tolerance_above and tolerance_below values, users should set the values explicitly.

Parameters:
tolerance_prismaticobj:float

The default tolerance applied to prismatic joints. Defaults unit is meters.

tolerance_revoluteobj:float

The default tolerance applied to revolute and continuous joints. Defaults unit is radians.

Returns:
tuple of list of float

The tolerances_above and tolerances_below lists.

Examples

>>> from compas_robots import Configuration
>>> from compas_fab.robots import ConfigurationTarget
>>> from compas_robots.model import Joint
>>> configuration = Configuration.from_revolute_values([0, 3.14, 0, 0, 3.14, 0])
>>> tolerance_prismatic = 0.001
>>> tolerance_revolute = math.radians(1)
>>> tolerances_above, tolerances_below = ConfigurationTarget.generate_default_tolerances(configuration, tolerance_prismatic, tolerance_revolute)
>>> target = ConfigurationTarget(configuration, tolerances_above, tolerances_below)