Conditions

Conditions make it possible to monitor the robot control and trigger specific reactions (termination of a running motion) if definable limits are exceeded or not reached


Conditions

reset_conditions

LibIiwa.reset_conditions() bool

Reset all conditions

Returns:

True if successful, False otherwise

Return type:

bool

Example:

>>> iiwa.reset_conditions()
True

set_force_condition

LibIiwa.set_force_condition(threshold: Union[List[float], ndarray], tolerance: Union[List[float], ndarray] = [10, 10, 10]) bool

Define the force condition (threshold and tolerance) for each Cartesian axis

Parameters:
  • threshold (3-element list or numpy.ndarray) – Maximum magnitude of force in N [0, Inf)

  • tolerance (3-element list or numpy.ndarray, optional) – Maximum permissible inaccuracy in N (0, Inf) (default: [10, 10, 10])

Raises:
  • AssertionError – If the length of the threshold and tolerance is not equal to the number of axes

  • AssertionError – If the threshold is not in the range [0, Inf)

  • AssertionError – If the tolerance is not in the range (0, Inf)

Returns:

True if successful, False otherwise

Return type:

bool

Example:

>>> # force condition for all axes (x: 10 N, y: 20 N, z: 30 N) and default tolerance
>>> iiwa.set_force_condition([10, 20, 30])
True

>>> # force condition only for z axis (15 N) and tolerance of 1 N
>>> iiwa.set_force_condition([np.NaN, np.NaN, 15], [np.NaN, np.NaN, 1])
True

set_joint_torque_condition

LibIiwa.set_joint_torque_condition(lower_limits: Union[List[float], ndarray], upper_limits: Union[List[float], ndarray]) bool

Define the joint torque condition (lower and upper limits) for each joint axis

Parameters:
  • lower_limits (7-element list or numpy.ndarray) – Lower limit of torque in Nm (-Inf, Inf)

  • upper_limits (7-element list or numpy.ndarray) – Upper limit of torque in Nm [-Inf, Inf)

Raises:
  • AssertionError – If the length of the lower and upper limits is not equal to the number of axes

  • AssertionError – If any of the lower limits is higher than the upper limits

Returns:

True if successful, False otherwise

Return type:

bool

Example:

>>> # same limits for all joints (min: -2.5 Nm, max: 4.0 Nm)
>>> lower_limits = [-2.5, -2.5, -2.5, -2.5, -2.5, -2.5, -2.5]
>>> upper_limits = [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0]
>>> iiwa.set_joint_torque_condition(lower_limits, upper_limits)
True

>>> # limits only for joint 4 (min: -2.5 Nm, max: 4.0 Nm)
>>> lower_limits = [np.NaN, np.NaN, np.NaN, -2.5, np.NaN, np.NaN, np.NaN]
>>> upper_limits = [np.NaN, np.NaN, np.NaN, 4.0, np.NaN, np.NaN, np.NaN]
>>> iiwa.set_joint_torque_condition(lower_limits, upper_limits)
True