Skip to content

Commit

Permalink
[display] bugfix off-the-grid bb client nodes, skyblue for exclusive …
Browse files Browse the repository at this point in the history
…edges
  • Loading branch information
Matt Sprague authored and stonier committed Jan 22, 2023
1 parent a692175 commit a6529f5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Release Notes

Forthcoming
-----------
* [display] bugfix off-the-grid bb nodes and render exclusive write edges, `https://github.com/splintered-reality/py_trees/pull/383`_
* [tests] it's mypy now, by the time this ends, it'll be someone else's py , `https://github.com/splintered-reality/py_trees/pull/380`_
* [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), `#376 <https://github.com/splintered-reality/py_trees/pull/376>`_
* [behaviours, decorators, composites] abstract base classes, `#375 <https://github.com/splintered-reality/py_trees/pull/375>`_
* [behaviours] StatusSequence -> StatusQueue, `#372 <https://github.com/splintered-reality/py_trees/pull/372>`_
Expand Down
2 changes: 1 addition & 1 deletion py_trees/demos/blackboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def main() -> None:
py_trees.blackboard.Blackboard.enable_activity_stream(maximum_size=100)
blackboard = py_trees.blackboard.Client(name="Configuration")
blackboard.register_key(key="dude", access=py_trees.common.Access.WRITE)
blackboard.register_key(key="/parameters/default_speed", access=py_trees.common.Access.WRITE)
blackboard.register_key(key="/parameters/default_speed", access=py_trees.common.Access.EXCLUSIVE_WRITE)
blackboard.dude = "Bob"
blackboard.parameters.default_speed = 30.0

Expand Down
23 changes: 20 additions & 3 deletions py_trees/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ def add_blackboard_nodes(blackboard_id_name_map: typing.Dict[uuid.UUID, str]) ->
label="Blackboard",
rank="sink",
)

for unique_identifier, client_name in clients.items():
if unique_identifier not in blackboard_id_name_map:
subgraph.add_node(
Expand Down Expand Up @@ -619,7 +618,7 @@ def add_blackboard_nodes(blackboard_id_name_map: typing.Dict[uuid.UUID, str]) ->
except KeyError:
edge = pydot.Edge(
blackboard_node,
clients[unique_identifier].__getattribute__("name"),
clients[unique_identifier],
color="green",
constraint=False,
weight=0,
Expand All @@ -636,13 +635,31 @@ def add_blackboard_nodes(blackboard_id_name_map: typing.Dict[uuid.UUID, str]) ->
)
except KeyError:
edge = pydot.Edge(
clients[unique_identifier].__getattribute__("name"),
clients[unique_identifier],
blackboard_node,
color=blackboard_colour,
constraint=False,
weight=0,
)
graph.add_edge(edge)
for unique_identifier in metadata[key].exclusive:
try:
edge = pydot.Edge(
blackboard_id_name_map[unique_identifier],
blackboard_node,
color="deepskyblue",
constraint=False,
weight=0,
)
except KeyError:
edge = pydot.Edge(
clients[unique_identifier],
blackboard_node,
color="deepskyblue",
constraint=False,
weight=0,
)
graph.add_edge(edge)
graph.add_subgraph(subgraph)

if with_blackboard_variables:
Expand Down

0 comments on commit a6529f5

Please sign in to comment.