pathfinder-for-autonomous-navigation / psim

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

More Orbit Valid Checks #204

Closed nhz2 closed 4 years ago

nhz2 commented 4 years ago

More Orbit Valid Checks

Summary of changes

Testing

Added more unit tests in test_validity_checks()

Constants

I added MAXGPSTIME_NS and MINGPSTIME_NS which are about 20 years before and after PAN epoch, Orbits are invalid if they have a time outside this range.

Documentation Evidence

Inline documentation is sufficient.

srutiv commented 4 years ago

shouldn't line 146 of 'Orbit.h' be "energy = ((v_relative^2/2)- (mu/r))" ? right now it looks like "energy = ((v_relative/2)- (mu/sqrt(r))). Specific orbital angular momentum check looks good.

nhz2 commented 4 years ago

shouldn't line 146 of 'Orbit.h' be "energy = ((v_relative^2/2)- (mu/r))" ? right now it looks like "energy = ((v_relative/2)- (mu/sqrt(r))). Specific orbital angular momentum check looks good.

I added some comments: lin::fro is Frobenius (aka Euclidean) norm squared, so velocity should be squared already. r2 is also r^2 so the square root just makes it r.

srutiv commented 4 years ago

shouldn't line 146 of 'Orbit.h' be "energy = ((v_relative^2/2)- (mu/r))" ? right now it looks like "energy = ((v_relative/2)- (mu/sqrt(r))). Specific orbital angular momentum check looks good.

I added some comments: lin::fro is Frobenius (aka Euclidean) norm squared, so velocity should be squared already. r2 is also r^2 so the square root just makes it r.

Ahh okay. Looks good then