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

Added minimum horizontal and vertical speed setters for the simple movement.

parent 4c53019c
......@@ -29,10 +29,7 @@ import de.tud.kom.p2psim.impl.energy.components.ActuatorComponent;
import de.tud.kom.p2psim.impl.energy.components.StatefulActuatorComponent;
import de.tud.kom.p2psim.impl.topology.component.UAVTopologyComponent;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.Host;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.HostComponent;
import de.tudarmstadt.maki.simonstrator.api.component.HostComponentFactory;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.ReachedLocationCallback;
/**
......@@ -52,16 +49,22 @@ public class SimpleMulticopterMovement implements UAVMovementModel {
private double maximumHorizontalVelocity;
private double maximumVerticalVelocity;
// TODO currently not used
private double minimumHorizontalVelocity;
private double minimumVerticalVelocity;
private LinkedList<PositionVector> route = new LinkedList<>();
private Map<PositionVector, ReachedLocationCallback> locationCallbacks = new LinkedHashMap<>();
private StatefulActuatorComponent motor;
public SimpleMulticopterMovement(UAVTopologyComponent topologyComponent, double maximumHorizontalVelocity,
double maximumVerticalVelocity) {
double maximumVerticalVelocity, double minimumHorizontalVelocity, double minimumVerticalVelocity) {
this.topologyComponent = topologyComponent;
this.maximumHorizontalVelocity = maximumHorizontalVelocity;
this.maximumVerticalVelocity = maximumVerticalVelocity;
this.minimumHorizontalVelocity = minimumHorizontalVelocity;
this.minimumVerticalVelocity = minimumVerticalVelocity;
}
@Override
......@@ -238,8 +241,21 @@ public class SimpleMulticopterMovement implements UAVMovementModel {
this.maximumVerticalVelocity = maximumVerticalVelocity;
}
private double minimumHorizontalVelocity = 15;
public void setMinimumHorizontalVelocity(double minimumHorizontalVelocity) {
this.minimumHorizontalVelocity = minimumHorizontalVelocity;
}
private double minimumVerticalVelocity = 5;
public void setMinimumVerticalVelocity(double minimumVerticalVelocity) {
this.minimumVerticalVelocity = minimumVerticalVelocity;
}
public UAVMovementModel createComponent(UAVTopologyComponent topologyComponent) {
return new SimpleMulticopterMovement(topologyComponent, maximumHorizontalVelocity, maximumVerticalVelocity);
return new SimpleMulticopterMovement(topologyComponent, maximumHorizontalVelocity,
maximumVerticalVelocity, minimumHorizontalVelocity, minimumVerticalVelocity);
}
}
}
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