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

addressed in gitlab issues

This commit is contained in:
Anson Biggs 2021-09-15 14:46:17 -07:00
parent 18e75925d5
commit a8019c6dc8
2 changed files with 4 additions and 11 deletions

View File

@ -48,8 +48,7 @@ void sim(struct sVars &Vars) {
lqrCalc(Vars);
TVC(Vars);
vehicleDynamics(Vars, t);
write2CSV(Vars, outfile,
t); // TODO: Need to append to memory instead of writing each step
write2CSV(Vars, outfile, t);
}
outfile.close();
@ -101,7 +100,7 @@ void thrustSelection(struct sVars &Vars, int t) {
Vars.burnElapsed = 0;
}
else // TODO: Make this not arbitrary
else
Vars.burnElapsed = 2000; // arbitrary number to ensure we don't burn
if ((Vars.burnElapsed > 0.147) && (Vars.burnElapsed < 0.420))
@ -217,7 +216,7 @@ void TVC(struct sVars &Vars) {
void vehicleDynamics(struct sVars &Vars, int t) {
// Idot
if (t < 1) { // TODO: Initial conditions should be set at sim start
if (t < 1) {
Vars.I11dot = 0;
Vars.I22dot = 0;
Vars.I33dot = 0;
@ -241,7 +240,7 @@ void vehicleDynamics(struct sVars &Vars, int t) {
Vars.I22 * Vars.pitchdot * Vars.yawdot) /
Vars.I33;
if (t < 1) { // TODO: Initial conditions should be set at sim start
if (t < 1) {
Vars.x = 0;
Vars.y = 0;
@ -289,10 +288,6 @@ void vehicleDynamics(struct sVars &Vars, int t) {
Vars.roll = integral(Vars.psidot, Vars.rollPrev, Vars.stepSize);
}
// TODO: Maybe we should just have a `Vars` for the last time step and at the
// end of each time step make a copy of it
// TODO: Delete, section not needed
// Set "prev" values for next timestep
Vars.I11prev = Vars.I11;
Vars.I22prev = Vars.I22;
@ -372,7 +367,6 @@ void write2CSV(struct sVars &Vars, std::fstream &outfile, int t) {
}
double derivative(double x2, double x1, double dt) {
// TODO: is 1000 arbitrary?
double dxdt = (x2 - x1) / (dt / 1000);
return dxdt;
}

View File

@ -38,7 +38,6 @@ int main() {
Vars.momentArm = 0.145; // [m]
// Sim Step Size
// TODO: use dt instead?
Vars.stepSize = 1; // [ms]
// Other Properties