-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fixed on_set_chained_mode implementations to avoid cpplint warnings #1564
base: master
Are you sure you want to change the base?
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
Fixed warnings generated by cpplint/cpplint#131 on some of the controllers that implement the chained mode.