Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of prediction info to determine ground level. #302

Open
darksidelemm opened this issue Oct 28, 2023 · 2 comments
Open

Make use of prediction info to determine ground level. #302

darksidelemm opened this issue Oct 28, 2023 · 2 comments

Comments

@darksidelemm
Copy link
Member

Currently we have some code which decides if a payload has 'landed', and it makes some not brilliant assumptions about what ground level is (refer 'The Colorado Problem'). Ideally we'd be comparing against terrain information, but that would require a lot of Ruaumoko API polls.

However, whenever a prediction is run in Tawhiri (which has direct access to the ruaumoko terrain dataset), it terminates the prediction at ground level. Therefore, the last point in any prediction we get will be ground level in the landing area.

We could extract this ground level altitude and store it, and use that to decide if the payload has landed!

@darksidelemm
Copy link
Member Author

darksidelemm commented Oct 28, 2023

This change will need to be made in updateVehicleInfo function, in sondehub.js

@TheSkorm
Copy link
Member

Something like this might work however since predictions come through websockets this won't work on refresh after predictions have stopped for a sonde

    if (vehicle.prediction_target && vehicle.prediction_target.pdata && vehicle.prediction_target.alt){
        var landing_check_alt_idle = vehicle.prediction_target.alt + 300
        var landing_check_alt = vehicle.prediction_target.alt + 100
    } else {
        var landing_check_alt_idle = 600
        var landing_check_alt = 350
    }
    var landed = (
                     vehicle.max_alt > 1500 &&      // if it has gone up
                     vehicle.ascent_rate < 1.0 &&   // and has negative ascent_rate, aka is descending
                     newPosition.gps_alt < landing_check_alt      // and is under 350 meters altitude
                 ) || (                             // or
                     newPosition.gps_alt < landing_check_alt_idle &&   // under 600m and has no position update for more than 30 minutes
                     (new Date().getTime() - newPosition.gps_timestamp) > 1800000
                 );

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

No branches or pull requests

2 participants