predicates
==========

.. py:module:: predicates


Classes
-------

.. autoapisummary::

   predicates.GripperOccupancy
   predicates.GripperIsFree
   predicates.GripperIsNotFree


Module Contents
---------------

.. py:class:: GripperOccupancy

   Base class for predicates that check the gripper occupancy.


   .. py:attribute:: manipulator
      :type:  semantic_digital_twin.robots.abstract_robot.Manipulator

      Semantic annotation for the gripper that should be evaluated.



   .. py:method:: check_man_occupancy(condition: Callable[List[semantic_digital_twin.world_description.world_entity.Body], bool]) -> bool

      Checks the occupancy of the gripper against a condition.
      The condition get the list of bodies that are under the TCP in the kinematic structure and returns a boolean.

      :param condition: The condition that should be evaluated.
      :return: True if the condition is satisfied, False otherwise.



.. py:class:: GripperIsFree

   Bases: :py:obj:`GripperOccupancy`, :py:obj:`krrood.entity_query_language.predicate.Predicate`


   Checks if the gripper is holding something. Checks this by looking at the kinematic structure of the manipulator.


   .. py:method:: __call__() -> bool

      Evaluate the predicate for the supplied values.



.. py:class:: GripperIsNotFree

   Bases: :py:obj:`GripperOccupancy`, :py:obj:`krrood.entity_query_language.predicate.Predicate`


   Checks if the gripper is free at the moment, so it can be used to grab something. This is checked by looking at the
   kinematic structure.


   .. py:method:: __call__() -> bool

      Evaluate the predicate for the supplied values.



