Skip to content

Commit c956f2d

Browse files
authored
General Documents (#2)
* docs: README * Update documentation for new repository and usage changes Updated all documentation references from 'lgcyaxi' to 'radar-lab' GitHub organization. Improved installation, quick start, and FAQ instructions to reflect new repository URLs, updated command examples, and clarified environment setup steps. Replaced architecture diagram and fixed links to external resources. Cleaned up and reorganized FAQ and troubleshooting sections for clarity. * Refactor and reorganize MARL documentation Removed outdated and redundant MARL development and overview documents, consolidating content into a new architecture file at docs/marl/architecture.md. Updated references throughout the documentation to point to the new architecture location. Cleaned up related links and removed phase-specific development status sections from user-facing docs. Added /archived_docs to .gitignore. * Add TD3 MARL config and update docs for intersection scenarios Added a new TD3-based multi-agent RL configuration for high-density intersection scenarios at configs/marl/intersection_td3.yaml. Expanded the MARL quick-start documentation with detailed usage, agent types, and algorithm configuration examples. Updated installation instructions to include an optional pre-built maps package. Adjusted pixi commands to use intersection_rule_based as the default for quick tests. * Refactor MARL docs, update configs, and remove old guides Removed outdated MARL algorithm and training documentation, significantly revised the architecture and changelog docs to reflect the new 3-layer system, agent types, RL algorithms, and traffic management. Updated mkdocs.yml to hide removed pages, and bumped dependency versions in pixi configs to 0.1.0-alpha. This prepares the documentation and configuration for the new MARL foundation release.
1 parent 99c7ef9 commit c956f2d

31 files changed

+1007
-2590
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,5 @@ ready*
152152

153153
!/recordings/*.json
154154
/checkpoints/*/*episode_*.*
155-
/checkpoints/*/latest_checkpoint.*
155+
/checkpoints/*/latest_checkpoint.*
156+
/archived_docs

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,21 @@ Check our [documentation](#) for detailed architecture and MARL integration.
5050

5151
## Get Started
5252

53-
![teaser](docs/images/platoon_joining_2lanefree_complete.gif)
53+
![teaser](docs/images/MARL-rule-based-simulation.gif)
5454

5555
### Users Guide
5656

57-
* [Overview](#)
58-
* [Installation](#)
59-
* [Quick Start](#)
60-
* [Logic Flow](#)
61-
* [Traffic Generation](#)
57+
* [Overview](https://radar-lab.github.io/OpenCDA-MARL/)
58+
* [Installation](https://radar-lab.github.io/OpenCDA-MARL/installation/)
59+
* [Quick Start](https://radar-lab.github.io/OpenCDA-MARL/quick-start/)
6260

6361
Note: We continuously improve the performance of OpenCDA-MARL. Currently, it is mainly tested in our customized maps. However, we <strong>DO NOT </strong> guarantee the same level of robustness in other maps. We will update the documentation and the maps in the future.
6462

6563
### Developer Guide
6664

67-
* [Class Design](#)
65+
* [Class Design](https://radar-lab.github.io/OpenCDA-MARL/architecture/)
6866
* [Customize Your Algorithms](#)
69-
* [API Reference](#) <br>
67+
* [API Reference](https://radar-lab.github.io/OpenCDA-MARL/api/opencda-marl/overview/) <br>
7068

7169
### Contributing
7270

configs/marl/intersection_td3.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Extend fields - only these fields will extend instead of replace
2+
_extend_fields:
3+
- "world.seed" # Add to base seed for variation
4+
5+
description: |-
6+
TD3 configuration for 4-way intersection with HIGH traffic density.
7+
Twin Delayed DDPG with continuous action space for speed control.
8+
This scenario focuses on intersection navigation under heavy congestion.
9+
10+
# Demonstrate seed extension - adds variation to base seed
11+
world:
12+
seed: 5 # This will be ADDED to default.yaml seed (11) = 16 total
13+
14+
spectator:
15+
preset: "intersection_bird_eye"
16+
17+
meta:
18+
# available scenario types: intersection
19+
scenario_type: "intersection"
20+
town: "intersection_12_lane_fixed"
21+
# custom xodr path for this scenario
22+
# xodr_path: "opencda_marl/assets/maps/intersection.xodr"
23+
24+
# minimal scenario configuration
25+
scenario:
26+
simulation:
27+
max_steps: 2400 # 2 minute = 20fps * 60s * 2
28+
max_episodes: 100
29+
traffic:
30+
# Traffic mode: 'record', 'replay', or 'live'
31+
mode: "replay"
32+
replay_file: "recordings/lite_2minL.json"
33+
#replay_file: "recordings/quick_test.json"
34+
base_speed: 45.0 # km/h base speed for vehicles
35+
active_junctions: [4]
36+
37+
planner:
38+
distance: 5.0 # base spacing (m)
39+
spawn_offset: 7 # multiples of safe_distance upstream
40+
dest_offset: 7 # multiples of safe_distance downstream
41+
spawn_z_lift: 0.3 # small lift to avoid ground collision
42+
wp_step: 1.0 # stepping granularity along lanes (m)
43+
allow_uturn: false
44+
visualize:
45+
entry_wp: false
46+
exit_wp: false
47+
spawn_wp: false
48+
dest_wp: false
49+
route_line: false
50+
junction_center: true
51+
bbox: false
52+
extent_box: true
53+
text: true
54+
life_time: 10.0
55+
56+
agents:
57+
debug: false
58+
agent_type: "marl"
59+
60+
marl:
61+
# Base VanillaAgent parameters
62+
debug: false
63+
max_speed: 65 # Maximum speed for the agent (km/h)
64+
emergency_param: 0.4
65+
ignore_traffic_light: true
66+
collision_time_ahead: 1.5
67+
local_planner:
68+
trajectory_update_freq: 5
69+
debug: false
70+
debug_trajectory: false # Keep trajectory clean for RL
71+
72+
MARL:
73+
# Algorithm selection: q_learning, td3, sac, ppo, dqn
74+
algorithm: "td3"
75+
76+
state_dim: 9 # Auto-calculated from custom features (9D total)
77+
action_dim: 1 # Continuous speed control
78+
79+
# TD3 Algorithm Configuration (Multi-Agent)
80+
td3:
81+
# Feature configuration (9D total)
82+
features:
83+
rel_x: 1 # Relative X to intersection
84+
rel_y: 1 # Relative Y to intersection
85+
position_x: 1 # Absolute X position
86+
position_y: 1 # Absolute Y position
87+
lane_position: 1 # Lane position (0=intersection, 1=left, 2=middle, 3=right)
88+
heading_angle: 1 # Vehicle orientation (radians)
89+
dist_to_intersection: 1 # Distance to intersection
90+
dist_to_front_vehicle: 1 # Distance to front vehicle
91+
waypoint_buffer: 1 # Waypoint count (0-50 range)
92+
93+
# LSTM conflict encoder (from ITS_Sim architecture)
94+
conflict_encoder:
95+
type: "LSTM"
96+
input_size: 9 # From custom features (auto-calculated)
97+
hidden_size: 256 # LSTM hidden dimension
98+
num_layers: 1 # LSTM layers
99+
100+
# Motion planner architecture (from AdvRAIM)
101+
motion_planner:
102+
num_layers: 5
103+
input_dim: [265, 1024, 1024, 512, 256] # First: 9 + 256 = 265
104+
output_dim: [1024, 1024, 512, 256, 1] # Final output: 1 (action)
105+
106+
# Learning rates - reduced for stable training
107+
learning_rate_actor: 1e-3 # Actor learning rate (stable learning)
108+
learning_rate_critic: 1e-3 # Critic learning rate (stable convergence)
109+
110+
# TD3 hyperparameters
111+
tau: 0.01 # Soft update parameter for target networks (2x faster updates)
112+
discount: 0.99 # Discount factor (gamma)
113+
policy_noise: 0.2 # Noise added to target policy during critic update
114+
noise_clip: 0.3 # Range to clip target policy noise
115+
exploration_noise: 0.5 # Maximum noise for aggressive speed exploration (±21 km/h)
116+
policy_freq: 2 # Delayed policy updates (update actor every 2 critic updates)
117+
118+
# Training parameters
119+
batch_size: 512 # Training batch size (large for stable gradients)
120+
memory_size: 300000 # Replay buffer size (large for diverse experience)
121+
min_memory_size: 25000 # Minimum transitions before training starts
122+
save_frequency: 1000 # Save model every N episodes
123+
eval_frequency: 500 # Evaluate policy every N episodes
124+
125+
# Training configuration
126+
training:
127+
load_model: false # Load pre-trained model if available
128+
model_dir: "models/td3/" # Model save directory
129+
enable_wandb: false # Weights & Biases logging
130+
wandb_project: "opencda_marl" # WandB project name

dependencies/pixi/pixi_Linux_ROCm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["AXIBA <leolihao@arizona.edu>"]
33
channels = ["conda-forge", "pytorch", "nvidia"]
44
name = "OpenCDA"
55
platforms = ["linux-64"]
6-
version = "0.1.0"
6+
version = "0.1.0-alpha"
77

88
[system-requirements]
99
cuda = "12.8"

dependencies/pixi/pixi_winCUDA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["AXIBA <leolihao@arizona.edu>"]
33
channels = ["conda-forge", "pytorch", "nvidia"]
44
name = "OpenCDA"
55
platforms = ["win-64"]
6-
version = "0.1.0"
6+
version = "0.1.0-alpha"
77

88
[system-requirements]
99
cuda = "12.8"

dependencies/pixi/pixi_winRTX5090.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["AXIBA <leolihao@arizona.edu>"]
33
channels = ["conda-forge", "pytorch", "nvidia"]
44
name = "OpenCDA"
55
platforms = ["win-64"]
6-
version = "0.1.0"
6+
version = "0.1.0-alpha"
77

88
[system-requirements]
99
cuda = "12.8"

docs/about.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ Dr. Liu Bo (Associate Professor @ UA):
1919

2020
Lihao Guo (Ph.D. Student @ UA):
2121

22-
- Project Lead and OpenCDA-MARL System Architect
22+
- Project Lead
23+
- OpenCDA-MARL System Architect
2324
- MARL Algorithm Development
2425
- [Homepage](https://www.lgcyaxi.net/)
2526
- [Linkedin](https://www.linkedin.com/in/lgcyaxi)
2627

2728
Jiahao Tang (Ph.D. Student @ UA):
2829

29-
- Maps
30-
- [Linkedin](https://www.linkedin.com/in/xu-han-12851a64/)
30+
- Rule-based Agent Configuration
31+
- [Linkedin](https://www.linkedin.com/in/jiahaotang1997/)
3132

3233
Louis Liu (Volunteer Student @ University High School):
3334

3435
- Map Development
35-
- SUMO Co-Simulation
36+
- Simulation Testing
37+
- [Linkedin](https://www.linkedin.com/in/louisliu2/)

docs/api/opencda-marl/map_manager.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,4 @@ The `MARLMapManager` extends OpenCDA's map management with MARL-specific feature
464464
- **Complementary**: MARL manager for spawn planning, OpenCDA for perception
465465
- **Consistent**: Both use CARLA map data and OpenCDA utilities
466466
- **Flexible**: Can use MARL spawns with OpenCDA vehicles
467-
- **Scalable**: Junction-based approach works for any map size
468-
469-
## Related Documentation
470-
471-
- **[OpenCDA Map Manager](../opencda/overview.md)**: Core rasterization and perception utilities
472-
- **[MARL Overview](../../marl/overview.md)**: MARL framework documentation
473-
- **[OpenCDA Integration](../../opencda/core.md)**: Integration patterns with OpenCDA
467+
- **Scalable**: Junction-based approach works for any map size

docs/api/opencda-marl/overview.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -361,37 +361,4 @@ for vehicle in vehicles:
361361

362362
# Interactive CLI mode
363363
python opencda.py -t intersection -v 0.9.15 --marl --interactive
364-
```
365-
366-
## Development Status
367-
368-
=== "✅ Phase 1: Foundation (95% Complete)"
369-
370-
- **✅ Complete**: Core architecture, scenario system, environment interface, GUI
371-
- **🔄 Remaining**: Vehicle adapter, enhanced configuration, testing framework
372-
373-
=== "🔄 Phase 2: Agent Integration (Next)"
374-
375-
- **Priority**: Vehicle adapter implementation
376-
- **Planned**: RL algorithm integration (PPO, MADDPG)
377-
- **Goal**: End-to-end training pipeline
378-
379-
=== "📋 Phase 3: Advanced MARL (Future)"
380-
381-
- Multi-agent algorithms with communication
382-
- Distributed training infrastructure
383-
- Advanced coordination mechanisms
384-
385-
=== "📋 Phase 4: Research Extensions (Future)"
386-
387-
- Experiment management tools
388-
- Benchmark scenarios and metrics
389-
- Performance analysis and visualization
390-
391-
**Related Documentation**
392-
393-
- **[Coordinator API](coordinator.md)**: Central orchestration and execution modes
394-
- **[Scenario API](scenario.md)**: Template-based scenario generation and management
395-
- **[Map Adapter API](adapters/map_adapter.md)**: OpenCDA-MARL map integration bridge
396-
- **[Implementation Guide](../../marl/implementation.md)**: Step-by-step development guide
397-
- **[Phase 1 Setup](../../marl/dev/phase1_setup.md)**: Current foundation status
364+
```

0 commit comments

Comments
 (0)