Open sdunlap-afit opened 2 months ago
I wouldn't call it a bug, just a limitation of the model. All models are abstractions, and for various reasons some models in 42 are more fleshed out than others. The GPS model is pretty unsophisticated. If you need more fidelity, you may need to add it in yourself. I can't respond to all feature requests, but if you describe what you'd like to see, I'll at least consider it.
Regards, -Eric
Thanks for getting back to me. I was going to use the Valid flag to determine if a new measurement was taken (due to slower sample times), but looking at the other sensor types (e.g., AcGyroType
), I realize I'll need a different approach. I could use SampleCounter == 0
in the higher level types (e.g., GyroType
) since that seems pretty consistent. How do you normally handle sample rates? I have a private fork of 42 that I can modify (I wanted to call my C++ code directly from 42fsw.c
to keep sim times down).
Thanks, Steve
Hi Steve,
Sounds like you want a flag or a time tag in the sensor model, that you can check and clear in your sensor processing. For example,
In GpsModel, when the measurement is taken, set GPS->NewMeas = TRUE. Then, in your sensor processing...
if (GPS->NewMeas) { GPS->NewMeas = FALSE; [...process measurement...] }
There are variations on the theme, depending on needs and taste.
Regards, -Eric (he/him)
Thanks Eric. That's effectively what I'm doing. I'm implementing some custom error models, so I think I'll handle the flag at the same time. That solves my problem. Thank you for your time! Steve
In 42sensors.c
GpsModel(struct SCType *S)
,GPS->Valid
is set true inside the SampleCounter if-statement but is only set to false if the RefOrb is not Earth. Is this the intended functionality (always valid after the first update) or a bug? Thanks.