Skip to content

Commit caefcc2

Browse files
author
Tunglies
authored
[example] fixed old examples can not runs (#452)
1 parent c564a5f commit caefcc2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/examples/blackboard_behaviour.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ def update(self) -> py_trees.common.Status:
4141

4242
# could equivalently do directly via the Blackboard static methods if
4343
# not interested in tracking / visualising the application configuration
44-
configuration = py_trees.blackboard.Client(name="App Config")
45-
configuration.register_key("foo_parameters_init", access=py_trees.common.Access.WRITE)
46-
configuration.foo_parameters_init = 3
44+
# Register and set up the configuration on the blackboard
45+
configuration = py_trees.blackboard.Client(
46+
name="App Config", namespace="foo_parameters_"
47+
) # Added namespace
48+
configuration.register_key(
49+
"init", access=py_trees.common.Access.WRITE
50+
) # Register key with correct namespace
51+
configuration.init = 3 # Set the initial value for 'foo_parameters_init'
4752

4853
foo = Foo(name="The Foo")
4954
for i in range(1, 8):

0 commit comments

Comments
 (0)