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

Fix getTransform() #2113

Merged
merged 1 commit into from
May 28, 2020
Merged

Fix getTransform() #2113

merged 1 commit into from
May 28, 2020

Conversation

rhaschke
Copy link
Contributor

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 the parent 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.

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.
Copy link
Contributor

@v4hn v4hn left a 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

@v4hn v4hn merged commit acc9450 into moveit:master May 28, 2020
@rhaschke
Copy link
Contributor Author

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.
The key issue here was that we used the wrong API: First getting the SceneTransforms class (which returned the instance from the parent scene) and then retrieving transforms from this instance, obviously bypasses the overlayed diff scene. In all adapted cases, we didn't actually need the SceneTransforms instance. 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.

@rhaschke rhaschke deleted the fix-getTransform branch May 28, 2020 08:25
rhaschke added a commit to ubi-agni/moveit that referenced this pull request May 28, 2020
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.
@v4hn
Copy link
Contributor

v4hn commented May 28, 2020 via email

@rhaschke
Copy link
Contributor Author

Obviously we did not have a test for it yet, else it would have triggered.

No. If you use the wrong API, a test will not help.
This would require a test that (obviously) fails when one uses the wrong API. However this would be ridiculous.

@rhaschke
Copy link
Contributor Author

Ok, reading further, I note that you actually want a test for processCollisionObject() which handles this case. Fair enough.

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. It's just a bug fix.

@v4hn
Copy link
Contributor

v4hn commented May 28, 2020 via email

@v4hn
Copy link
Contributor

v4hn commented May 28, 2020 via email

@rhaschke
Copy link
Contributor Author

I see. I don't have time for this today (estimated work-load: 1h). I will file an issue instead 😉

rhaschke added a commit to ubi-agni/moveit that referenced this pull request May 28, 2020
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.
davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Jun 2, 2020
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.
davetcoleman pushed a commit to davetcoleman/moveit that referenced this pull request Jun 2, 2020
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.
pradeepr-roboticist pushed a commit to pradeepr-roboticist/moveit that referenced this pull request Jun 3, 2020
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.
@tylerjw tylerjw mentioned this pull request Jul 18, 2020
20 tasks
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.

None yet

2 participants