Dev#14
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR applies code style cleanups in the RLS update routine, normalizes include ordering, tidies loop body indentation for 3508 motor power calculations, and renames a power status accessor from percentage to capacitor energy to better reflect its semantics. Class diagram for updated RLS and PowerControl interfacesclassDiagram
class RLS {
+Update(sample_vector : ParamVector, actual_output : float) const ParamVector&
-gainvector_ : ParamVector
-transmatrix_ : Matrix
-paramsvector_ : ParamVector
-lambda_ : float
}
class LibXR_Application {
}
class SuperPower {
+GetCapEnergy() float
+IsOnline() bool
}
class PowerControl {
+GetMeasuredPower() float
+GetCapEnergy() float
+IsOnline() bool
-superpower_ : SuperPower*
-motor_count_3508_ : int
-samples_3508_ : Matrix
-output_current_3508_ : float[]
-rotorspeed_rpm_3508_ : float[]
-kt_3508_ : float
}
PowerControl --|> LibXR_Application
PowerControl --> SuperPower
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:
- In
RLS::Update, the nested expression forgainvector_is now quite long; consider extracting the scalar denominator and intermediate(sample_vector.transpose() * transmatrix_ * sample_vector)(0, 0)into named variables to improve readability and make the update formula easier to verify. - Changing
GetPercent()toGetCapEnergy()and switching fromGetPercentage()toGetCapEnergy()inPowerControlalters the public API and semantics; if this class is used externally, consider keeping the old method as a wrapper or clearly separating the two accessors to avoid breaking existing callers and to make the intent of each clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `RLS::Update`, the nested expression for `gainvector_` is now quite long; consider extracting the scalar denominator and intermediate `(sample_vector.transpose() * transmatrix_ * sample_vector)(0, 0)` into named variables to improve readability and make the update formula easier to verify.
- Changing `GetPercent()` to `GetCapEnergy()` and switching from `GetPercentage()` to `GetCapEnergy()` in `PowerControl` alters the public API and semantics; if this class is used externally, consider keeping the old method as a wrapper or clearly separating the two accessors to avoid breaking existing callers and to make the intent of each clearer.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
Reformat RLS and power control code and adjust the power control public API to expose capacitor energy instead of percentage.
New Features:
Enhancements: