pyrobosim.utils.knowledge.apply_resolution_strategy

pyrobosim.utils.knowledge.apply_resolution_strategy(entity_list, resolution_strategy, robot=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:
  • world (pyrobosim.core.world.World) – World model.

  • entity_list (list[Entity]) – List of entities (e.g., rooms or objects)

  • resolution_strategy (str) – Resolution strategy to apply

  • robot (pyrobosim.core.robot.Robot, optional) – If set to a Robot instance, uses that robot for resolution strategy.

Returns:

The entity that meets the resolution strategy, or None.

Return type:

Entity