-
Notifications
You must be signed in to change notification settings - Fork 95
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
Spline protective stop ci #162
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #162 +/- ##
==========================================
+ Coverage 70.62% 70.73% +0.10%
==========================================
Files 69 69
Lines 2526 2525 -1
Branches 322 322
==========================================
+ Hits 1784 1786 +2
+ Misses 556 553 -3
Partials 186 186
☔ View full report in Codecov by Sentry. |
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.
Overall looks good to me. Just added a small suggestion to not round variables that are already integers.
@@ -92,7 +93,7 @@ bool ScriptCommandInterface::setToolVoltage(const ToolVoltage voltage) | |||
int32_t val = htobe32(toUnderlying(ScriptCommand::SET_TOOL_VOLTAGE)); | |||
b_pos += append(b_pos, val); | |||
|
|||
val = htobe32(toUnderlying(voltage) * MULT_JOINTSTATE); | |||
val = htobe32(round(toUnderlying(voltage) * MULT_JOINTSTATE)); |
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 is already an int, so no need to round this.
b_pos += append(b_pos, val); | ||
} | ||
|
||
for (auto const& selection : *selection_vector) | ||
{ | ||
val = htobe32(static_cast<int32_t>(selection * MULT_JOINTSTATE)); | ||
val = htobe32(static_cast<int32_t>(round(selection * MULT_JOINTSTATE))); |
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.
Same as above
b_pos += append(b_pos, val); | ||
} | ||
|
||
val = htobe32(static_cast<int32_t>(type * MULT_JOINTSTATE)); | ||
val = htobe32(static_cast<int32_t>(round(type * MULT_JOINTSTATE))); |
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.
Same as above
Identified that static cast can convert wrong when the float value is around but not zero (1e-322) resulting in a large number
6c451b9
to
ff72c9c
Compare
This PR mainly improve robustness for spline interpolation