How rithwik-dudala/trajnex-26037 works
Trajnex is an autonomous-driving planning and collision-avoidance stack for unstructured Indian roads. Its principal workflow ingests a scenario or sensor frame, detects road users and drivable space, tracks and predicts motion, estimates uncertainty and dynamic risk, plans a route and local maneuver, then makes a driving decision and control command within simulation. It also supports video inference and an interactive dashboard. The README documents the major stage relationships; source excerpts and the index clarify component responsibilities, but do not expose every runtime call.
Main entry points: closed_loop_simulator.py Closed-Loop Simulator · byte_track.py Multi-Object Tracking · app.py Interactive Dashboard · scenario_runner.py Scenario Evaluation
Components 22
Data and Scenarios
- IDD Classes
data/idd_classes.py - Road Scenarios
data/scenarios.py - IDD Loader
data/idd_loader.py
Perception and Prediction
- Object Detector
perception/detector.py - Drivable Area
perception/drivable_area_seg.py - Multi-Object Tracking
tracking/byte_track.py - Kalman Prediction
prediction/kalman_predictor.py - LSTM Prediction
prediction/lstm_predictor.py - Uncertainty Estimation
uncertainty/uncertainty_estimator.py - Video Pipeline
perception/video_pipeline.py
Risk and Planning
- Dynamic Risk Field
risk_field/dynamic_risk_field.py - Hybrid A*
planning/hybrid_astar.py - DWA Planner
planning/dwa_local_planner.py - MPC Planner
planning/mpc_local_planner.py
Decision and Control
- Decision FSM
control/decision_fsm.py - Vehicle Controllers
control/vehicle_controller.py
Simulation and Viewing
- Closed-Loop Simulator
simulation/closed_loop_simulator.py - Realtime Simulator
simulation/realtime_simulator.py - Scenario Evaluation
simulation/scenario_runner.py - 2D Renderer
visualization/render_2d.py - Interactive Dashboard
visualization/app.py
Other components
- Engineer
Connections 27
- Road Scenarios → Closed-Loop Simulator: supplies scenarios
README.md - Closed-Loop Simulator → Object Detector: detects objects
README.md - Closed-Loop Simulator → Drivable Area: builds drivable mask
README.md - Object Detector → Multi-Object Tracking: provides detections
README.md - Multi-Object Tracking → Kalman Prediction: provides tracks
README.md - Multi-Object Tracking → LSTM Prediction: provides tracks
README.md - Closed-Loop Simulator → Kalman Prediction: predicts motion
README.md - Closed-Loop Simulator → LSTM Prediction: predicts motion
README.md - Closed-Loop Simulator → Uncertainty Estimation: estimates uncertainty
README.md - Closed-Loop Simulator → Dynamic Risk Field: computes risk
README.md - Drivable Area → Dynamic Risk Field: sets boundaries
risk_field/dynamic_risk_field.py - Closed-Loop Simulator → Hybrid A*: plans global path
README.md - Closed-Loop Simulator → DWA Planner: plans local path
README.md - Dynamic Risk Field → DWA Planner: scores trajectories
planning/dwa_local_planner.py - Closed-Loop Simulator → Decision FSM: selects action
README.md - Closed-Loop Simulator → Vehicle Controllers: computes controls
README.md - Closed-Loop Simulator → Road Scenarios: reads scenario
simulation/closed_loop_simulator.py - Scenario Evaluation → Closed-Loop Simulator: runs scenarios
simulation/scenario_runner.py - Scenario Evaluation → Road Scenarios: selects benchmarks
simulation/scenario_runner.py - Engineer → Interactive Dashboard: uses dashboard
README.md - Interactive Dashboard → Closed-Loop Simulator: runs simulation
visualization/app.py - Interactive Dashboard → Video Pipeline: opens video workflow
visualization/app.py - Engineer → Video Pipeline: submits video
README.md - IDD Loader → Video Pipeline: supplies IDD frames
- Closed-Loop Simulator → 2D Renderer: renders results
run_simulation.py - Engineer → Scenario Evaluation: starts benchmarks
README.md - IDD Classes → Object Detector: defines road-user classes
perception/detector.py