Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a typo in a comment and optimizes the parameter handling in the mixer callback function. The changes improve performance by avoiding redundant function calls to retrieve the same parameter value multiple times.
- Fixed spelling error in comment ("micer" → "mixer")
- Optimized parameter retrieval by caching the float value in a local variable
- Added synchronization logic to keep secondary mixer parameters in sync when mirroring the primary mixer
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the secondary mixer is set to a number greater than NUM_MIXERS (the default for the secondary mixer is 255), then it defaults to have the same values as the primary mixer.
This PR adds a call to save the value of the secondary mixer to the params after setting the primary mixer value. Without this, the secondary mixer values used in code and the secondary mixer params get out of sync, which is confusing from a user perspective. In this case, the getting the secondary mixer values using the ROS service call does not return the correct value.
The previous workaround was to simply the newly loaded params to file and then restart the firmware, in which case the values for the secondary mixer were loaded properly (since the logic is correct in the
init_mixingfunction call).