UBCSailbot / raye-global-pathfinding

UBC Sailbot's Global Pathfinding Repository: A* pathfinding that creates sailing paths with minimized length and desirable wind speeds throughout.
MIT License
5 stars 1 forks source link

Pathfinding ensure works with +ve and -ve latlons #37

Closed tylerlum closed 3 years ago

tylerlum commented 3 years ago

Longitudes can either be in [0, 360) or [-180, 180). Our code should be able to handle both. Make sure that the path and the wind go in the "right direction' (not on the other side of the earth).

Currently negative numbers do not work because of argument syntax. Need to fix this to ensure it works.

Try out all permutations of:

./build/bin/pathfinder_cli -p 8 --navigate 48 235 21 203
./build/bin/pathfinder_cli -p 8 --navigate 48 -125 21 203
./build/bin/pathfinder_cli -p 8 --navigate 48 235 21 -157
./build/bin/pathfinder_cli -p 8 --navigate 48 -125 21 -157

Make sure that pathfinding does not segfault in all situations. Make sure they all make the same path. Make sure that the wind.kml received is the same each time (not on other side of the world)

tylerlum commented 3 years ago

More specific task: make sure this works for whatever the satellite could possibly give us, never segfault with valid inputs.

tylerlum commented 3 years ago

This will be addressed by Kieran's bash script that will ensure it is always passed +ve latons. Will close this issue when that PR is merged in.

tylerlum commented 3 years ago

Addressed by #49

    if (pointToPrint == countPoints) {      latToPrint = lat_str;      lonToPrint = std::stod(lon_str) < 0 ? std::to_string(360 + std::stod(lon_str)) : lon_str;    }

Bash script start with +ve values and this change ensures all output values are positive as well. As long as we keep all positives at all times, this issue will not arise.