pathfinder-for-autonomous-navigation / psim

Six DOF flight simulator and related GNC implementations.
MIT License
4 stars 6 forks source link

C++ orbit class #176

Closed nhz2 closed 4 years ago

nhz2 commented 4 years ago

Orbit class

Interface with flight software

I plan on using Orbit class as a state field in the orbit estimation control tasks. Also the best estimate of the satellites current orbit will have to be downlinked and sent to the other satellite. This hasn't been fully implemented yet, currently the Orbit class just has a position velocity and time, and can be propagated for short updates. Right now it isn't used in the rest of flight software.

Summary of changes

The goal is to create a class to handle most of the logic related to storing, serializing, propagating, and checking validity of an orbit. This class will be used by the next version of the orbit estimator. Another goal is to specify, control, and minimize the number of calls to the gravity function, because one call could take about 2ms on a teensy.

The next updates to Orbit will add:

Testing

I have unit testing in test/test_orbit/test_orbit.cpp

Constants

I add some Orbit related constants.

Documentation Evidence

Inline documentation is sufficient.

kylekrol commented 4 years ago

Oh, and just curious what the -Wno-missing-braces was about? Like what syntax was the compiler choking on.

nhz2 commented 4 years ago

Also, I think we should look into moving the orbit class implementation into it's own translation unit (don't make it header only). Some of the getters and setters are fine to be inlined but for some of the larger functions I think we'll want to grantee they're compiled separately and linked in.

That seems like a premature optimization. I don't want to mess around with compiler optimizations options right now, but if you find something that significantly increases teensy run time performance and the tests still pass, let me know.

nhz2 commented 4 years ago

Oh, and just curious what the -Wno-missing-braces was about? Like what syntax was the compiler choking on.

In FlightSoftware my compiler was warning about something to do with initializing using curly braces and a constructor with multiple inputs vs using an initializer list and some ambiguity where it wanted extra braces around some of the initializer lists.

kylekrol commented 4 years ago

Also, I think we should look into moving the orbit class implementation into it's own translation unit (don't make it header only). Some of the getters and setters are fine to be inlined but for some of the larger functions I think we'll want to grantee they're compiled separately and linked in.

That seems like a premature optimization. I don't want to mess around with compiler optimizations options right now, but if you find something that significantly increases teensy run time performance and the tests still pass, let me know.

It's not really a runtime concern, more a binary size concern. The is no guarantee that the compiler will recognize the class is used across multiple translation units and compile a single version of the functions that are shared across multiple translation units.