-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
fix thermal calibration if a sensor does not have temperature sensor #15671
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, but worries me slightly. We know about the cases that don't have temperature at all (now reporting NAN), but I'm not absolutely certain it's impossible for other sensors to never publish NAN (eg sporadic read error, etc).
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, better to be sure on that point. I think I can reverse the logic : initialize with no temperature sensors and change that when a temperature measure is received. Calibration will exit immediately if the first temperature measure of all sensors is nan ( I hope it is not the case juste afetthe boot ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Briefly thinking about this I'd say it's unlikely, but also not impossible.
The structure of many of the newer IMU drivers is that the temperature is read AFTER the FIFO. This doesn't apply to the sensors like the ICM20602 that have the temperature in the FIFO. https://github.com/PX4/Firmware/blob/7e5e8259f3bc644185569cb2292fd5ebd6bb532f/src/drivers/imu/invensense/icm20689/ICM20689.cpp#L265-L269
That means technically the very first sensor_{accel, gyro} publications with have a temperature of NAN. Now, these drivers start much earlier than the
temperature_compensation
module and run at a much higher priority, but some of them do have fairly long initial reset periods (30-100 ms) before that first publication.Let's move forward with this change and keep an eye on it. I wouldn't be opposed to restructuring the drivers slightly so that we go out of our way to never publish NAN as a temperature unless there's no sensor or something is actually busted.