Robot.constraints_from_configuration
-
Robot.
constraints_from_configuration
(configuration, tolerances, group=None)[source] Returns joint constraints on all joints of the configuration.
- Parameters
configuration (
compas_fab.robots.Configuration
) – The target configuration.tolerances (list of float) – The tolerances (as +/-) on each of the joints defining the bound in radian to be achieved. If only one value is passed it will be used to create bounds for all joint constraints.
group (str, optional) – The planning group for which we specify the constraint. Defaults to the robot’s main planning group.
Examples
>>> configuration = Configuration.from_revolute_values([-0.042, 4.295, -4.110, -3.327, 4.755, 0.]) >>> tolerances = [math.radians(5)] * 6 >>> group = robot.main_group_name >>> robot.constraints_from_configuration(configuration, tolerances, group) [JointConstraint('shoulder_pan_joint', -0.042, 0.08726646259971647, 1.0), JointConstraint('shoulder_lift_joint', 4.295, 0.08726646259971647, 1.0), JointConstraint('elbow_joint', -4.11, 0.08726646259971647, 1.0), JointConstraint('wrist_1_joint', -3.327, 0.08726646259971647, 1.0), JointConstraint('wrist_2_joint', 4.755, 0.08726646259971647, 1.0), JointConstraint('wrist_3_joint', 0.0, 0.08726646259971647, 1.0)]
- Raises
ValueError – If the passed configuration does not correspond to the group.
ValueError – If the passed tolerances have a different length than the configuration.
Notes
Check for using the correct tolerance units for prismatic and revolute joints.