Hierarchical hybrid motion control for overactuated 4WID-4WIS mobile robots.
WIS-DRL is the appendix code for a hierarchical hybrid framework that combines PPO-based mode selection with constrained low-level control for 4WID-4WIS robots. The repository follows a standard open-source layout: one script per workflow, clear map aliases, reproducible benchmarks, and plotting utilities for paper-style figures.
Fig. 1. Overall architecture of the proposed hierarchical hybrid framework.
- Overview
- Highlights
- Architecture
- Repository Contents
- Repository Layout
- Supported Maps
- Installation
- Quick Start
- Outputs
- Citation
- License
The control stack uses a two-level design:
- The upper layer observes path geometry, vehicle motion, mode history, steering history, and local clearance.
- A PPO policy chooses one of three discrete motion modes: OMM, PTM, or ZRM.
- The lower layer converts the selected mode into feasible wheel-level commands.
- The repository includes the hierarchical policy, a pure MPC baseline, a rule-based switcher, and an end-to-end continuous RL baseline for comparison.
This design is intended to improve:
- Training stability
- Decision interpretability
- Control feasibility under actuation constraints
- Execution efficiency on complex maps
- Hierarchical DRL + MPC control for overactuated 4WID-4WIS robots
- Three motion modes with clear semantic mapping to code modules
- Built-in curriculum over
map_a,map_b, andmap_c - Reproducible training, testing, benchmarking, and plotting scripts
- Standalone AFM, APT, AZR, and NMPC demos for paper reproduction
The figure above mirrors the paper’s main pipeline and the code organization in this repository.
| Paper term | Code module | Role |
|---|---|---|
| OMM | AFM |
Omnidirectional motion with single-track equivalent NMPC |
| PTM | APT |
Pure translation with geometric body-frame control |
| ZRM | AZR |
Zero-radius rotation with geometric in-place steering |
| Upper-layer DRL | PPO mode selector | Chooses among OMM / PTM / ZRM |
| Lower-layer controller | AFM / APT / AZR |
Produces feasible low-level commands |
| Observation state | ModeEnv observation |
Path preview + motion state + history + clearance |
train.pytrains the PPO-based mode selector.test.pyevaluates a trained policy and exports detailed traces.train_end_to_end_continuous_rl.pytrains the direct wheel-level continuous baseline.benchmark_policy_vs_mpc.pycompares PPO, pure MPC, rule-based switching, and continuous RL.benchmark_afm_module.pybenchmarks the standalone AFM module on all paper maps.main_controller.pyandrun_mode_switch.pyprovide scripted mode-switch demos.nmpc_path_tracking.pyruns standalone NMPC tracking for the AFM baseline.draw_map.pyrenders the tri-mode composite map.plot_results.pyturns logs into publication-style figures.
WIS-DRL/
├── controllers/ # AFM, APT, AZR, and robust NMPC controllers
├── env/ # Training and evaluation environments
├── maps/ # Map definitions and reference paths
├── scripts/ # Shell wrappers for common workflows
├── train.py
├── test.py
├── train_end_to_end_continuous_rl.py
├── benchmark_policy_vs_mpc.py
├── benchmark_afm_module.py
├── main_controller.py
├── run_mode_switch.py
├── nmpc_path_tracking.py
├── draw_map.py
├── plot_results.py
├── README.md
├── README_zh.md
├── requirements.txt
└── LICENSE
MapManager exposes the following map types:
| Map name | Description | Notes |
|---|---|---|
map_a |
AFM open-track map | Used for OMM / AFM experiments |
map_b |
APT alignment map | Used for PTM / APT experiments |
map_c |
AZR reorientation map | Used for ZRM / AZR experiments |
tri_mode_composite |
Composite benchmark map | Default evaluation map |
If you omit --map in train.py, the training script uses the built-in curriculum over map_a, map_b, and map_c.
Recommended Python version: 3.10 or 3.11.
cd WIS-DRL
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txtIf you want TensorBoard separately:
pip install tensorboardThe shell wrappers in scripts/ automatically source scripts/env.sh, which keeps matplotlib and font caches inside .cache/ and changes to the project root before launching Python.
Use the default built-in curriculum:
bash scripts/train_mode_switch.sh --timesteps 500000Train on a single map instead:
python train.py --timesteps 500000 --map map_abash scripts/test_mode_switch.sh \
--model-path models/<your_model>/best_model.zipTo test a specific map:
python test.py \
--model-path models/<your_model>/best_model.zip \
--map tri_mode_composite \
--episodes 20bash scripts/train_continuous.sh --total-timesteps 800000Or run it directly:
python train_end_to_end_continuous_rl.pybash scripts/benchmark_policy_vs_mpc.sh \
--model-path models/<your_model>/best_model.zipTo include the continuous baseline in the comparison:
bash scripts/benchmark_policy_vs_mpc.sh \
--model-path models/<your_model>/best_model.zip \
--continuous-model-path models/<continuous_model>/best_model.zipbash scripts/benchmark_afm_module.shbash scripts/draw_map.shbash scripts/plot_results.sh --log-dir ./logs/<run_dir>If you already have test outputs:
bash scripts/plot_results.sh --test-results ./test_results/<run_dir>Generated artifacts are written to the following locations:
models/for checkpoints and run configslogs/for environment statistics and evaluation logstb_logs/for TensorBoard runstest_results/for evaluation summaries and step tracesbenchmark_results/for comparison tables, plots, and CSV filesfigures/for maps and publication-style plotsoutputs/for demo trajectories and rendered figures
If you use this code in your work, please cite the corresponding paper.
MIT License
