Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PM_CruisingStateManager follow_last_line_segment(line 389), follow_line_segment(line 355), next_waypoints(line 265) is where the math takes place. TODO figure out what they do and see why the math is not correct.

07-24

Added the below print statement to see what values were calculated (then realized that they are already printed😕 ) :

Code Block
languagecpp
std::cout << "Actual Track: " << out1.desiredTrack << "\n" << "Actual Altitude: " << out1.desiredAltitude << "\n" << "Actual distance to next waypoint: " << out1.distanceToNextWaypoint << "\n";
std::cout << "Desired Track: " << ans1.desiredTrack << "\n" << "Desired Altitude: " << ans1.desiredAltitude << "\n" << "Distance to next waypoint: " << ans1.distanceToNextWaypoint << "\n";

Results:

...

Since the DesiredTrack and DesiredAltitude are both 0, I think that the issue is just that they are never calculated but I can’t find the line that is not calculating. 😢 However I am going through the function calls and it seems that they are being called and performing calculations.

...

TODO: Do the math manually to see how the calculation is done (bruh i hate math)