pathfinder-for-autonomous-navigation / psim

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

PGrep Utility #337

Closed kylekrol closed 3 years ago

kylekrol commented 3 years ago

Summary of changes

Added the pgrep utility to aid with searching for state field names. An example usage is given below which looks for all attitude fields within the simulation:

@jezero ~/git/pan/psim git:(feature/pgrep) venv:(3.9.2)
% ./tools/pgrep '.*attitude.*'
[INFO] Searching now with ".*attitude.*" ...
fc.{satellite}.attitude.is_valid [Integer]
fc.{satellite}.attitude.q.body_eci [Vector4]
fc.{satellite}.attitude.q.body_eci.error [Lazy Vector4]
fc.{satellite}.attitude.q.body_eci.error.degrees [Lazy Real]
fc.{satellite}.attitude.p.body_eci.error [Lazy Vector3]
fc.{satellite}.attitude.p.body_eci.sigma [Lazy Vector3]
fc.{satellite}.attitude.w [Lazy Vector3]
fc.{satellite}.attitude.w.error [Lazy Vector3]
fc.{satellite}.attitude.w.bias [Vector3]
fc.{satellite}.attitude.w.bias.error [Lazy Vector3]
fc.{satellite}.attitude.w.bias.sigma [Lazy Vector3]
truth.{satellite}.attitude.q.body_eci [Initialized Vector4]
truth.{satellite}.attitude.q.eci_body [Lazy Vector4]
truth.{satellite}.attitude.w [Initialized Vector3]
truth.{satellite}.attitude.L [Lazy Vector3]
[INFO] Complete!

r in the more verbose mode:

@jezero ~/git/pan/psim git:(feature/pgrep) venv:(3.9.2)
% ./tools/pgrep --verbose '.*attitude.*'
[INFO] Searching now with ".*attitude.*" ...
fc.{satellite}.attitude.is_valid 
        type: Integer
        source: include/psim/fc/attitude_estimator.yml
        comment:
                Flag specifying whether or not the estimator is currently initialized. Zero
        indicated the estimator isn't initialized while one indicates it has been
        initialized.
fc.{satellite}.attitude.q.body_eci
        type: Vector4
        source: include/psim/fc/attitude_estimator.yml
        comment:
                Current attitude estimate.
fc.{satellite}.attitude.q.body_eci.error
        type: Lazy Vector4
        source: include/psim/fc/attitude_estimator.yml
        comment:
                Current attitude estimate error.
fc.{satellite}.attitude.q.body_eci.error.degrees
        type: Lazy Real
        source: include/psim/fc/attitude_estimator.yml
        comment:
                Current attitude estimate error represented as a scalar in degrees.
fc.{satellite}.attitude.p.body_eci.error
...