Skip to content
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

Improve move_group_interface const correctness #1715

Merged

Conversation

jliukkonen
Copy link
Contributor

@jliukkonen jliukkonen commented Nov 6, 2019

Improved const correctness in move_group_interface by adding const qualifier to member functions which do not modify the logical state. This PR also fixes couple instances where non-const iterators were compared against const iterators.

The interface defines move constructors which are now marked as noexcept. Long iterator types have been replaced with an auto type to improve readability of the code.

logical state of the class.
Added noexcept modifiers to move constructors, which should always be
marked as noexcept.
iterators so that const iterators are compared with const iterators.
@welcome
Copy link

welcome bot commented Nov 6, 2019

Thanks for helping in improving MoveIt

@jliukkonen jliukkonen changed the title Move group improve const correctness Improve move_group const correctness (WIP) Nov 6, 2019
@jliukkonen jliukkonen changed the title Improve move_group const correctness (WIP) Improve move_group const correctness Nov 6, 2019
@jliukkonen jliukkonen marked this pull request as ready for review November 6, 2019 20:41
@jliukkonen jliukkonen changed the title Improve move_group const correctness Improve move_group_interface const correctness Nov 6, 2019
Copy link
Contributor

@v4hn v4hn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you a lot for your work here. This is important details.

Please have a look at my inline comments.

@maintainers: It's not clear to me whether we want to define interactions with the ROS system, especially creating new subscribers and calling actions as const.
Personally, I'm not a big fan of allowing const action clients, but opinions probably differ.

Copy link
Member

@davetcoleman davetcoleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the changes to auto iterators. We've had this debate before as a community and have documented the decision in our style guide, let's not rehash that again:

Note that modernize-loop-convert check may convert for (...; ...; ...) loops to for (auto & ... : ...). However, auto is not an expression highly readable. Please explicitly specify the variable type, if it doesn’t become clear immediately from the context:

https://moveit.ros.org/documentation/contributing/code/

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't yet remove const from pick() and place(), which are accessing the action pointer.
Otherwise, this looks good to me.

@rhaschke
Copy link
Contributor

@jliukkonen, thanks for addressing the remaining comments. Please also fix the clang-tidy issues on Travis. The catkin_lint issue is unrelated.

@jliukkonen
Copy link
Contributor Author

Big thank you to the reviewers for taking their time commenting and proposing changes. It seems that right now the only(?) thing to fix are those clang-tidy issues. @rhaschke is there a way to have more detailed report on what is failing? I wasn't expecting to see clang-tidy issues and I don't know right now what is causing the check to fail. As for the catkin-lint issue, do you mean by unrelated to ignore it or to fix it while understanding that it is unrelated to problems that make clang-tidy check fail?

@rhaschke
Copy link
Contributor

Travis reports issues in moveit_ros_planning_interface. Hence, open the fold named Processing moveit_ros_planning_interface to see the details.

in getNamedTargets. Switch to range based for-loops to pass clang-tidy
tests.
@jliukkonen jliukkonen force-pushed the move_group-improve-const-correctness branch from a166d0e to 463a4b1 Compare November 15, 2019 17:00
@rhaschke rhaschke merged commit ea0d711 into moveit:master Nov 17, 2019
@welcome
Copy link

welcome bot commented Nov 17, 2019

Congrats on getting your first MoveIt pull request merged and improving open source robotics!

@mlautman mlautman deleted the move_group-improve-const-correctness branch November 22, 2019 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants