Repository navigation
Conversation
dvadovsz
marked this pull request as ready for review
December 2, 2026 22:40
getEntry() and set() resolve a key through SubTree remapping, _autoremap and the '@' root prefix, but unset() only looked at local storage. An UnsetBlackboard inside a SubTree on a remapped key, or on "@key", did nothing and still returned SUCCESS. Resolve the key in unset() the same way getEntry() does. A missing entry is still a no-op, and private keys starting with '_' are not autoremapped. Fixes BehaviorTree#1302 Co-Authored-By: David Vadovszki <david.vadovszki@picknik.ai>
dvadovsz
force-pushed
the
fix/blackboard-unset-follows-remap
branch
from
December 2, 2026 22:43
cbb9ed6 to
9bbfb83
Compare
dvadovsz
added a commit
to PickNikRobotics/BehaviorTree.CPP
that referenced
this pull request
Dec 2, 2026
getEntry() and set() resolve a key through SubTree remapping, _autoremap and the '@' root prefix, but unset() only looked at local storage. An UnsetBlackboard inside a SubTree on a remapped key, or on "@key", did nothing and still returned SUCCESS. Resolve the key in unset() the same way getEntry() does. A missing entry is still a no-op, and private keys starting with '_' are not autoremapped. Upstream: issue BehaviorTree#1302, PR BehaviorTree#1303. Drop this commit once a release carries it. Co-Authored-By: David Vadovszki <david.vadovszki@picknik.ai> (cherry picked from dvadovsz/BehaviorTree.CPP@9bbfb83)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1302.
unset()now resolves the key the same waygetEntry()does:@is removed from the root blackboard.internal_to_external_to the parent, or follows_autoremapunless it is a private_key.A missing entry is still a no-op. The local storage lock is released before recursing into the parent, so no two blackboard locks are held at once. A removed entry is still destroyed outside the lock.
Tests in
gtest_blackboard.cpp:UnsetBlackboardNodeClearsRemappedSubtreeVariable:UnsetBlackboardin a SubTree with an explicit remap, with_autoremap, and with@.UnsetAutoRemappingKeepsPrivateKeysLocal:_keys are not autoremapped.UnsetFollowsNestedRemapping: a key remapped through two SubTree levels.All three fail on
masterand pass with the fix. pre-commit and clang-tidy-21 are clean.Behavior change: unsetting a remapped key in a SubTree now removes the parent's entry. Anything subscribed to that entry with
subscribeToEntry()loses its subscription. This matches the existing doc comment ("unset() drops it"). There is no layout change and no new symbols.unset()stays inline in the header.