How difluoroethane/clew_idr works
CLEW-IDR is a phone/edge GNSS-denied vehicle-navigation engine. Its documented runtime flow calibrates and preprocesses sensor streams, estimates motion and adaptive constraints with a shared multi-task encoder, fuses measurements in a UKF, applies road/lane map matching and GNSS-state logic, then emits navigation state. The sampled pipeline confirms model-to-UKF and UKF-to-matcher calls; several calibration, state-machine, and deployment links are documented in the README but not shown in sampled implementation excerpts.
Main entry points: pipeline.py Pipeline step · shared_encoder.py Multi-task model · hmm.py HMM matcher · ukf.py 15-state UKF
Components 26
Input and preprocessing
- Dynamic calibration
src - Window preparation
src/preprocessing/pipeline.py - Stream schema
src/preprocessing/schema.py - Dataset loader
src/preprocessing/loader.py
Learned estimation
- Multi-task model
src/models/shared_encoder.py - Causal TCN
src/models/tcn.py - Speed estimate
src/models/heads.py - Adaptive noise
src/filters/adaptive_noise.py
Navigation fusion
- 15-state UKF
src/filters/ukf.py - Inertial mechanization
src/filters/mechanization.py - Motion constraints
src/filters/constraints.py - Barometer updates
src/barometer.py
Road constraints
- OpenStreetMap roads
src/maps/osm_loader.py - Road graph
src/maps/road_graph.py - Road candidates
src/maps/map_match.py - HMM matcher
src/maps/hmm.py - Trajectory matcher
src/maps/hmm_match.py - Lateral deviation
src/maps/lateral_deviation.py
State and output
- GNSS state machine
src/statemachine/gnss_deficit.py - Lane-index tracker
src/maps - Pipeline step
src/pipeline.py - Navigation state
src/pipeline.py
Other components
- Phone sensors
- External IMU
- Mobile application
- Edge engine
Connections 29
- Phone sensors → Dynamic calibration: supplies sensors
README.md - External IMU → Dynamic calibration: supplies IMU
README.md - Dynamic calibration → Window preparation: corrects samples
README.md - Dataset loader → Stream schema: maps columns
src/preprocessing/loader.py - Window preparation → Multi-task model: forms windows
README.md - Multi-task model → Causal TCN: uses blocks
src/models/shared_encoder.py - Multi-task model → Speed estimate: produces heads
README.md - Pipeline step → Multi-task model: infers outputs
src/pipeline.py - Pipeline step → 15-state UKF: predicts and updates
src/pipeline.py - Pipeline step → Adaptive noise: applies multipliers
src/pipeline.py - Pipeline step → HMM matcher: matches position
src/pipeline.py - 15-state UKF → Inertial mechanization: integrates motion
- 15-state UKF → Motion constraints: applies constraints
- Phone sensors → 15-state UKF: provides measurements
README.md - Phone sensors → Barometer updates: provides pressure
README.md - Barometer updates → Pipeline step: passes altitude
src/pipeline.py - OpenStreetMap roads → Road graph: builds network
src/maps/road_graph.py - Road graph → Road candidates: queries edges
src/maps/map_match.py - Road candidates → Trajectory matcher: supplies candidates
src/maps/hmm_match.py - Trajectory matcher → Road graph: reads connectivity
src/maps/hmm_match.py - HMM matcher → Lateral deviation: computes emissions
src/maps/hmm.py - HMM matcher → Road candidates: uses candidates
src/maps/hmm.py - HMM matcher → GNSS state machine: provides match confidence
README.md - Multi-task model → GNSS state machine: provides motion flags
README.md - Multi-task model → Lane-index tracker: provides lane events
README.md - GNSS state machine → Pipeline step: selects navigation mode
README.md - Pipeline step → Navigation state: returns state
src/pipeline.py - Navigation state → Mobile application: drives output
README.md - Navigation state → Edge engine: drives output
README.md