Simulator dispatch¶
Entry point: sim.launch.py.
Called from arena_runtime.launch.py with simulator, use_sim_time, world, and
headless. Its sole job is to select and delegate to one simulator backend.
SelectAction dispatch¶
SelectAction is a key->action registry resolved at launch time. The selector
expression is LaunchConfiguration('simulator'). Each registered key maps to
a GroupAction or ExecuteProcess.
simulator key -> action
──────────────────────────────────────────────────────────────────
dummy -> static_transform_publisher (map -> dummy TF only)
flatsim -> ExecuteProcess: `arena feature flatsim launch`
gazebo -> ExecuteProcess: `arena feature gazebo launch`
isaac -> ExecuteProcess: `arena feature isaac launch`
The simulator LaunchArgument is declared after the SelectAction is
built so that choices can be derived from launch_simulator.keys - the
keys registered above. Passing an unregistered value causes a launch-time
validation error.
Feature-gated delegation¶
The real simulators run via their feature launch verb: sim.launch.py
delegates with an ExecuteProcess (bash -c 'arena feature <sim> launch ...',
on_exit=Shutdown). The verb refuses unless the feature is installed
(arena feature <sim> install), so the dispatcher is the single live entry and
the verb is never a dead path. Forwarded args: gazebo gets
use_sim_time/headless/world, isaac gets headless/log_level, flatsim
gets sim.flatsim.dynamics as dynamics. sim:=flatsim without the flatsim
package fails at launch with the install hint.
The real bringup files live wherever the feature owns them:
arena_bringup: launch/simulator/sim/gazebo/gazebo.launch.py (gz-sim 8 + clock bridge)
arena_isaac: run_isaacsim.launch.py (Isaac Sim app)
flatsim: launch/flatsim.launch.py (flatsim server)
gazebo.launch.py (arena_bringup)¶
- Reached via
arena feature gazebo launch, so it only runs when the gazebo feature is installed. - Stages models via
arena_simulation_setup.staging.stage()at Python-load time. - Sets
GZ_SIM_RESOURCE_PATHandGAZEBO_MODEL_PATHfrom the staging directory plusarena_robotsand any declared deps. - Resolves the world SDF: looks for
arena_simulation_setup/worlds/<world>/worlds/<world>.world; falls back toarena_bringup/configs/gazebo/empty.sdfif the file is absent. - Launches
ros_gz_sim gz_sim.launch.py(gz-sim 8, dart physics, ogre renderer). Whenheadless=True, passes-s(server-only). - Starts a
ros_gz_bridge parameter_bridgefor gz's clock on/gz/clockand the arena_runtimeclock_relaythat forwards it to/clockonly when sim time advances (a paused gz loop republishes the same stamp every iteration).
run_isaacsim.launch.py (arena_isaac)¶
- Reached via
arena feature isaac launch(which, in docker, brings up the separateisaaccompose service first).
Adding a new simulator¶
- Add a feature with a
launchverb that exec's the real bringup (inarena_bringupor the feature's own package). - In
sim.launch.py, calllaunch_simulator.add("<name>", ExecuteProcess(...))delegating toarena feature <name> launch. - The new key appears in
launch_simulator.keysautomatically, so thesimulatorargument'schoiceslist updates without extra changes. - Add the corresponding
Constants.SimSimulator.<NAME>entry intask_generator/task_generator/constants/__init__.pyif the task-generator needs to branch on it.