mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-08-02 11:31:34 +00:00
Fixed differences between native and teensy, added getThrust() function to clean up thrustInfo()
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -36,14 +36,13 @@ void setup() {
|
||||
}
|
||||
#elif defined(TEENSY)
|
||||
void setup() {
|
||||
delay(1000);
|
||||
delay(5000);
|
||||
init_Vehicle(State);
|
||||
Serial.println("Simulated Vehicle Initalized");
|
||||
delay(1000);
|
||||
|
||||
// Determine when to burn
|
||||
burnStartTimeCalc(State);
|
||||
Serial.println(State.burnVelocity);
|
||||
Serial.println("Starting Height Calculated");
|
||||
delay(1000);
|
||||
loadCellCalibrate();
|
||||
@@ -65,10 +64,9 @@ void loop() {
|
||||
|
||||
// Set "prev" values for next timestep
|
||||
PrevState = State;
|
||||
|
||||
State.time += State.stepSize;
|
||||
|
||||
if (State.z < 0.0) {
|
||||
if ((State.z < 0.0) && (State.thrustFiring == 2)) {
|
||||
write2CSV(stateVector, State);
|
||||
printSimResults(State);
|
||||
init_Vehicle(State);
|
||||
@@ -90,14 +88,14 @@ void loop() {
|
||||
|
||||
State.time += State.stepSize;
|
||||
|
||||
if (State.z < 0.0) {
|
||||
if ((State.z < 0.0) && (State.thrustFiring == 2)) {
|
||||
printSimResults(State);
|
||||
init_Vehicle(State);
|
||||
delay(1000);
|
||||
Serial.println("Last run duration:" + String(millis() - last) + " ms");
|
||||
|
||||
closeFile();
|
||||
delay(10000);
|
||||
delay(20000);
|
||||
|
||||
Serial.println("Restarting Sim");
|
||||
Serial.println(
|
||||
@@ -113,7 +111,7 @@ int main() {
|
||||
|
||||
do {
|
||||
loop();
|
||||
} while ((State.z > 0.0));
|
||||
} while ((State.z > 0.0) || (State.thrustFiring != 2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user