mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-23 14:41:25 +00:00
fixed burnVelocity tolerance condition
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user