Conversation
lib/src/rover/orchestrator.dart
Outdated
| } | ||
| currentState = AutonomyState.DRIVING; | ||
| var count = 0; | ||
| // var count = 0; |
There was a problem hiding this comment.
This was good because it catches small drifts in the GPS and IMU, allowing us to be more lenient about errors in everything. Maybe let's keep it and try removing it later when we do more physical tests
There was a problem hiding this comment.
Maybe instead of replanning after a set amount of steps, have it check after each step is completed if it has drifted too far and replan?
There was a problem hiding this comment.
Planning is very cheap -- not noticeable during operation. If there is no drift, the new plan == the old plan. So this is pretty much just as efficient as that, without the extra logic
There was a problem hiding this comment.
Doesn't replanning stop the rover suddenly? I'd rather not replan if it will cause a visible hiccup
There was a problem hiding this comment.
Not if we move faceNorth outside the while loop, Then there is no stop command and the re-planning will happen while the rover is still executing/finishing the last command. Technically there is a very slight delay but we're still unsure exactly what accuracy we will end up having. Keep in mind that we still don't have RTK so our GPS will have significant error.
Co-authored-by: Binghamton Rover <rover@binghamton.edu> Co-authored-by: Levi Lesches <levilesches@gmail.com>
lib/src/utils/gps_utils.dart
Outdated
| GpsCoordinates goForward(CardinalDirection orientation) => this + switch(orientation) { | ||
| CardinalDirection.north => GpsUtils.north, | ||
| CardinalDirection.south => GpsUtils.south, | ||
| CardinalDirection.west => GpsUtils.west, | ||
| CardinalDirection.east => GpsUtils.east, | ||
| CardinalDirection.northEast => GpsUtils.northEast, | ||
| CardinalDirection.northWest => GpsUtils.northWest, | ||
| CardinalDirection.southEast => GpsUtils.southEast, | ||
| CardinalDirection.southWest => GpsUtils.southWest, | ||
| }; |
There was a problem hiding this comment.
We can make this a field on CardinalDirection, so that this becomes:
GpsCoordinates goForward(CardinalDirection direction) => this + direction.gpsOffset;- Clamp all angles from -180 to 180 - Face the correct direction before driving forward Tested with sim GPS and real IMU*
- Replan if the rover is too far from the path - Add a maximum time for the rover to drive forward 1 step
- The directions don't need to be getters anymore
No description provided.