Skip to content

Conversation

@MateoLostanlen
Copy link
Member

@MateoLostanlen MateoLostanlen commented Sep 25, 2025

For the past few months we have been able to localize fires through triangulation. Until now this code has been running on the platform, but I propose to migrate it to the API because (1) it makes more sense and (2) its migration to the new platform would otherwise be quite complex

The code works as follows:

For all sequences, if they overlap in time and if their detection cones intersect, they potentially represent the same event (Phase 1 in the code)

Once we have candidates, we filter triangulations with more than 2 detections. Since our azimuth estimation is not very precise, 3 sequences may represent the same alert without forming a strict triple intersection (see example image). In this case, we use Phase 2 to accept these triple triangulations within a margin distance

Screenshot 2025-09-26 at 09 08 07

@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.67%. Comparing base (9cba4af) to head (6872a90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
+ Coverage   84.07%   93.67%   +9.59%     
==========================================
  Files          39        3      -36     
  Lines        1212       79    -1133     
==========================================
- Hits         1019       74     -945     
+ Misses        193        5     -188     
Flag Coverage Δ
backend ?
client 93.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frgfm
Copy link
Member

frgfm commented Sep 26, 2025

Thanks!
Feature-wise

  • I agree this should be done on the backend because this is the only entity that receives all detections + has access to history.
  • For this reason, I think we should run the code as a background tasks after a detection is created if some conditions are met :) (more or so, we a camera position is set, we should be able to know if its point of view can intersect any other)

Product-wise
I think this is also the time to consider all general cases for the near future.
Events we'll likely have:

  • automatic detection from our camera with only a picture + azimuth + range
  • user pinpointing a location (seeing the picture and knowing the location, they can confidently say the visible part of the fire is near GPS coordinate XYZ)
    Callback/background:
  • this triangulation for automatic detection
  • modification of the location by the user
    We'll have a very solid product + roadmap if we can handle all those

Code-wise: can you elaborate on the changes you made to facilitate the review? :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants