Add an API to clear out cached static transforms. #523
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When calling sendTransform() on the StaticTransformBroadcaster
class, all transforms are cached internally. Subsequent calls
to sendTransform() will only add and republish those transforms
that are different from previously seen ones. This works well
for code that wants to "build up" a list of static transforms
from a diverse set of sources. (As a side note, there is a
bug in here where a second static transform between the same
two joints but with a different translation or rotation is
silently ignored. That should probably produce an error.)
However, this caching becomes a problem if a node ever wants
to remove joints during runtime. To facilitate this, add a
new clearTransforms() API that allows the caller to do this.
This has the potential to remove unrelated transforms, but
since it is an opt-in API, presumably the user knows what
they are doing. The first user of this will be robot_state_publisher,
which knows it is getting all of its static transforms from
a single URDF file.
Signed-off-by: Chris Lalancette clalancette@openrobotics.org
Still a draft because it needs further testing.