-
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
Fix getTransform() #2113
Fix getTransform() #2113
Conversation
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
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 patching it. Fully makes sense and I will merge it now.
I did not file this request because the downside of not waiting for a user contribution is that now we still don't have tests for diff
overlayed frame lookups and much less incentive to write them... sigh
This fix was not related to a broken handling of transforms in scene diffs. I'm not sure whether we already have tests for this or not. |
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
Obviously we did not have a test for it yet, else it would have triggered.
The problem was in our own API using "wrong" API and it would have been nice to have a test for this convolved use-case.
We have way too few tests for `diff()` usage and I am convinced we will find more issues there in the future.
Actually I was tempted to remove the SceneTransforms class completely (but only keep the base class).
This would trigger hard errors if the wrong API is still used somewhere because the `Transforms` class doesn't know about link, object, or subframe transforms.
Do you want to file a pull-request for this with a note in `MIGRATIONS.md`? I would be happy to merge it.
The `SceneTransforms` class is an ugly interface wrapper around the planning scene bound to the lifetime of the planning scene by raw pointer.
I don't see any merit in keeping it.
|
No. If you use the wrong API, a test will not help. |
Ok, reading further, I note that you actually want a test for
Why should we mention this change in our migration notes? This doesn't affect API nor intended behaviour. It's just a bug fix. |
No. If you use the wrong API, a test will not help.
If we had a test that `diff`'s a scene, modifies the robot state, attaches an object in a robot frame and then check the position of said object via the `getFrameTransform` API, or possibly via both mentioned APIs to check for consistency, it would have helped.
Good morning to you too. ;)
|
> Do you want to file a pull-request for this with a note in `MIGRATIONS.md`?
Why should we mention this change in our migration notes? This doesn't affect API nor intended behaviour.
I mean a pull-request for removing `SceneTransforms`.
That one would of course be a breaking change, and not even API breakage.
|
I see. I don't have time for this today (estimated work-load: 1h). I will file an issue instead 😉 |
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
Replace: - PlanningScene::getTransforms().getTransform() -> PlanningScene::getFrameTransform() - PlanningScene::getTransforms().canTransform() -> PlanningScene::knowsFrameTransform() getTransforms() essentially yields the SceneTransforms instance of the parent scene only. Accessing the corresponding frame transforms obviously yields the wrong results.
Fix for moveit/moveit_task_constructor#168.
This PR replaces:
PlanningScene::getTransforms().getTransform()
->PlanningScene::getFrameTransform()
PlanningScene::getTransforms().canTransform()
->PlanningScene::knowsFrameTransform()
throughout the whole MoveIt code base.
getTransforms()
essentially yields the SceneTransforms instance of theparent
scene only:https://github.com/ros-planning/moveit/blob/272eaa01064df0b0184e2ad8766751ea27ef6c92/moveit_core/planning_scene/src/planning_scene.cpp#L630-L635
https://github.com/ros-planning/moveit/blob/272eaa01064df0b0184e2ad8766751ea27ef6c92/moveit_core/planning_scene/include/moveit/planning_scene/planning_scene.h#L172-L181
instead of creating a new layer of transforms as
getTransformsNonConst()
would do.Accessing the corresponding frame transforms obviously yields the wrong results.