1
0
mirror of https://gitlab.com/lander-team/lander-cpp.git synced 2025-06-16 15:17:23 +00:00

fixed burnVelocity tolerance condition

This commit is contained in:
Anson Biggs 2021-09-15 14:00:01 -07:00
parent 16d0ddc60b
commit 18e75925d5

View File

@ -87,12 +87,6 @@ void burnStartTimeCalc(struct sVars &Vars) {
}
void thrustSelection(struct sVars &Vars, int t) {
// TODO: Determine a real tolerance
double tol = 0.001; // 0.001 seems to be a nice tolerance
// Check to see if current velocity is close to the F15's total velocity
bool b_burnStart = (Vars.burnVelocity < (1 + tol) * Vars.vz * -1) &
(Vars.burnVelocity > (1 - tol) * Vars.vz * -1);
if (Vars.burnElapsed != 2000) {
// determine where in the thrust curve we're at based on elapsed burn time
@ -101,7 +95,7 @@ void thrustSelection(struct sVars &Vars, int t) {
Vars.mass = Vars.massInitial - (Vars.mdot * Vars.burnElapsed);
}
else if (b_burnStart) {
else if (abs(Vars.burnVelocity - Vars.vz) < .001) {
// Start burn
Vars.burnStart = t;
Vars.burnElapsed = 0;