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

remove robot_model:: and robot_state:: #2135

Merged
merged 2 commits into from
Jun 3, 2020

Conversation

v4hn
Copy link
Contributor

@v4hn v4hn commented Jun 2, 2020

Fixes #1878 .

Please merge this as two commits, as we should only backport the internal usage, but not the API change.

@rhaschke
Copy link
Contributor

rhaschke commented Jun 2, 2020

Removing robot_model and robot_state requires changes in downstream packages like moveit_visual_tools as well.

@simonschmeisser
Copy link
Contributor

Shouldn't there be a deprecation warning for some time before "removing" API? There are many places using robot_state::RobotState in ROS-I for example

@v4hn v4hn force-pushed the pr-master-robot-state-ns branch from 754f375 to b605938 Compare June 3, 2020 10:42
@v4hn
Copy link
Contributor Author

v4hn commented Jun 3, 2020

It's funny how @davetcoleman was the one complaining about the aliased namespaces, when his own projects use them. 😄

The problem with API deprecations in master is that it's not possible to bind the deprecation to a ROS release anymore, because OR wants us to abandon ROS.
In that context we agreed to allow more API-breaking changes in master directly.

Given the amount of usage of these namespaces, I switched to deprecation.
This will probably still fail with some ROS-I projects though, because, I seem to recall, they compile with -Werror(?).

@davetcoleman
Copy link
Member

It's funny how @davetcoleman was the one complaining about the aliased namespaces, when his own projects use them. smile

What projects specifically? I'm sure at one point I took some snippets from other places that used that type of namespace, yes. So what?

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.

Travis needs to be fixed before merging - although we have a lot of approvals already!

@v4hn v4hn force-pushed the pr-master-robot-state-ns branch from b605938 to 6ad39fb Compare June 3, 2020 18:27
@v4hn v4hn force-pushed the pr-master-robot-state-ns branch from 6ad39fb to 42edc1f Compare June 3, 2020 18:29
@v4hn
Copy link
Contributor Author

v4hn commented Jun 3, 2020

What projects specifically

I noticed moveit_visual_tools with quite a few offenders.

But among other things the tutorials also use them a lot.

This syntax breaks Travis.

True. It turns out namespace aliases (namespace a = b) do not support attributes at all, not even in the standard. Looks like an oversight to me, but might be related to simplified processing. Aliases are usually treated as straight text replacement.
A simple rewrite is namespace [[deprecated]] a { using namespace b; } which is allowed in the C++ standard.
However, because the gcc developers are as slow to fix issues as we are, gcc did not support this syntax until August 2019 (talking about c++11...). The patch did not even land in gcc 9.3, so it's still broken in Ubuntu 20.04.
Even the old-fashioned way of specifying gnu-specific deprecations (__attribute__((deprecated))) was not supported before.
Either way triggers

warning: 'deprecated' attribute directive ignored [-Wattributes]

and does not recognize the deprecation.

Clang just does the right thing.

That simply leaves us with no way of deprecating the namespaces without removing them.
Because the syntax is so common, let's just leave the namespace definitions around.
@henningkayser make sure you remove them for moveit2 though!

I added a decent hint to MIGRATION.md asking people to change the namespaces for future versions.

@henningkayser
Copy link
Member

@v4hn can't we just deprecate the corresponding types using aliases (like b735145)

@v4hn
Copy link
Contributor Author

v4hn commented Jun 3, 2020 via email

@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #2135 into master will decrease coverage by 0.40%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2135      +/-   ##
==========================================
- Coverage   57.82%   57.41%   -0.41%     
==========================================
  Files         328      328              
  Lines       25700    25700              
==========================================
- Hits        14860    14755     -105     
- Misses      10840    10945     +105     
Impacted Files Coverage Δ
...ls/include/moveit/py_bindings_tools/gil_releaser.h 0.00% <0.00%> (-100.00%) ⬇️
.../include/moveit/py_bindings_tools/py_conversions.h 0.00% <0.00%> (-86.67%) ⬇️
...s/include/moveit/py_bindings_tools/serialize_msg.h 0.00% <0.00%> (-80.00%) ⬇️
.../ompl_interface/src/detail/constrained_sampler.cpp 46.15% <0.00%> (-17.95%) ⬇️
...ove_group_interface/src/wrap_python_move_group.cpp 31.96% <0.00%> (-11.08%) ⬇️
...ma_kinematics_plugin/src/lma_kinematics_plugin.cpp 75.18% <0.00%> (-3.76%) ⬇️
.../move_group_interface/src/move_group_interface.cpp 44.44% <0.00%> (-3.64%) ⬇️
...ipulation/pick_place/src/manipulation_pipeline.cpp 76.41% <0.00%> (-0.95%) ⬇️
...raint_samplers/src/default_constraint_samplers.cpp 82.90% <0.00%> (+0.36%) ⬆️
...meterization/work_space/pose_model_state_space.cpp 82.99% <0.00%> (+0.68%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bdce08...ae29ea6. Read the comment docs.

@davetcoleman
Copy link
Member

I see you already did the tutorials. Here's MVT: moveit/moveit_visual_tools#65

v4hn added a commit to v4hn/moveit that referenced this pull request Jul 3, 2020
v4hn added a commit to v4hn/moveit that referenced this pull request Jul 3, 2020
sjahr pushed a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
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.

prefer moveit::core over robot_state namespace
5 participants