-
Notifications
You must be signed in to change notification settings - Fork 579
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
[PSM] Add proccess Collision Object to PSM and request planning scene to moveit py to allow syncing of mutliple PSM #2536
[PSM] Add proccess Collision Object to PSM and request planning scene to moveit py to allow syncing of mutliple PSM #2536
Conversation
… syncing of multiple planning scene monitors
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2536 +/- ##
==========================================
- Coverage 50.89% 50.87% -0.01%
==========================================
Files 388 388
Lines 32245 32247 +2
==========================================
- Hits 16408 16403 -5
- Misses 15837 15844 +7 ☔ View full report in Codecov by Sentry. |
Known issues when trying to sync multiple planning scene:
|
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.
These changes look good to me as they enable a more expressive Python API.
@henningkayser are you ok with the changes made to the planning_scene_monitor
cpp code? They should be mostly inconsequential from what I can see, as they simply split a callback into a method which is called by the callback and the original callback (changes to collision and attached collision object callbacks on the psm). The purpose of this is to create a method for processing collision objects directly in the Python API essentially exposing the callback functionality in the binded Python method.
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.
Thanks for your contribution @JensVanhooydonck! Just a small comment and then I think this is good to go
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
} | ||
|
||
void PlanningSceneMonitor::attachObjectCallback(const moveit_msgs::msg::AttachedCollisionObject::ConstSharedPtr& obj) | ||
{ | ||
if (scene_) |
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.
I think it would be even nicer to completely get rid of the callback member functions and just call the new function with a lambda when the services are initialized
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.
Shall I just remove the callback functions and change the call of these functions from
collision_object_subscriber_ = pnode_->create_subscription<moveit_msgs::msg::CollisionObject>(
collision_objects_topic, rclcpp::SystemDefaultsQoS(),
[this](const moveit_msgs::msg::CollisionObject::ConstSharedPtr& obj) { return collisionObjectCallback(obj); });
RCLCPP_INFO(logger_, "Listening to '%s'", collision_objects_topic.c_str());
to
collision_object_subscriber_ = pnode_->create_subscription<moveit_msgs::msg::CollisionObject>(
collision_objects_topic, rclcpp::SystemDefaultsQoS(),
[this](const moveit_msgs::msg::CollisionObject::ConstSharedPtr& obj) { return processCollisionObjectMsg(obj); });
RCLCPP_INFO(logger_, "Listening to '%s'", collision_objects_topic.c_str());
And the same for the AttachedCollisionObjects?
These functions do not seem to be used somewhere else. I've added this to make sure there would not be any breaking changes.
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.
Yes 👍 They aren't used anywhere else and if they only call another function we don't need them. I think the lambda needs be
- [this](const moveit_msgs::msg::CollisionObject::ConstSharedPtr& obj) { return processCollisionObjectMsg(obj); }
+ [this](const moveit_msgs::msg::CollisionObject::ConstSharedPtr& obj) { processCollisionObjectMsg(obj); }
because the create_subscription
expects a function argument that returns void but just use whatever compiles
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.
Changed it
…monitor.cpp First catch empty scene to not have a unneeded indents. Co-authored-by: Sebastian Jahr <sebastian.jahr@tuta.io>
…ps://github.com/JensVanhooydonck/moveit2 into feature/multiple_planning_scene_monitor_syncing
Add proccess collision object and proccess attached collision object to PlanningSceneMonitor and add request planning scene to moveit py to allow syncing of multiple planning scene monitors.
Description
When altering a(n) (attached-)collision object in the planning scene by using the applyCollisionObject or processAttachedCollisionObject function on the planning scene object, this does not trigger an updated in the PSM.
When using the same logic in PSM we can alter a collsiion object directly, and sync this to other planning scene monitors.
To make this complete I also added the request planning scene function to the MoveitPy interface
Checklist