Dev#19
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR makes minor refactors and a small logic adjustment: it tidies the RLS estimator header include/whitespace, renames a PowerControl constructor parameter and member initializer for clarity, and removes a hard-coded 3.0 offset from the available power calculation so it now only subtracts chassis static power loss from max power. Class diagram for updated PowerControl constructor and membersclassDiagram
class LibXR_Application
class SuperPower
class PowerControl {
+PowerControl(hw, app, super_power, is_helm, chassis_static_power_loss, motor_count_3508, motor_count_6020)
-uint32_t MAX_MOTOR_COUNT
-SuperPower* superpower_
-bool is_helm_
-RLS rls_
-float k3_chassis_
-int motor_count_3508_
-int motor_count_6020_
-float motor_power_3508_[MAX_MOTOR_COUNT]
-float motor_power_6020_[MAX_MOTOR_COUNT]
}
PowerControl --|> LibXR_Application
PowerControl --> SuperPower
class RLS {
+RLS(delta, lambda)
}
PowerControl --> RLS
Flow diagram for updated available power calculationflowchart TD
A[max_power] --> C[Compute available_power]
B[k3_chassis_] --> C[Compute available_power]
C --> D[available_power = max_power - k3_chassis_]
D --> E[Use available_power for motor power allocation]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The constructor parameter rename from
superpowertosuper_powerwhile keeping the membersuperpower_makes the naming slightly inconsistent; consider aligning the member name with the parameter (e.g.,super_power_) for clarity. - The change to
available_powerremoves the hard-coded- 3.0offset; if this constant represents a known baseline loss, consider replacing it with a named constant or configuration value rather than removing it silently, so the intent of the change is explicit in the code.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The constructor parameter rename from `superpower` to `super_power` while keeping the member `superpower_` makes the naming slightly inconsistent; consider aligning the member name with the parameter (e.g., `super_power_`) for clarity.
- The change to `available_power` removes the hard-coded `- 3.0` offset; if this constant represents a known baseline loss, consider replacing it with a named constant or configuration value rather than removing it silently, so the intent of the change is explicit in the code.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Summary by Sourcery
Clean up headers and naming and adjust power calculation for the power control application.
Bug Fixes:
Enhancements: