ROS 2 package implementing the Deep Reinforcement Learning training pipeline for Arena-Rosnav. It wraps the rosnav_rl framework and provides the gym environments, trainer classes, configuration schemas, and scripts needed to train and evaluate navigation agents.
arena_training/
├── agents/ # Trained agent storage (training_config.yaml + best_model.zip)
├── arena_training/
│ ├── arena_rosnav_rl/ # Arena-specific wiring (cfg, trainer, node, tools)
│ └── environments/ # Gym environments (Gazebo, Flatland, …)
├── deps/
│ └── rosnav_rl/ # Git submodule — rosnav_rl framework
├── scripts/
│ ├── train_agent.py # Main training entry point
│ └── test_agent.py # Pipeline smoke-test (no full training)
├── pyproject.toml # Python deps managed by uv
├── package.xml
└── CMakeLists.txt
The canonical way is through the Arena workspace tooling, which handles submodule init, Python deps, and colcon build in one step:
cd ~/arena5_ws # replace with your actual workspace path
source arena
arena feature training install# 1. Initialize the rosnav_rl submodule (shallow clone to avoid fetching large history)
cd /path/to/arena5_ws/src/Arena/arena_training
git submodule update --init --depth 1 deps/rosnav_rl
# 2. Install Python dependencies into the Arena venv
cd /path/to/arena5_ws/src/Arena
uv pip install -e arena_training -e arena_training/deps/rosnav_rl/rosnav_rl
# 3. Build ROS 2 packages
cd /path/to/arena5_ws
arena build
source arenaThe easiest way to start training is through arena launch. Providing train_config automatically implies train_mode:=true and launches train_agent.py in parallel with the simulation:
# Start simulation + training together (train_mode implied)
arena launch sim:=gazebo local_planner:=rosnav_rl env_n:=2 \
train_config:=/path/to/dreamer_training_config.yaml
# Or with a config name - resolved from arena_training/configs/
arena launch sim:=gazebo local_planner:=rosnav_rl env_n:=2 \
train_config:=dreamer_training_config.yaml
# Start simulation only in train_mode (no trainer process)
arena launch sim:=gazebo local_planner:=rosnav_rl env_n:=2 train_mode:=trueNote:
train_configandtrain_modeare independent -train_configsets up the trainer process, whiletrain_modecontrols simulation behaviour (directcmd_velpublishing, nav2 controller silenced). Providingtrain_configsetstrain_modetotrueautomatically.
See arena_bringup for all available launch arguments. For agent, observation space, reward and curriculum configuration refer to the rosnav_rl README.
# Default config (sb_training_config.yaml)
ros2 run arena_training train_agent
# Specific config by name — resolved from arena_training/configs/
ros2 run arena_training train_agent --config dreamer_training_config.yaml
# Absolute path
ros2 run arena_training train_agent --config /path/to/my_config.yamlConfig resolution order:
- Absolute path — used directly
- Relative path from current working directory
- Name only — looked up in
arena_training/configs/
Training metrics are logged to Weights & Biases automatically. Trained agents are saved to agents/<agent_name>/ (training_config.yaml + best_model.zip).
| File | Description |
|---|---|
sb_training_config.yaml |
Stable Baselines3 — PPO / SAC / TD3 (default) |
dreamer_training_config.yaml |
DreamerV3 model-based RL |
observations/observations.yaml |
Observation space definitions |
Trained agents ( training_config.yaml + best_model.zip) are saved under arena_training/agents/<agent_name>/. Resolution order:
agents_dirfield in the training config YAML (highest priority)ROSNAV_AGENTS_DIRenvironment variable- Default:
arena_training/agents/
Trained agents are loaded by the rosnav_rl action server at inference time. See the rosnav_rl README for deployment instructions.
Quick test without a simulator:
ros2 run arena_training test_agent| Framework | Algorithms |
|---|---|
| Stable Baselines3 | PPO, SAC, TD3, A2C, DDPG |
| DreamerV3 | Model-based RL with world models |
Configs are Pydantic-validated YAML. Top-level keys:
arena_cfg: # simulation / task / robot / monitoring settings
agent_cfg: # rosnav_rl agent: framework, observation spaces, action spacerosnav_rl not found
cd /path/to/arena5_ws/src/Arena/arena_training
git submodule update --init --depth 1 deps/rosnav_rl
cd /path/to/arena5_ws/src/Arena
uv pip install -e arena_training -e arena_training/deps/rosnav_rl/rosnav_rlConfig file not found
# Configs ship with arena_training — list available ones:
ls /path/to/arena5_ws/src/Arena/arena_training/configs/Pass the file name only (e.g. dreamer_training_config.yaml) and it will be found automatically, or supply an absolute path.
arena_bringup— launch files and training configsarena_simulation_setup— simulation environment setuptask_generator— dynamic task generationarena_evaluation— evaluation utilitiesrosnav_rl— core RL framework (submodule)