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
Split CollisionPluginLoader #2834
Conversation
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.
Not having looked too deeply into this, is this another case of downstream-packages as test dependencies? I don't see why this is even a problem here, as both packages are in the same repository.
I'm not particularly happy with this patch, especially because it breaks API for no reason in addition to scattering logic even more.
@@ -581,7 +581,7 @@ class PlanningSceneMonitor : private boost::noncopyable | |||
robot_model_loader::RobotModelLoaderPtr rm_loader_; | |||
moveit::core::RobotModelConstPtr robot_model_; | |||
|
|||
collision_detection::CollisionPluginLoader collision_loader_; | |||
collision_detection::ROSCollisionPluginLoader collision_loader_; |
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.
Not changing this probably prints an error saying "no such method setupScene
".
That's a damn surprising error to hit in an interface that was set in stone for 7 years.
I understand why you modified the name here instead of giving the moveit_core
version a new name, but that would usually be much more appropriate.
If you insist on the names, at least add a MIGRATIONS.md
entry.
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.
Better clean than backwards compatible 😉
I will add a comment in MIGRATIONS
.
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.
Better clean than backwards compatible 😉
Clean is relative and I know quite a few people who would like to see you suffer for that kind of statement...
Maybe @gavanderhoorn or @simonschmeisser want to comment?
moveit_core/collision_detection/src/collision_plugin_loader.cpp
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2834 +/- ##
==========================================
+ Coverage 60.81% 60.86% +0.06%
==========================================
Files 366 368 +2
Lines 31717 31715 -2
==========================================
+ Hits 19286 19301 +15
+ Misses 12431 12414 -17
Continue to review full report at Codecov.
|
|
That's only partially true, because it would only be used in tests of I believe with the prbt IK plugin a main problem was that it's in a different repository even, but that's not the case here as |
In theory, I agree with you: As tests are (usually?) build after all packages in a repo, test dependencies shouldn't create a circular dependency. However, in practice, that's not the case. Of course, I tried using the existing Removing the |
To avoid circular dependencies, but enable reuse of the CollisionPluginLoader, separate the non-ROS part into moveit_core/moveit_collision_detection.so and the ROS part (reading the plugin name from the parameter server) into moveit_ros_planning/moveit_collision_plugin_loader.so (as before).
f87215f
to
f3f7038
Compare
As a compromise: What about splitting the added functionality of |
Looking further into it, I'm honestly wondering why we should not just migrate the whole class to |
I don't understand your crossed-out statement. But, you are right: The usage of |
I'm not sure whether this should qualify as "use", but we do have a template method for user code that uses it.
Then you would need to write
instead of
I don't think that's a nicer API. :) |
CollisionPluginLoader cpl_;
cpl_.activate(getCollisionPluginName(nh_), scene, true); I do think this is cleaner: It is modular and more explicitly states what actually happens. |
to avoid the naming conflict with the old class in moveit_ros. It's basically an enhanced cache, so the name seems fine to me.
I managed to convince myself that you are right... Until I tried to implement it and noticed that it would actually read something like that: collision_detection::CollisionPluginLoader cpl_;
auto plugin_name = collision_detection::getCollisionPluginName(nh_);
if(!plugin_name.empty())
cpl_.activate(plugin_name, scene, true); (I don't think adding an early return for empty string to Instead I renamed the internal class to keep the current API. |
I think, it would be a good idea to augment |
To enable reuse
CollisionPluginLoader
(frommoveit_ros_planning
) inmoveit_core
, but avoid circular dependencies between these two packages, this PR separates the non-ROS part intomoveit_core/moveit_collision_detection.so
and the ROS part (reading the plugin name from the parameter server) intomoveit_ros_planning/moveit_collision_plugin_loader.so
(as before).Additionally, to better distinguish both classes, the original class is renamed to
ROSCollisionPluginLoader
.This PR is a prerequisite for further simplification of the tests in #2830.