pyrobosim.utils.knowledge.apply_resolution_strategy

pyrobosim.utils.knowledge.apply_resolution_strategy(entity_list: list[Entity | Node], resolution_strategy: str, robot: Robot | None = None) Entity | Node | None

Accepts a list of entities in the world (e.g. rooms, objects, etc.) and applies a resolution strategy to get a single entity from that list that best meets one of the following criteria:

  • "first" : Return the first entity that meets this query

  • "random" : Return a random entity from all possible options

  • "nearest" : Return the nearest entity based on robot pose (So, a robot must exist in the world)

Parameters:
  • entity_list – List of entities (e.g., rooms or objects)

  • resolution_strategy – Resolution strategy to apply

  • robot – If set to a Robot instance, uses that robot for resolution strategy.

Returns:

The entity that meets the resolution strategy, or None.