Skip to content

task_generator

Per-env episode loop for Arena. Assigns goals to robots, populates the simulator with obstacles, and coordinates across episodes via a three-axis task-mode registry.

The arena_node runtime, env/hold registries, and simulator adapters live in arena_runtime/.

Guides

  • Task system: Task, TaskMode ABC, TaskContext, the three mode registries, reset semantics.
  • Robot task modes: TM_Robots subclasses, fleet manager, adapters.
  • Robot adapters: Adapter ABC, shipped kinds, adding a new one.
  • Obstacle task modes: TM_Obstacles subclasses, shipped modes, zone-ref resolution, PROMPT registration.
  • Modules: TM_Module lifecycle hooks, shipped modules.
  • Managers: RobotsManager, RobotManager, WorldManager, EnvironmentManager, Realizer.
  • Sim interface: BaseSim and its four sub-interfaces; registered implementations.
  • Human simulator: BaseHumanSimulator, PROMPT registration, hunav default agent.
  • Acoustics simulator: acoustics:= axis, BaseAcousticsSimulator declares the map-server requirement, the RViz displays, panels and tools, the recorded topics and pedestrian hearing, and receives the sounds module's SoundEmissions. The arena backend (simulators/acoustics/arena/) is the only code importing arena_auditory (arena feature auditory install).
  • Robot hearing: robot.hearing:= axis, BaseHearing declares the per-robot RViz displays and recorded topics, nav2_overlay() the Nav2 params overlay. The arena backend (simulators/hearing/arena/) is the only code importing arena_hearing (arena feature hearing install).
  • Utils: generic Registry, arena helpers, GPT shim, map generator.
  • Constants: Configuration(server) factory; all published ROS parameters.

Internals

The Constants.TaskMode registry

constants/__init__.py defines three enum.Enum axes inside Constants.TaskMode:

Axis Enum Default
Robot goal dispatch TM_Robots random
Obstacle population TM_Obstacles random
Cross-cutting modules TM_Module (empty set)

All three are wired at import time in tasks/registry.py via three TaskModeRegistry instances: ROBOTS_MODES, OBSTACLES_MODES, and MODULE_MODES. Each registration stores a lazy loader (a zero-argument callable that imports and returns the class) plus a TaskModeMeta (namespace + optional schema) keyed by the mode enum. Metadata is available without invoking the loader, so the impl module is not imported until the mode is first selected.

Task.__init__ reads task.robots, task.obstacles, and task.modules from the ROS parameter server (via node.conf.TaskMode.*) and calls the matching loaders. On each reset Task._reset_episode re-reads the parameters, swapping the active mode if it changed.

Episode loop

See task_generator/tasks/README.md for the full Task._reset_episode ordering and the WORLD-layer invariant.