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

PS: Don't reset color information of existing objects when new entries are added #410

Merged

Conversation

v4hn
Copy link
Contributor

@v4hn v4hn commented Jan 9, 2017

This implements a fix for #408.

When adding two different objects with color information one after the other (in two different PlanningScene updates), the color information of the first update is lost and overwritten during the second update.
As a result the color specified in the first update is lost and the existing (the first) object changes back to default-green in RViz.

In order to avoid memory leaks, I added explicit remove operations upon object removal.
However, this slightly changes current behavior: If you add an object with color information, remove it, and later on add that object back without specifying a color, the previous color was still cached - That is, unless any other PlanningScene update with color information was received in between.
Because of the changed behavior I would not backport this to i/j.

While I read through the code I found the explicit removal operations where missing for ObjectTypes too, so I added these in a second commit.

Notice that both remove functions do nothing if the entry is not present, so calling them cannot break anything here.

The stored colors were cleared whenever a new non-empty color entry
was received. This is fine as long as one always sends the colors of all
scene objects *together*, but breaks as soon as someone adds objects
incrementally and only provides the color of the newly added object.

In order to prevent dangling color information, I explicitly remove
the relevant color entries after the respective object is removed.
While looking at the handling of color information, I noticed
that ObjectType entries were not cleaned up properly either once
the object got removed from the scene.

This patch does just that.
@davetcoleman
Copy link
Member

LGTM, thanks!

@davetcoleman davetcoleman merged commit e0106cd into moveit:kinetic-devel Feb 3, 2017
JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
Co-authored-by: Denis Stogl <denis.stogl@picknik.ai>
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