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

Preserve metadata when detaching objects #2814

Merged
merged 2 commits into from Aug 16, 2021

Conversation

v4hn
Copy link
Contributor

@v4hn v4hn commented Aug 15, 2021

@corot proposed to fix object color handling, but the handling itself does not seem to be broken the way they expect.

Instead, when trying to remove an attached object from the world, color/type was removed even when the object was not actually removed from the world (attached objects are not in the world, so their meta-data should stay around).

Additionally here is a test to verify handling of color and type works as expected when objects get attached/detached.

@corot The bugfix should help you find the culprit in your use case. Please have a look at the test as well.

@v4hn v4hn force-pushed the pr-master-fix-object-colors branch from 00cdb53 to e89a5b6 Compare August 15, 2021 12:29
Copy link
Contributor

@corot corot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, much better than my PR, and equally preserves the color
Thanks!

@codecov
Copy link

codecov bot commented Aug 15, 2021

Codecov Report

Merging #2814 (e89a5b6) into master (0defef0) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2814      +/-   ##
==========================================
+ Coverage   60.42%   60.51%   +0.09%     
==========================================
  Files         366      366              
  Lines       31673    31672       -1     
==========================================
+ Hits        19136    19163      +27     
+ Misses      12537    12509      -28     
Impacted Files Coverage Δ
moveit_core/planning_scene/src/planning_scene.cpp 60.39% <100.00%> (+1.62%) ⬆️
...meterization/work_space/pose_model_state_space.cpp 83.02% <0.00%> (+1.89%) ⬆️
.../ompl_interface/src/detail/constrained_sampler.cpp 59.46% <0.00%> (+16.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0defef0...e89a5b6. Read the comment docs.

@felixvd
Copy link
Contributor

felixvd commented Aug 16, 2021

Right. When we attach the object, we remove it from the world without removing the metadata. This avoids deleting the metadata when detaching the object with the REMOVE keyword.

I still think it would be much easier to understand the code with a DETACH keyword, and/or if the metadata was copied from the AttachedBody to the world, but there are bigger fish to fry.

Copy link
Contributor

@felixvd felixvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@felixvd felixvd changed the title On object meta data Preserve metadata when detaching objects Aug 16, 2021
@felixvd felixvd merged commit fd88dd6 into moveit:master Aug 16, 2021
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

3 participants