Wait to do TUMBLE processing until actual TUMBLE event is removed from queue
Run TARC payloader simulation and save new simulation data. I compared our simulation data with an on-line descent rate calculator at https://descentratecalculator.onlinetesting.net/ and saw that the results are well within 1 fps of each other.
This commit is contained in:
parent
986b485cf6
commit
2c8c29c46d
@ -221,25 +221,16 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
// and thrust < THRUST_TUMBLE_CONDITION threshold
|
// and thrust < THRUST_TUMBLE_CONDITION threshold
|
||||||
|
|
||||||
if (!currentStatus.isTumbling()) {
|
if (!currentStatus.isTumbling()) {
|
||||||
final double t = currentStatus.getFlightData().getLast(FlightDataType.TYPE_THRUST_FORCE);
|
|
||||||
final double cp = currentStatus.getFlightData().getLast(FlightDataType.TYPE_CP_LOCATION);
|
final double cp = currentStatus.getFlightData().getLast(FlightDataType.TYPE_CP_LOCATION);
|
||||||
final double cg = currentStatus.getFlightData().getLast(FlightDataType.TYPE_CG_LOCATION);
|
final double cg = currentStatus.getFlightData().getLast(FlightDataType.TYPE_CG_LOCATION);
|
||||||
final double aoa = currentStatus.getFlightData().getLast(FlightDataType.TYPE_AOA);
|
final double aoa = currentStatus.getFlightData().getLast(FlightDataType.TYPE_AOA);
|
||||||
|
|
||||||
final boolean wantToTumble = (cg > cp && aoa > AOA_TUMBLE_CONDITION);
|
final boolean wantToTumble = (cg > cp && aoa > AOA_TUMBLE_CONDITION);
|
||||||
|
final boolean isSustainer = currentStatus.getConfiguration().isStageActive(0);
|
||||||
if (wantToTumble) {
|
final boolean isApogee = currentStatus.isApogeeReached();
|
||||||
final boolean tooMuchThrust = t > THRUST_TUMBLE_CONDITION;
|
if (wantToTumble && (isApogee || !isSustainer)) {
|
||||||
final boolean isSustainer = currentStatus.getConfiguration().isStageActive(0);
|
addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, currentStatus.getSimulationTime()));
|
||||||
final boolean isApogee = currentStatus.isApogeeReached();
|
}
|
||||||
if (tooMuchThrust) {
|
|
||||||
currentStatus.getWarnings().add(Warning.TUMBLE_UNDER_THRUST);
|
|
||||||
} else if (isApogee || !isSustainer) {
|
|
||||||
addEvent(new FlightEvent(FlightEvent.Type.TUMBLE, currentStatus.getSimulationTime()));
|
|
||||||
currentStatus.setTumbling(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If I'm on the ground and have no events in the queue, I'm done
|
// If I'm on the ground and have no events in the queue, I'm done
|
||||||
@ -535,6 +526,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
|
|
||||||
currentStatus.getFlightData().addEvent(event);
|
currentStatus.getFlightData().addEvent(event);
|
||||||
}
|
}
|
||||||
|
log.debug("deployed recovery devices: " + currentStatus.getDeployedRecoveryDevices().size() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GROUND_HIT:
|
case GROUND_HIT:
|
||||||
@ -556,10 +548,19 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TUMBLE:
|
case TUMBLE:
|
||||||
if (!currentStatus.isLanded()) {
|
// Inhibit if we've deployed a parachute or we're on the ground
|
||||||
currentStepper = tumbleStepper;
|
if ((currentStatus.getDeployedRecoveryDevices().size() > 0) || currentStatus.isLanded())
|
||||||
currentStatus = currentStepper.initialize(currentStatus);
|
break;
|
||||||
}
|
|
||||||
|
currentStepper = tumbleStepper;
|
||||||
|
currentStatus = currentStepper.initialize(currentStatus);
|
||||||
|
|
||||||
|
final boolean tooMuchThrust = currentStatus.getFlightData().getLast(FlightDataType.TYPE_THRUST_FORCE) > THRUST_TUMBLE_CONDITION;
|
||||||
|
if (tooMuchThrust) {
|
||||||
|
currentStatus.getWarnings().add(Warning.TUMBLE_UNDER_THRUST);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentStatus.setTumbling(true);
|
||||||
currentStatus.getFlightData().addEvent(event);
|
currentStatus.getFlightData().addEvent(event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user