abort method
Forces the rover to go back to the previous waypoint.
Implementation
Future<void> abort() async {
_handshake = null;
isLoading = true;
notifyListeners();
final message = AutonomyCommand(abort: true);
// x3 just in case
models.sockets.autonomy.sendMessage(message);
models.sockets.autonomy.sendMessage(message);
models.sockets.autonomy.sendMessage(message);
models.home.setMessage(severity: Severity.info, text: "Aborting...");
await Future<void>.delayed(const Duration(seconds: 1));
if (_handshake != null) {
models.home.setMessage(severity: Severity.info, text: "Command received");
} else {
models.home.setMessage(severity: Severity.critical, text: "Command not received");
}
isLoading = false;
notifyListeners();
}