Commit c0c9aa73 authored by Julian Zobel's avatar Julian Zobel
Browse files

Fixed a bug, where a UAV would not crash if hovering and the battery runs out.

parent 125d6756
...@@ -190,7 +190,7 @@ public class MulticopterMovement implements UAVMovementModel { ...@@ -190,7 +190,7 @@ public class MulticopterMovement implements UAVMovementModel {
else if(motor.isOn()) { else if(motor.isOn()) {
if(velocity != 0) { if(velocity != 0) {
throw new UnsupportedOperationException("no route but speed not 0?"); throw new UnsupportedOperationException("[MulticopterMovement] no route but speed not 0?");
} }
PositionVector position = new PositionVector(topologyComponent.getRealPosition()); PositionVector position = new PositionVector(topologyComponent.getRealPosition());
...@@ -201,6 +201,8 @@ public class MulticopterMovement implements UAVMovementModel { ...@@ -201,6 +201,8 @@ public class MulticopterMovement implements UAVMovementModel {
else { else {
motor.requestThrust(hoverThrustRequired()); motor.requestThrust(hoverThrustRequired());
} }
topologyComponent.updateCurrentLocation(position);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment