# parths5/cmu-vla-challenge architecture

> Architecture diagram of the GitHub repository parths5/cmu-vla-challenge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/parths5/cmu-vla-challenge
- Repository: https://github.com/parths5/cmu-vla-challenge

## Overview

1. This repository is a challenge scaffold with two major halves: `ai_module/` contains the team’s reasoning and action-selection code, while `system/` contains the ROS-based robot/simulator stacks that expose sensor data and accept navigation commands. The code is organized so the AI module can be swapped without changing the base autonomy system.

2. The core runtime contract is ROS message passing. The evaluator publishes one natural-language command on `/challenge_question`. The AI module must answer on one of three output topics depending on task type: `/numerical_response` (`Int32`), `/selected_object_marker` (`Marker`), or `/way_point_with_heading` (`Pose2D`). The base system consumes the waypoint/marker outputs; numerical outputs are read by the evaluator.

3. `ai_module/` is the main algorithm boundary. Its `main_launcher.py` and `main_launcher_t3.py` indicate separate launch paths, likely for general question handling and the instruction-following track. The package mixes Python and C++ via Catkin, and the README explicitly says it is intended to be replaced by a custom VLM/LLM-based solution.

4. Inside `ai_module/`, the architecture is split by task:
   - `question_parser/` classifies or routes the incoming question, including a Gemini-based classifier.
   - `question_solver_master/` appears to coordinate end-to-end dispatch from parsed intent to a task-specific solver.
   - `t1_numerical_solver/`, `t2_selected_object_marker_solver/`, and `t3_instruction_following_solver/` implement the three challenge subtasks.
   - `t3_solver_sad/` looks like an alternate or legacy solver variant for object markers/navigation.

5. The object-grounding path in `ai_module` is centered on map semantics. `map/object_marker_collector.py` suggests it ingests `/object_markers` from the system and manages object metadata for grounding. This is the likely bridge between spatial language and selectable scene entities.

6. Navigation logic is separated from language understanding. The `navigator/` package contains `grid_creator.py`, `planner.py`, and `wpNav.py`, which together suggest map discretization, path planning, and waypoint-following utilities. This layer converts grounded targets or path constraints into robot-executable waypoint sequences.

7. The instruction-following stack in `t3_instruction_following_solver/` is more specialized. Files such as `vlm_planner.py`, `pixel_to_waypoint_converter.py`, and `vln_data_interface.py` imply a pipeline that takes vision-language reasoning, maps image-space or semantic outputs into navigation coordinates, and emits waypoints. This is the most likely place where scene exploration and path-constrained navigation are assembled.

8. `system/unity/` is one complete robot/simulator runtime based on Unity. It contains:
   - `vehicle_simulator/` for the simulated robot, scene, and RViz config
   - `semantic_scan_generation/`, `sensor_scan_generation/`, and `segmentation_proc/` for perception products
   - `terrain_analysis/` and `terrain_analysis_ext/` for traversability and local terrain computation
   - `local_planner/`, `waypoint_converter/`, and `bbox_calculation/` for motion and object/geometry support
   - RViz plugins and joystick drivers for operator-facing tooling
   This stack exposes the same ROS interface expected by the AI module.

9. `system/matterport/` is a second, parallel runtime built around Habitat/Matterport3D rather than Unity. It mirrors much of the Unity stack conceptually: vehicle simulation, waypoint conversion, local planning, segmentation, terrain analysis, scan generation, and visualization. For architecture diagrams, it should be treated as an alternate backend with the same AI-module contract, not as a separate product.

10. The system layer is intentionally modular around sensing and autonomy services. The major data flow is: simulated or real sensors feed scan/segmentation/terrain nodes, those nodes produce traversability, object markers, and registered scans, and the navigation stack consumes waypoints from the AI module. The AI module is therefore not directly controlling low-level actuation; it sends high-level navigation intents into the autonomy stack.

11. The challenge assets are part of the repo and matter to architecture because they define the evaluation inputs. `questions/` contains per-scene PDFs, trajectories, and a `questions.json`, while `figures/` documents the scene/system setup. These are offline artifacts used to develop and validate the AI module, not runtime dependencies.

12. Deployment is containerized. The `docker/` folder holds Dockerfiles and compose files for GPU execution, and shell scripts such as `launch_system.sh`, `launch_module.sh`, and the system-specific bring-up scripts orchestrate startup. The README also calls out a Python 3 Catkin build requirement for `ai_module`, which is important because the AI code runs under the container’s Python environment.

13. The external-service boundary is the optional Gemini integration. The presence of `setup_gemini_env.sh`, `activate_gemini_env.sh`, and `question_parser/gemini_classifier.py` indicates that the repo can use an online or API-backed LLM/VLM for question classification or solving, but the challenge itself only requires that the resulting ROS outputs match the expected message types and topics.

14. In architecture-diagram terms, the key boundaries are:
   - challenge/evaluator vs. AI module via `/challenge_question`
   - AI module vs. autonomy system via the three output ROS topics
   - autonomy system vs. simulator/robot via Unity or Habitat and the sensor/perception topics
   - development assets vs. runtime nodes via the `questions/` and scene data folders
   This separation is the central design pattern of the repository.

Main entry points: [`ai_module/src/question_solver_master/question_solver.py`](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_solver_master/question_solver.py) (Solver master), [`ai_module/src/t2_selected_object_marker_solver/t2_solver.py`](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t2_selected_object_marker_solver/t2_solver.py) (Object solver), [`ai_module/src/question_parser/question_parser.py`](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_parser/question_parser.py) (Parser), [`ai_module/src/navigator/planner.py`](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/navigator/planner.py) (Navigator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_challenge_assets["Challenge Assets"]
  node_challenge_input(("Challenge Q<br/>ROS input"))
  node_question_bank["Questions<br/>offline assets"]
end

subgraph group_ai_module["AI Module"]
  node_launcher_main["Main launcher<br/>ai entrypoint<br/>[main_launcher.py]"]
  node_launcher_t3["T3 launcher<br/>ai entrypoint"]
  node_question_parser["Parser<br/>intent router<br/>[question_parser.py]"]
  node_gemini_classifier["Gemini cls<br/>LLM classifier"]
  node_solver_master["Solver master<br/>dispatch coordinator<br/>[question_solver.py]"]
  node_t1_solver["Number solver<br/>task solver<br/>[t1_solver.py]"]
  node_t2_solver["Object solver<br/>task solver<br/>[t2_solver.py]"]
  node_t3_solver["Instr. solver<br/>navigation solver<br/>[t3_solver.py]"]
  node_t3_alt_solver["Alt T3<br/>legacy solver"]
  node_object_collector["Object map<br/>grounding store"]
  node_navigator["Navigator<br/>path planning<br/>[planner.py]"]
  node_vlm_planner["VLM planner<br/>vision-language<br/>[vlm_planner.py]"]
  node_waypoint_converter["Pixel->WP<br/>coordinate bridge"]
end

subgraph group_system_unity["Unity System"]
  node_unity_runtime["Unity runtime<br/>sim backend"]
  node_unity_perception["Unity sensing<br/>perception stack"]
  node_unity_nav["Unity nav<br/>autonomy stack<br/>[localPlanner.cpp]"]
end

subgraph group_system_matterport["Matterport System"]
  node_matterport_runtime["Matterport runtime<br/>sim backend"]
  node_matterport_perception["Matterport sensing<br/>perception stack"]
  node_matterport_nav["Matterport nav<br/>autonomy stack<br/>[localPlanner.cpp]"]
end

node_challenge_input -->|"publish"| node_launcher_main
node_challenge_input -->|"publish"| node_launcher_t3
node_launcher_main -->|"route"| node_question_parser
node_launcher_t3 -->|"route"| node_solver_master
node_question_parser -.->|"optional"| node_gemini_classifier
node_question_parser -->|"dispatch"| node_solver_master
node_solver_master -->|"task 1"| node_t1_solver
node_solver_master -->|"task 2"| node_t2_solver
node_solver_master -->|"task 3"| node_t3_solver
node_solver_master -.->|"alt path"| node_t3_alt_solver
node_t2_solver -->|"ground"| node_object_collector
node_t1_solver -->|"answer"| node_challenge_input
node_t2_solver -->|"marker"| node_unity_runtime
node_t2_solver -->|"marker"| node_matterport_runtime
node_t3_solver -->|"plan"| node_vlm_planner
node_vlm_planner -->|"convert"| node_waypoint_converter
node_waypoint_converter -->|"handoff"| node_navigator
node_navigator -->|"drive"| node_unity_nav
node_navigator -->|"drive"| node_matterport_nav
node_unity_perception -->|"sense"| node_unity_runtime
node_matterport_perception -->|"sense"| node_matterport_runtime
node_question_bank -.->|"dev data"| node_solver_master

click node_question_bank "https://github.com/parths5/cmu-vla-challenge/tree/team-copypasta-submission/questions"
click node_launcher_main "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/main_launcher.py"
click node_launcher_t3 "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/main_launcher_t3.py"
click node_question_parser "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_parser/question_parser.py"
click node_gemini_classifier "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_parser/gemini_classifier.py"
click node_solver_master "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_solver_master/question_solver.py"
click node_t1_solver "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t1_numerical_solver/t1_solver.py"
click node_t2_solver "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t2_selected_object_marker_solver/t2_solver.py"
click node_t3_solver "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/t3_solver.py"
click node_t3_alt_solver "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_solver_sad/t3_solver_object_markers.py"
click node_object_collector "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/map/object_marker_collector.py"
click node_navigator "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/navigator/planner.py"
click node_vlm_planner "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/vlm_planner.py"
click node_waypoint_converter "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/pixel_to_waypoint_converter.py"
click node_unity_runtime "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/vehicle_simulator/src/vehicleSimulator.cpp"
click node_unity_perception "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/semantic_scan_generation/src/semanticScanGeneration.cpp"
click node_unity_nav "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/local_planner/src/localPlanner.cpp"
click node_matterport_runtime "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/vehicle_simulator/src/vehicleSimulator.cpp"
click node_matterport_perception "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/semantic_scan_generation/src/semanticScanGeneration.cpp"
click node_matterport_nav "https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/local_planner/src/localPlanner.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_challenge_input,node_question_bank toneBlue
class node_launcher_main,node_launcher_t3,node_question_parser,node_gemini_classifier,node_solver_master,node_t1_solver,node_t2_solver,node_t3_solver,node_t3_alt_solver,node_object_collector,node_navigator,node_vlm_planner,node_waypoint_converter toneAmber
class node_unity_runtime,node_unity_perception,node_unity_nav toneMint
class node_matterport_runtime,node_matterport_perception,node_matterport_nav toneRose
```

## Components

### Challenge Assets

Offline evaluation materials and deployment scripts.

- **Challenge Q**: ROS input · Single natural-language task published by the evaluator.
- [Questions](https://github.com/parths5/cmu-vla-challenge/tree/team-copypasta-submission/questions): offline assets · Scene question sets, trajectories, and labels used for development and validation. · `questions`

### AI Module

Swappable reasoning and task-selection boundary.

- [Main launcher](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/main_launcher.py): ai entrypoint · Primary runtime entrypoint for the AI module. · `ai_module/src/main_launcher.py`
- [T3 launcher](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/main_launcher_t3.py): ai entrypoint · Alternative launch path for instruction-following mode. · `ai_module/src/main_launcher_t3.py`
- [Parser](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_parser/question_parser.py): intent router · Classifies the question and routes it to the appropriate solver. · `ai_module/src/question_parser/question_parser.py`
- [Gemini cls](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_parser/gemini_classifier.py): LLM classifier · Optional Gemini-backed question classification path. · `ai_module/src/question_parser/gemini_classifier.py`
- [Solver master](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/question_solver_master/question_solver.py): dispatch coordinator · Coordinates end-to-end solver selection and execution. · `ai_module/src/question_solver_master/question_solver.py`
- [Number solver](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t1_numerical_solver/t1_solver.py): task solver · Produces numerical answers for task 1. · `ai_module/src/t1_numerical_solver/t1_solver.py`
- [Object solver](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t2_selected_object_marker_solver/t2_solver.py): task solver · Selects the referenced object marker for task 2. · `ai_module/src/t2_selected_object_marker_solver/t2_solver.py`
- [Instr. solver](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/t3_solver.py): navigation solver · Instruction-following pipeline that produces waypoints for task 3. · `ai_module/src/t3_instruction_following_solver/t3_solver.py`
- [Alt T3](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_solver_sad/t3_solver_object_markers.py): legacy solver · Alternate or legacy object-marker/navigation solver variant. · `ai_module/src/t3_solver_sad/t3_solver_object_markers.py`
- [Object map](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/map/object_marker_collector.py): grounding store · Collects object markers and scene metadata for grounding. · `ai_module/src/map/object_marker_collector.py`
- [Navigator](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/navigator/planner.py): path planning · Grid creation, planning, and waypoint-following utilities. · `ai_module/src/navigator/planner.py`
- [VLM planner](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/vlm_planner.py): vision-language · Specialized planning logic for instruction-following navigation. · `ai_module/src/t3_instruction_following_solver/vlm_planner.py`
- [Pixel->WP](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/ai_module/src/t3_instruction_following_solver/pixel_to_waypoint_converter.py): coordinate bridge · Converts visual or semantic targets into robot waypoints. · `ai_module/src/t3_instruction_following_solver/pixel_to_waypoint_converter.py`

### Unity System

Unity-based simulator and autonomy stack.

- [Unity runtime](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/vehicle_simulator/src/vehicleSimulator.cpp): sim backend · Unity-based robot and simulator backend exposing the ROS challenge interface. · `system/unity/src/vehicle_simulator/src/vehicleSimulator.cpp`
- [Unity sensing](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/semantic_scan_generation/src/semanticScanGeneration.cpp): perception stack · Scan generation, segmentation, and terrain analysis for Unity. · `system/unity/src/semantic_scan_generation/src/semanticScanGeneration.cpp`
- [Unity nav](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/unity/src/local_planner/src/localPlanner.cpp): autonomy stack · Local planning and waypoint conversion in the Unity backend. · `system/unity/src/local_planner/src/localPlanner.cpp`

### Matterport System

Habitat/Matterport-based alternate autonomy stack.

- [Matterport runtime](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/vehicle_simulator/src/vehicleSimulator.cpp): sim backend · Habitat/Matterport3D-based alternate backend with the same AI contract. · `system/matterport/src/vehicle_simulator/src/vehicleSimulator.cpp`
- [Matterport sensing](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/semantic_scan_generation/src/semanticScanGeneration.cpp): perception stack · Scan generation, segmentation, and terrain analysis for Matterport. · `system/matterport/src/semantic_scan_generation/src/semanticScanGeneration.cpp`
- [Matterport nav](https://github.com/parths5/cmu-vla-challenge/blob/team-copypasta-submission/system/matterport/src/local_planner/src/localPlanner.cpp): autonomy stack · Local planning and waypoint conversion in the Matterport backend. · `system/matterport/src/local_planner/src/localPlanner.cpp`

## Connections

- Challenge Q → Main launcher: publish · Evaluator sends one natural-language question to the AI module.
- Challenge Q → T3 launcher: publish · Instruction-following track also receives the challenge question.
- Main launcher → Parser: route · Primary runtime enters question parsing and task routing.
- T3 launcher → Solver master: route · T3 runtime can bypass directly into the solver coordinator.
- Parser → Gemini cls: optional · Optional API-backed classifier may be used for intent detection.
- Parser → Solver master: dispatch · Parsed intent is handed to the solver coordinator.
- Solver master → Number solver: task 1 · Numerical questions are sent to the number solver.
- Solver master → Object solver: task 2 · Object-reference questions are sent to the object solver.
- Solver master → Instr. solver: task 3 · Instruction-following questions are sent to the navigation solver.
- Solver master → Alt T3: alt path · Legacy or alternate T3 handling can use the SAD solver variant.
- Object solver → Object map: ground · Object grounding uses collected scene markers and metadata.
- Number solver → Challenge Q: answer · Numerical answers are emitted on the evaluator-facing response topic.
- Object solver → Unity runtime: marker · Selected object markers are consumed by the autonomy backend.
- Object solver → Matterport runtime: marker · Matterport backend also consumes selected object markers.
- Instr. solver → VLM planner: plan · Vision-language reasoning generates navigation intent.
- VLM planner → Pixel->WP: convert · High-level spatial targets are converted into waypoints.
- Pixel->WP → Navigator: handoff · Waypoints enter shared planning/following utilities.
- Navigator → Unity nav: drive · Navigation utilities feed the Unity autonomy stack.
- Navigator → Matterport nav: drive · Navigation utilities feed the Matterport autonomy stack.
- Unity sensing → Unity runtime: sense · Unity sensing products support the simulator runtime.
- Matterport sensing → Matterport runtime: sense · Matterport sensing products support the simulator runtime.
- Questions → Solver master: dev data · Offline questions and trajectories inform solver development and validation.
