Skip to content
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

Magnetometer Sensor Noise Std is scaled by a factor of 1.5 #800

Closed
AmolikaSoni opened this issue Sep 10, 2024 · 8 comments · Fixed by #862
Closed

Magnetometer Sensor Noise Std is scaled by a factor of 1.5 #800

AmolikaSoni opened this issue Sep 10, 2024 · 8 comments · Fixed by #862
Assignees
Labels
bug Something isn't working

Comments

@AmolikaSoni
Copy link

AmolikaSoni commented Sep 10, 2024

Describe the bug
The standard deviation provided as input for magnetometer modelling is scaled by a factor of 1.5

To reproduce
Locate line no. 71 in https://github.com/AVSLab/basilisk/blob/develop/src/simulation/sensors/magnetometer/magnetometer.cpp
auto nMatrix = (this->senNoiseStd * 1.5).asDiagonal();

Expected behavior
Not sure on why 1.5 is being multiplied.

Screenshots
Code lines already mentioned above

@schaubh schaubh self-assigned this Sep 10, 2024
@schaubh schaubh added the bug Something isn't working label Sep 10, 2024
@schaubh schaubh added this to Basilisk Sep 10, 2024
@schaubh
Copy link
Contributor

schaubh commented Sep 19, 2024

Howdy @AmolikaSoni , thanks for the info. I'm not sure either why this 1.5 multiplier was added there in the original code. I'll take a look this weekend and correct or document if needed.

@schaubh schaubh moved this to 🏗 In progress in Basilisk Sep 19, 2024
@AmolikaSoni
Copy link
Author

Hi @schaubh, any updates on this? I just found the same scaling of 1.5 in the coarse sun sensor modeling as well! https://github.com/AVSLab/basilisk/blob/develop/src/simulation/sensors/coarseSunSensor/coarseSunSensor.cpp

@schaubh
Copy link
Contributor

schaubh commented Oct 8, 2024

Howdy @AmolikaSoni , I found the same. I searched the BSK code base for the use of .setNoiseMatrix() and found that only the magnetometer and CSS modules use the 1.5 multiplier. At this point I have a task to make a branch to remove the 1.5x term and document this change in the known issues file.

@schaubh schaubh linked a pull request Oct 13, 2024 that will close this issue
@sdunlap-afit
Copy link

Hi @schaubh, While reviewing the following document, I came across multiple references to scaling standard deviations by 1.5 and remembered this thread. Is the document correct, or should I provide the desired standard deviations without scaling? Thank you for your time.

"where senRotNoiseStd and senTransNoiseStd are input by the user as 1.5x the desired standard
deviation as scalar floats."

https://github.com/AVSLab/basilisk/blob/develop/src/simulation/sensors/imuSensor/_Documentation/BasiliskCorruptions.pdf

@schaubh
Copy link
Contributor

schaubh commented Oct 17, 2024

@sjkcarnahan , you wrote this original documentation. Do you recall why this 1.5x factor was put in there? Some modules used it, most didn't?

@schaubh
Copy link
Contributor

schaubh commented Oct 23, 2024

I spoke with the original author and he said this 1.5x factor was added to ensure the noise had the expected standard deviation. We will create a test to validate this. If correct after we test this, I don't think the coder should have to set this 1.5 in the BSK module. I'd like to look at a solution where the user sets the expected noise standard deviation and the gaussMarkow library does the required scaling.

@schaubh
Copy link
Contributor

schaubh commented Nov 7, 2024

We can verify that the 1.5x factor is required to get the expected noise behavior. We are looking at ideas to avoid having the module need to this easier to setup.

@AmolikaSoni
Copy link
Author

@schaubh I read the document shared by @sdunlap-afit. If you see the recommendations section, it does mention that "make it so that the given standard deviation does not have to be scaled by 1.5x" (Ref. section 2.2 ->2.2.1->6)
https://github.com/AVSLab/basilisk/blob/develop/src/simulation/sensors/imuSensor/_Documentation/BasiliskCorruptions.pdf

@schaubh schaubh linked a pull request Dec 5, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Basilisk Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
3 participants