Skip to content

Commit

Permalink
Changes the output of landingController to ArrayList<LanderObject
Browse files Browse the repository at this point in the history
  • Loading branch information
S010MON committed Jun 20, 2021
1 parent d3beece commit 61882f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/src/land/LandingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class LandingController
private final double DRAG_COEFFICIENT = 2.1; // page 1187, from https://pdfs.semanticscholar.org/5410/30f5b4c387a3d5d06fbee8549347d6bddf82.pdf
private final double AIR_DENSITY = 5.428; // https://www.aero.psu.edu/avia/pubs/LanSch17.pdf, page 3

public Vector3d[] plotTrajectory(Vector3d landerLocation,
public ArrayList<LanderObject> plotTrajectory(Vector3d landerLocation,
Vector3d landerVelocity,
double landerMass,
Vector3d planetLocation,
Expand All @@ -38,7 +38,7 @@ public Vector3d[] plotTrajectory(Vector3d landerLocation,
ODESolver solver = new Verlet();
ODEFunctionInterface f = new NewtonGravityFunction(masses);

ArrayList<Vector3d> trajectory = new ArrayList<Vector3d>();
ArrayList<LanderObject> trajectory = new ArrayList<LanderObject>();

Logger.logCSV("landing_controller", "Time,Pos X, Pos Y, Pos Z, Vel X, Vel Y, Vel Z");
double time = 0;
Expand All @@ -47,11 +47,11 @@ public Vector3d[] plotTrajectory(Vector3d landerLocation,
{
Logger.logCSV("landing_controller", time + "," + currentState.position.get(0).toCSV() + currentState.velocity.get(0).toCSV());
currentState = solver.step(f, time, currentState, stepSize);
trajectory.add(currentState.position.get(0));
trajectory.add(new LanderObject(currentState.position.get(0), 0));
time = time + stepSize;
}

return toArray(trajectory);
return trajectory;
}

/**
Expand Down

0 comments on commit 61882f5

Please sign in to comment.