-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSQ filter #415
base: master
Are you sure you want to change the base?
LSQ filter #415
Conversation
Signed-off-by: Guillaume W. Bres <[email protected]>
Génial Guillaume ! Ça fait longtemps que Nyx a besoin d'un filtre de moindre carrés ! A première vue, le code me paraît bon. La différence que j'ai remarqué c'est que les filtres LSQ que j'ai vu pour la restitution d'orbite peuvent généralement ingester plusieurs (dizaines voire centaines) de mesures à la fois. J'ai plus de détails sur mon autre ordinateur, et je comparerai ton algo avec celui que je connais (et en anglais). |
originellement on appelle Vu ce que tu me dis, tu n'as l'air de faire qu'une seule itération de KF toi classiquement ? en tous cas, je ne vois pas ce qui empecherait d'appeler l'API N fois, surtout si les covariances et vecteurs d'états sont publiques / accessibles, ce qui permet de décider si l'on continue ou pas. |
Here is the algorithm as described by Tapley & Schulz: Which follows the same nomenclature as in https://nyxspace.com/nyxspace/MathSpec/orbit_determination/kalman/#measurement-update. So H tilde maps the measurement (e.g. range and Doppler) to the state space (e.g. position and velocity), which is different from your H matrix. Then the \Phi matrix in the screenshots above is retrieved by the I think that this SE question uses the equations you are used to with the nomenclature I usually use: https://math.stackexchange.com/questions/3243798/batch-least-squares . Concerning how generic the state is, yes, that's on purpose. It allows for example to quickly switch between a filter that processes range and Doppler simultaneously or sequentially, and also estimating the solar radiation pressure coefficient, or changing the dynamics entirely and running an attitude/orientation filter with N star trackers for example. The mathematics are equivalent, so I wanted the implementation to be generic over any size. I agree with you that the Good luck, let me know how I can help! |
Following the idea of
nyx
being our navigation backbone framework,I'm trying to convert and propose my LSQ filter implementation for 3D+T navigation.
Side note, the "problem" I see with Nyx is that it is kind of overly generic:
I presume the dimensions we're dealing with remain U3, U4 or U6. Although, that may not apply to the filter API, because it is super interesting to propose a fully generic filter that other fields of application may use.
In the example of the existing KF, it is generic yet the API seems very tied to what a KF is and how it works.
The LSQ filter is very simple, it iteratively estimates the best correction to apply to the initial/current state. It is not a predictive filter. The Kalman filter was originally developped to enhance the LSQ filter. It is defined according to the following equations (for 3D+T in GNSS):
The H matrix, that I call
h
in my function, that you need to confirm is the H tilde in your notation, which is always squared andT::Size
? . For me, the LSQ requires State with the particularity thatT::Size = T::VecLength
, the squared matrix size and the vector length are identical:The correction vector (
T::VecLength
?) is obtained from the least square equation, from H andb
the measurement + noise vector, which is alsoT::VecLength
:A state update is simply X + dX.
First you need to confirm that your H tilde and my H matrix are the same.
Also, confirm that
b
will eventually be generalized to "SNC", considering that in my simpler case it is a unique vector (not N matrices).You will also have to tell me whether my
iterate()
function should go totime_update
ormeasurement_update
, I presume this is KF terminology, and I have no idea