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
4c8daf00
Commit
4c8daf00
authored
Jan 21, 2021
by
Julian Zobel
Browse files
Added optimal speed approximation to UAV movement models
parent
104224ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/api/topology/component/ControllableLocationActuator.java
View file @
4c8daf00
...
...
@@ -90,4 +90,6 @@ public interface ControllableLocationActuator extends Actuator {
public
double
estimatePowerConsumptionWatt
(
double
velocity
);
public
double
estimateFlightDistance
(
double
velocity
,
double
batterylevel
,
double
batterythreshold
);
public
double
estimateOptimalSpeed
();
}
src/de/tud/kom/p2psim/api/topology/movement/UAVMovementModel.java
View file @
4c8daf00
...
...
@@ -57,6 +57,7 @@ public interface UAVMovementModel {
* @return The power consumption in W for the given velocity.
*/
public
double
estimatePowerConsumptionWatt
(
double
velocity
);
public
double
estimateOptimalSpeed
();
public
void
move
(
long
timeBetweenMovementOperations
);
...
...
src/de/tud/kom/p2psim/impl/topology/component/UAVTopologyComponent.java
View file @
4c8daf00
...
...
@@ -106,7 +106,7 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
}
// retrieve base location
baseLocation
=
UAVBasePlacement
.
base
.
position
.
clone
();
baseLocation
=
UAVBasePlacement
.
base
.
position
.
clone
();
}
public
void
setState
(
UAVstate
newState
)
{
...
...
@@ -365,6 +365,10 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
return
distance
;
}
public
double
estimateOptimalSpeed
()
{
return
movement
.
estimateOptimalSpeed
();
}
@Override
public
PositionVector
getBaseLocation
()
{
return
baseLocation
.
clone
();
...
...
src/de/tud/kom/p2psim/impl/topology/movement/aerial/MulticopterMovement.java
View file @
4c8daf00
...
...
@@ -70,6 +70,8 @@ public class MulticopterMovement implements UAVMovementModel {
private
double
maximumPitchAngleAllowed
;
// ° max angle
private
double
maximumDecentVelocityAllowed
;
// m/s
private
double
optimalVelocity
=
-
1
;
// TODO currently not used
private
double
maximumTurnAngle
;
// 90° per second turn angle
...
...
@@ -573,4 +575,33 @@ public class MulticopterMovement implements UAVMovementModel {
}
@Override
public
double
estimateOptimalSpeed
()
{
if
(
optimalVelocity
==
-
1
)
{
double
MIN
=
Double
.
MAX_VALUE
;
double
opt
=
-
1
;
double
min
=
getHorizontalMinVelocity
();
double
max
=
getHorizontalMaxVelocity
();
int
steps
=
50
;
double
stepsize
=
(
max
-
min
)
/
steps
;
for
(
int
i
=
0
;
i
<
steps
;
i
++)
{
double
speed
=
min
+
i
*
stepsize
;
double
energyPerMeter
=
estimatePowerConsumptionWatt
(
speed
)
/
speed
;
if
(
energyPerMeter
<
MIN
)
{
MIN
=
energyPerMeter
;
opt
=
speed
;
}
}
optimalVelocity
=
opt
;
}
return
optimalVelocity
;
}
}
src/de/tud/kom/p2psim/impl/topology/movement/aerial/SimpleMulticopterMovement.java
View file @
4c8daf00
...
...
@@ -258,4 +258,9 @@ public class SimpleMulticopterMovement implements UAVMovementModel {
maximumVerticalVelocity
,
minimumHorizontalVelocity
,
minimumVerticalVelocity
);
}
}
@Override
public
double
estimateOptimalSpeed
()
{
return
maximumHorizontalVelocity
;
}
}
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