Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
c0c9aa73
Commit
c0c9aa73
authored
Nov 13, 2020
by
Julian Zobel
Browse files
Fixed a bug, where a UAV would not crash if hovering and the battery runs out.
parent
125d6756
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/aerial/MulticopterMovement.java
View file @
c0c9aa73
...
@@ -190,9 +190,9 @@ public class MulticopterMovement implements UAVMovementModel {
...
@@ -190,9 +190,9 @@ 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
());
if
(
position
.
getAltitude
()
==
0
)
{
if
(
position
.
getAltitude
()
==
0
)
{
...
@@ -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
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment