simworld.local_planner package

Subpackages

Submodules

simworld.local_planner.action_space module

ActionSpace module: defines Action enum, Waypoint model, and ActionSpace container.

class simworld.local_planner.action_space.HighLevelAction(value)

Bases: Enum

High-level actions that an agent can perform.

DO_NOTHING = 0
NAVIGATE = 1
PICK_UP = 2
classmethod get_action_list()

Return a list of all available actions.

classmethod get_all_actions()

Return a formatted string describing all available actions.

class simworld.local_planner.action_space.HighLevelActionSpace(*args: Any, **kwargs: Any)

Bases: BaseModel

High-level action space that an agent can perform.

action_queue: list[int] | None = None
destination: Vector | None = None
classmethod from_json(json_str)

Parse the action space from a json string.

object_name: str | None = None
reasoning: str | None = None
classmethod to_json_schema()

Return the json schema of the action space.

class simworld.local_planner.action_space.LowLevelAction(value)

Bases: Enum

Low-level actions that an agent can perform.

DO_NOTHING = 0
STEP_FORWARD = 1
TURN_AROUND = 2
classmethod get_action_list()

Return a list of all available actions.

classmethod get_all_actions()

Return a formatted string describing all available actions.

Returns:
str: A string describing all available actions in the format:

“The action can be one of the following: 0: DO_NOTHING, 1: STEP_FORWARD, 2: TURN_AROUND”

class simworld.local_planner.action_space.LowLevelActionSpace(*args: Any, **kwargs: Any)

Bases: BaseModel

Low-level action space that an agent can perform.

angle: float | None = None
choice: LowLevelAction = 0
clockwise: bool | None = None
direction: int | None = None
duration: float | None = None
classmethod from_json(json_str)

Parse the action space from a json string.

reasoning: str | None = None
classmethod to_json_schema()

Return the json schema of the action space.

simworld.local_planner.local_planner module

Local Planner module: translates high-level plans into simulator actions.

class simworld.local_planner.local_planner.LocalPlanner(agent, model: A2ALLM, max_history_step: int = 3, dt: float = 0.1, observation_viewmode: str = 'lit', rule_based: bool = True, exit_event: Event | None = None)

Bases: object

Converts a high-level plan into low-level navigation actions.

execute(actions: HighLevelActionSpace) None

Execute a list of actions.

navigate_rule_based(point: Vector) None

Navigate using traffic rules and conditions.

navigate_to(destination: Vector) None

Navigate from current position to a given destination.

navigate_vision_based(point: Vector) None

Placeholder for vision-based navigation logic.

parse(plan: str) HighLevelActionSpace

Parse a plan string and execute the resulting actions.

pick_up(object_name: str) None

Pick up an object.

Module contents

Local Planner package.

This package provides functionality for converting activities into actions. It serves as a bridge between activity definitions and their corresponding action implementations.