-
Notifications
You must be signed in to change notification settings - Fork 62
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
Inconsistent sensor noise handling #867
Comments
Good catch on coarseSunSensor.cpp! I totally missed that. I'll have to get back to you about your other questions about sensor implementations. Definitely might be good to reconcile them. |
Fixed missed sun sensor 1.5x multiplier removal. Will have an update soon on your other items. |
Excellent, thanks for the quick response! |
@sdunlap-afit I will be refactoring sensors' implementation of noise and addressing a good chunk of your items. Thanks again for pointing these inconsistencies out. Do add comments here if anything else relevant comes up. |
@Natsoulas Thanks for working on this. I was looking at |
Also, looking at If you want to change the behavior, I think you would just need to move You could even add another set of bounds, so the user can select the behavior they want. Current code for reference: void GaussMarkov::computeNextState()
{
.....
//! - Apply noise first
errorVector = this->noiseMatrix * ranNums;
//! - Then propagate previous state
this->currentState = this->propMatrix * this->currentState;
//! - Add noise to propagated state
this->currentState += errorVector;
//! - Apply bounds if needed
for(size_t i = 0; i < this->numStates; i++) {
if(this->stateBounds[i] > 0.0) {
if(fabs(this->currentState[i]) > this->stateBounds[i]) {
this->currentState[i] = copysign(this->stateBounds[i], this->currentState[i]);
}
}
}
} |
@sdunlap-afit Good catch, yes I can change the name to error_bounds, that is more accurate. Settings bounds = -1 is the intentional default for essentially having gaussian noise. Defaulting to disabled random walk was chosen as the default to help enforce users to purposefully set error bounds for their random walk custom to their use case. Lastly, I appreciate your careful review of the gauss markov module and sensor implementations, I'll be sure to ping you when I have changes ready. |
Also thanks, I will investigate the Reset() method to ensure expected behavior. |
@Natsoulas Sorry, for the negative value question, I was referring to the ....
imuSensor1.AMatrixGyro = [
[-0.1, 0.0, 0.0],
[0.0, -0.1, 0.0],
[0.0, 0.0, -0.1]
]
....
scSim.InitializeSimulation()
# Set IMU2's A Matrix to zero AFTER initialization
imuSensor2.AMatrixGyro = [
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]
] For the void StarTracker::Reset(uint64_t CurrentSimNanos)
{
// check if input message has not been included
if (!this->scStateInMsg.isLinked()) {
bskLogger.bskLog(BSK_ERROR, "starTracker.scStateInMsg was not linked.");
}
int numStates = 3;
this->AMatrix.setIdentity(numStates, numStates);
... |
@sdunlap-afit Yes in retrospect the negative here is a random choice. It is not detrimental to the example scenario here, but in best practice for real IMU sensors, negative A matrix values would typically not be set: it leads to abnormally strong mean reversion behavior. For basilisk users, it should be apparent that users should set parameters specific/tailored to desired sensor behavior. In my follow-up pr I'll add a note for users to model sensors with their own desired properties/configs. |
Hello, I saw #862 was merged and took a look at the sensor implementations. I am noticing some issues/inconsistencies in the latest
develop
branch. I have only tested a couple of these, the rest were from code review. Some of these may be intentional, but I wanted to point them out.noiseModel.setPropMatrix()
.AMatrix
is private, so there's no way for the user to set the propagation matrix for the noise model.AMatrix
is also private.Reset
?Given the above, would it make sense for each sensor to initialize the
GaussMarkov
object with reasonable defaults in the constructor, and then simply expose (markpublic
) theGaussMarkov
object to the user for further customization? It seems like this would make it easier to keep the various sensors consistent and would make it easier for the user to customize the noise model.The text was updated successfully, but these errors were encountered: