diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d38a0752..f7e2bf72 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 `_ * [behaviours, decorators, composites] abstract base classes, `#375 `_ * [behaviours] StatusSequence -> StatusQueue, `#372 `_ diff --git a/py_trees/demos/blackboard.py b/py_trees/demos/blackboard.py index 32b639f3..677ac958 100644 --- a/py_trees/demos/blackboard.py +++ b/py_trees/demos/blackboard.py @@ -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 diff --git a/py_trees/display.py b/py_trees/display.py index 72344891..b2b9d289 100644 --- a/py_trees/display.py +++ b/py_trees/display.py @@ -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( @@ -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, @@ -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: