Skip to content

Consider adding default value option when registering blackboard keys #451

@sea-bass

Description

@sea-bass

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?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions