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

Consider adding default value option when registering blackboard keys #451

Open
sea-bass opened this issue Sep 5, 2024 · 0 comments
Open

Comments

@sea-bass
Copy link
Collaborator

sea-bass commented Sep 5, 2024

My use case is having entries in the blackboard with default values, which is already implemented in other frameworks like BehaviorTree.CPP.

The best option I can think of is added a new kwarg to Client.register_key() like so.

client = py_trees.blackboard.Client()
client.register_key(
    "force_threshold",
    py_trees.common.Access.READ,
    default_value=42.0,
)

Implementation-wise, we'd have to be careful, as simply setting the value means this could override an actually set key.

So maybe something that checks if the key is set, else falls back to the default value (if one is set?).

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

No branches or pull requests

1 participant