-
Notifications
You must be signed in to change notification settings - Fork 938
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
Complete scene return for component = 0 (#1067) #1424
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.
Nice work, thanks.
I think what @v4hn meant was not if there is a call to the service that requests the whole scene, but that there might be a place in the code where get_planning_scene
is called and an empty scene is expected as a response. E.g. a loop that requests parts of the scene when they need to be updated, and sends an empty service request otherwise.
It seems that no one is certain, so rather than hunting through the entire code base, it might be more efficient to check if performance drops after this change.
I did not test this locally, for the record.
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/move_group/src/default_capabilities/get_planning_scene_service_capability.cpp
Outdated
Show resolved
Hide resolved
moveit_ros/move_group/src/default_capabilities/get_planning_scene_service_capability.cpp
Outdated
Show resolved
Hide resolved
I searched through the codebase thoroughly and am quite confident that there are no calls to the service where an empty scene response is expected. The service is called only through an intermediate function which always requests the full scene. Nevertheless, I would still like to do the performance check but I don't know what exactly do you mean when referring to performance and how would you measure it. Could you give me a hint how to do this? |
The keyword is code benchmarking, and I would simply test if calling the Apart from that, I also had a look through the code and couldn't find any calls to this service except the To document it, I would personally add the same comment to the PlanningSceneRequest msg file and maybe a line like "get_planning_scene service now returns the whole scene if no components are specified" to the migration notes. Maybe some maintainers can give their opinion and request those changes. Apart from that and the first paragraph, I think this is fine. That said, I haven't tested it. |
I did some measurements and the difference is tiny. So I think we are good to go from this aspect.
I think that the comment is better fit in the service description (moveit_msgs/srv/GetPlanningScene.srv) as this is a property of the service and not the message itself? |
Yes, the service description file is the right place. I got confused copying things around. |
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.
LGTM in general, with two small corrections:
- This should target
master
branch, notmelodic-devel
. You should be able to change the target branch on this same PR. - IMO a change like this should go in
MIGRATION.md
, which I'd prefer to have in this PR.
[Resolved] |
…in get_planning scene (moveit#1067)
a67d4dc
to
00ed699
Compare
MIGRATION.md
Outdated
@@ -6,6 +6,7 @@ API changes in MoveIt! releases | |||
- Extended the return value of `MoveitCommander.MoveGroup.plan()` from `trajectory` to a tuple of `(success, trajectory, planning_time, error_code)` to better match the C++ MoveGroupInterface ([790](https://github.com/ros-planning/moveit/pull/790/)) | |||
- `moveit_rviz.launch`, generated by MSA, provides an argument `rviz_config` to configure the rviz config to be used. The old boolean config argument was dropped. ([1397](https://github.com/ros-planning/moveit/pull/1397)) | |||
- Moved the example package `moveit_controller_manager_example` into [moveit_tutorials](https://github.com/ros-planning/moveit_tutorials) | |||
- Requests to `get_planning_scene` service without explicitely setting "components" now returns full 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.
-> explicitly
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.
-> return
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.
Sorry, missed my spelling mistakes.
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.
One more typo. Code is a little bit too verbose. I suggested (and pushed) an alternative.
ps->getPlanningSceneMsg(res.scene, req.components); | ||
|
||
// all scene components are returned if none are specified | ||
if (!req.components.components) |
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 suggested a more compact code snippet.
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!
moveit_ros/move_group/src/default_capabilities/get_planning_scene_service_capability.cpp
Show resolved
Hide resolved
Travis failed because it looks like |
Attempting to fix flaky CI here. |
Trying one more time to get Travis to pass. |
Description
When calling the /get_planning_scene service with component = 0, the service will return the full scene instead of an empty one (proposed in #1067)
I identified a single place in the codebase where a call to the service with all components takes place and replaced it with a call with components = 0. I am not to happy about writing it out as it is (that's why I had to add the comment), maybe someone can give me a hint to make it more understandable intuitively.
Checklist