-
Notifications
You must be signed in to change notification settings - Fork 369
fixed on_set_chained_mode implementations to avoid cpplint warnings #1564
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
fixed on_set_chained_mode implementations to avoid cpplint warnings #1564
Conversation
@@ -689,8 +689,9 @@ controller_interface::CallbackReturn DiffDriveController::configure_side( | |||
|
|||
bool DiffDriveController::on_set_chained_mode(bool chained_mode) | |||
{ | |||
// Always accept switch to/from chained mode (without linting type-cast error) | |||
return true || chained_mode; | |||
// Fix to adhere to CppLint standards |
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.
A moor reference isn't really adhering to cppkint standards ;)
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.
You can achieve the same by commenting out the name of the argument. It tricks the parser and also the compiler. We already use that approach in the codebase, just look for "/*" in ros2_control
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.
No, I don't think so. See #1491 and the linked cpplint issue.
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 for the contribution! Great that you found out this. Please take a look at the solution I recommended.
@@ -689,8 +689,9 @@ controller_interface::CallbackReturn DiffDriveController::configure_side( | |||
|
|||
bool DiffDriveController::on_set_chained_mode(bool chained_mode) | |||
{ | |||
// Always accept switch to/from chained mode (without linting type-cast error) | |||
return true || chained_mode; | |||
// Fix to adhere to CppLint standards |
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.
You can achieve the same by commenting out the name of the argument. It tricks the parser and also the compiler. We already use that approach in the codebase, just look for "/*" in ros2_control
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1564 +/- ##
=======================================
Coverage 85.60% 85.61%
=======================================
Files 123 123
Lines 11873 11860 -13
Branches 1016 1015 -1
=======================================
- Hits 10164 10154 -10
+ Misses 1384 1383 -1
+ Partials 325 323 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
d8dc4b1
into
ros-controls:master
) (#1688) Co-authored-by: Bhagyesh Agresar <[email protected]>
) (#1687) Co-authored-by: Bhagyesh Agresar <[email protected]>
Fixed warnings generated by cpplint/cpplint#131 on some of the controllers that implement the chained mode.