predicates#

Classes#

GripperOccupancy

Base class for predicates that check the gripper occupancy.

GripperHolds

Checks if the gripper holds a particular body.

Module Contents#

class predicates.GripperOccupancy#

Base class for predicates that check the gripper occupancy.

end_effector: semantic_digital_twin.robots.robot_parts.EndEffector#

Semantic annotation for the gripper that should be evaluated.

check_manipulator_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 gets the list of bodies below the tool frame in the kinematic structure and returns a boolean.

Parameters:

condition – The condition that should be evaluated.

Returns:

True if the condition is satisfied, False otherwise.

class predicates.GripperHolds#

Bases: GripperOccupancy, krrood.entity_query_language.predicate.Predicate

Checks if the gripper holds a particular body.

This is checked by looking at the kinematic structure below the tool frame, so a gripper holding something else does not count.

body: semantic_digital_twin.world_description.world_entity.Body#

The body the gripper is asked to hold.

__call__() → bool#

Evaluate the predicate for the supplied values.

classmethod _verbalization_fragment_(fields: krrood.entity_query_language.predicate.RenderedFields) → krrood.entity_query_language.verbalization.fragments.base.VerbalizationFragment#
Parameters:

fields – The rendered fragment for each field.

Returns:

The clause “<end effector> holds <body>”.