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
615845e5
Commit
615845e5
authored
Apr 25, 2019
by
Julian Zobel
Browse files
Get the base location also to application layer
parent
e425f862
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/api/topology/component/ControllableLocationActuator.java
View file @
615845e5
...
...
@@ -51,6 +51,8 @@ public interface ControllableLocationActuator extends Actuator {
public
PositionVector
getCurrentDirection
();
public
PositionVector
getBaseLocation
();
public
void
updateCurrentDirection
(
PositionVector
direction
);
public
double
getCurrentBatteryLevel
();
...
...
src/de/tud/kom/p2psim/impl/topology/component/UAVTopologyComponent.java
View file @
615845e5
...
...
@@ -346,6 +346,11 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
return
movement
.
estimatePowerConsumption
(
velocity
);
}
@Override
public
PositionVector
getBaseLocation
()
{
return
baseLocation
.
clone
();
}
}
src/de/tud/kom/p2psim/impl/topology/movement/aerial/SimpleMulticopterMovement.java
View file @
615845e5
...
...
@@ -353,17 +353,13 @@ public class SimpleMulticopterMovement implements UAVMovementModel {
else
if
(
velocity
<
minimumHorizontalVelocity
())
{
return
-
1
;
}
else
{
// System.out.println("===========================");
else
{
double
estimateAngle
=
estimatePitchAngleForVelocity
(
velocity
);
double
estimatedDrag
=
forwardDrag
(
velocity
,
estimateAngle
);
double
requiredThrust
=
Math
.
sqrt
(
hoverThrustRequired
()
*
hoverThrustRequired
()
+
estimatedDrag
*
estimatedDrag
);
double
wattage
=
motor
.
estimatePowerConsumptionWatt
(
requiredThrust
);
// System.out.println("Motor requires " + wattage + " J/s at velocity " + velocity + " (Thrust: " + requiredThrust + " N, angle = " + Math.toDegrees(estimateAngle) + ", drag = "+ estimatedDrag+" N )");
return
wattage
;
}
...
...
@@ -440,21 +436,10 @@ public class SimpleMulticopterMovement implements UAVMovementModel {
nearest
=
d
;
}
}
// double n = Math.sqrt(2 * hoverThrustRequired() * Math.tan(Math.toRadians(nearest)) / bodyDrag(Math.toRadians(nearest), new PositionVector(1,0,0)));
//System.out.println("target velocity = " + velocity + " m/s ==> AoA = " + nearest + "° // v_max = " + n + " m/s");
return
Math
.
toRadians
(
nearest
);
}
return
maxPitchAngle
;
}
return
maxPitchAngle
;
}
}
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