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

AP_InertialSensor: count found backends correctly #12850

Closed
wants to merge 1 commit into from

Conversation

@andyp1per
Copy link
Contributor

andyp1per commented Nov 17, 2019

so that INS_ENABLE_MASK matches available sensors

Currently we count every sensor we probe for, even if the sensor does not exist on the board. This means that it's practically impossible to set INS_ENABLE_MASK correctly without consulting the code and the board configuration. It also doesn't match the docs (which are sensible).

This fixes by always probing for available sensors even if disabled by INS_ENABLE_MASK, but then not adding them to the list of backends.

…MASK matches available sensors
@andyp1per andyp1per requested a review from tridge Nov 17, 2019
@andyp1per andyp1per mentioned this pull request Nov 17, 2019
@tridge

This comment has been minimized.

Copy link
Contributor

tridge commented Nov 18, 2019

we would need to be sure that probing on all sensors does not install a timer callback and does not allocate any memory

@andyp1per

This comment has been minimized.

Copy link
Contributor Author

andyp1per commented Nov 18, 2019

@tridge I have checked all the drivers, they all register callbacks and allocate memory in the start() function which is only ever called after the backends have been detected.

@andyp1per

This comment has been minimized.

Copy link
Contributor Author

andyp1per commented Nov 24, 2019

@tridge how do we manage the saved calibration settings? It looks like that if I disable the first IMU the second IMU gets the calibration settings of the first and I have to re-calibrate. Seems perversely logical, but perhaps could be quite dangerous if people are using INS_ENABLE_MASK.

@andyp1per

This comment has been minimized.

Copy link
Contributor Author

andyp1per commented Dec 3, 2019

We are going to close this in favour of detecting IMU's in the correct order on relevant boards

@andyp1per andyp1per closed this Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.