Skip to content

feat: add GPS-based road speed and avoidance learning - #35

Open
agrawalmilin9 wants to merge 3 commits into
wncc:mainfrom
agrawalmilin9:feat/gps-road-learning
Open

agrawalmilin9 wants to merge 3 commits into
wncc:mainfrom
agrawalmilin9:feat/gps-road-learning

Conversation

@agrawalmilin9

Copy link
Copy Markdown

Summary

Implements GPS-based road learning using driver location data.

Closes #23

Changes

  • Added GPS map matching and road-speed sample extraction.
  • Added detection of followed and avoided road segments.
  • Added validation to reduce false avoidance detection caused by GPS gaps.
  • Added a background GPS learning worker.
  • Added database models and Alembic migrations for GPS learning data.
  • Saved planned routes for pickup and trip phases.
  • Added GPS learning preview functionality and automated tests.

Testing

  • Backend: 46 tests passed.
  • Routing: 110 tests passed, 16 subtests passed.
  • GPS detour integration test: passed using synthetic GPS coordinates without mocking map matching.
  • Database migrations: verified at latest revision.
  • Git diff checks: passed.

Notes

GPS learning is disabled by default and can be enabled using RUN_GPS_LEARNING_LOOP=true.

@aom12345

Copy link
Copy Markdown
Collaborator

This conflicts with main after #30. Please drop your own alembic.ini and migrations/ and add your migration under backend/migrations. It also doesn't yet deliver the issue: the learned data is never applied to the router (the test asserts refresh_telemetry isn't called), and the ROAD_LEARNING.md section is missing. Performance and correctness: nearest_segment scans every edge per ping on the event loop, so please add a spatial index and use asyncio.to_thread. Skipped or failed rides are never marked processed and starve newer ones. Speeds read up to 25% high because the full segment length is divided by a shorter time span. Planned-route computation runs even with the learning flag off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feed real driver GPS into road learning (slow and avoided roads)

3 participants