-
Notifications
You must be signed in to change notification settings - Fork 7
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
Spike autocharge #1336
base: develop
Are you sure you want to change the base?
Spike autocharge #1336
Conversation
f7136e8
to
44d0e19
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1336 +/- ##
========================================
Coverage 98.74% 98.74%
========================================
Files 146 146
Lines 3759 3759
========================================
Hits 3712 3712
Misses 47 47 ☔ View full report in Codecov by Sentry. |
e5da452
to
b23b856
Compare
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.
Set a timeout + use BLE commands to activate the autocharge + prepare to behaviorkit (uniform)
b23b856
to
17cb998
Compare
🔖 Version comparison
|
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff output
|
📈 Changes Impact Analysis Report📌 Info
🤖 Firmware impact analysis
Click to show memory sections
🔬 Detailed impact analysisClick to show detailed analysis for all targets
🗺️ Map files diff output
|
06ce90e
to
dc99b43
Compare
dc99b43
to
a049b4a
Compare
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.
LGTM, a nice way for me to read again a bit of Cpp 👍
Just one readability remark about the if/else nesting in the Seal strategy
if (is_right_tilted) { | ||
if (should_move_forward) { | ||
spinRight(kMinPwmOutput, kMinPwmOutput + speed_offset); | ||
} else { | ||
spinLeft(kMinPwmOutput, kMinPwmOutput + speed_offset); | ||
} | ||
} else { | ||
if (should_move_forward) { | ||
spinLeft(kMinPwmOutput + speed_offset, kMinPwmOutput); | ||
} else { | ||
spinRight(kMinPwmOutput + speed_offset, kMinPwmOutput); | ||
} | ||
} |
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.
It's been a while since I've coded in C++ !! I kind of remember of us not using ternary operator for a reason but can you put this part in a independant function ?
void SealStrategy::performSpin(bool is_right_tilted, bool should_move_forward, float speed_offset) {
if (is_right_tilted) {
should_move_forward ? spinRight(kMinPwmOutput, kMinPwmOutput + speed_offset)
: spinLeft(kMinPwmOutput, kMinPwmOutput + speed_offset);
} else {
should_move_forward ? spinLeft(kMinPwmOutput + speed_offset, kMinPwmOutput)
: spinRight(kMinPwmOutput + speed_offset, kMinPwmOutput);
}
}
This would give a nice :
if (abs_float(angles.roll) > kRollTolerance) {
auto speed_offset = convertToPwmFrom(angles.roll > 0 ? angles.roll : -angles.roll);
performSpin(is_right_tilted, should_move_forward, speed_offset);
} else if (abs_float(angles.pitch) > kPitchTolerance) {
auto speed = convertToPwmFrom(angles.pitch > 0 ? angles.pitch : -angles.pitch);
should_move_forward ? moveForward(speed) : moveBackward(speed);
} else {
stopMotors();
}
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.
Thank you!
Ternary was mostly not used since it might be hard to read and understand. However I never used them to call a function, only to set variable so I don't know if you can use it as is.
I will let them in if/else statement since it is easier to read and understand what happened to me
I will add your suggestion to move in function these whole if/else statement
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
29b5d0f
to
1799df5
Compare
seal strategy
An original suggestion from @HPezz Co-Authored-By: Hugo Pezziardi <[email protected]>
An original suggestion from @HPezz Co-Authored-By: Hugo Pezziardi <[email protected]>
1799df5
to
c1cc2f0
Compare
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
No description provided.