- ...
- [decorators] a passthrough for debugging and visualisation, #407
- [docs] 2.2.x release documentation, bugfix for graphviz on read-the-docs, #400
Headline Feature
- [composites] sequences and selectors with and without memory (previously experimental in 2.1.6)
This can become confusing, so pay attention and let's define some terminology:
Without Memory - ticking starts with the **first** child
With Memory - ticking attempts to start with the **current** child
Whether the current child exists or not, the composite will always follow the logic above. The only bearing that the current child has on proceedings is in what happens next. Without memory, if the current child is reached, it will tick it without re-initialising it since it is already RUNNING (all other children are not RUNNING and subsequently will be re-initialised). With memory, if no current child is found on that first tick, it will fall back to starting with the first child.
Previously Selectors operated without memory and Sequences with memory. Now both composites support both paradigms. Not only does this bring a pleasing symmetry to the universe that his noodliness would approve of, but it does unlock several practical use cases that previously required rather complex idioms (combinations of behaviours / subtrees).
Refer to the Eternal Guard Demo for an example of a practically useful idiom with two Sequences, one with and the other without memory.
Other New Features
- [decorators] Repeat and Retry, #371
- [devenv] much improved development environment, comprehensive formatting, linting, type-checking and testing
Breaking API
- [behaviours, decorators] behaviours.Count -> behaviours.StatusQueue + decorators.Count (new), #376
- [behaviours] StatusSequence -> StatusQueue, #372
- [behaviours, decorators, composites] abstract base classes, #375
- [composites] use explicit composite arguments, #370
The latter is a theme adopted more liberally across (most) of the py_trees library. As this library has grown, it's become apparent that being explicit about passing arguments to constructors is more important than the convenience of eliminating a few characters. Not only does it prevent bugs, it eases refactoring and greatly improves readability of the code. In fact, you'll save time in the long run.
# This:
parallel = py_trees.composite.Parallel(
name="Parallel",
policy=py_trees.common.ParallelPolicy.SuccessOnAll()
)
# Is better than:
parallel = py_trees.composite.Parallel()
When upgrading, if you don't regularly pass in arguments with keywords, i.e. you do Parallel("Foo")
instead of
Parallel(name="Foo")
, be on the lookout for bugs created by the ordering having changed in the method signatures.
Quite often the argument for name
had a default and was at the end of the line. With these changes it has moved
to the front of the line in order to adopt a consistent convention across the whole library.
Bugfixes
- [display] bugfix off-the-grid bb nodes and render exclusive write edges, #383
- [common] a practical inf, #366
- [composites] avoid redundant stop for non-running children #360
- [display] bugfix unicode use when no unicode for dot #359
- [composites] restart the sequence, but allow children to retain their state #368
- [tests] mypy conformance, #327
- [composites] show ghost states for sequence children, #330 (reverts behaviour introduced in #325)
- [composites] sequences w/o memory, #325
- [composites] selectors with memory, #324
- [display] unicode trees are unicode, not ascii #324
- [behaviours] added BlackboardToStatus, #320
- [idioms] bugfix lost append in blackboard names for either_or, #319
- [docs] contributing guidelines added, #315
- [blackboard] convenience absolute_name() api for blackboard clients, #306
- [sequences] bugfix current child setting whilst moving through children, #304
- [behaviours] generators for variable values in SetBlackboardVariable, #300
- [behaviours] CheckBlackboardVariableValue, WaitForBlackboardVariableValue use comparison expressins, #296
- [idioms] eternal_guard uses blackboard_names (previously blackboard_name_prefix), #295
- [composites] Chooser deprecated, #293
- [composites] chain-able add_children for all composites, #290
- [behaviours] generators for variable values in SetBlackboardVariable, #300
- [composites] fix current_child problems on dynamic child insertion/removal, #289
- [blackboard] bugfix metadata not created on static set, #286
- [composites] parallel bugfix to invalidate correctly, #285
- [idioms] the either_or pattern, designed to replace the Chooser, #283
- [behaviours] TickCounter, a timer based on tree ticks, #283
- [behaviours] CheckBlackboardVariableValues, logical checks across multiple values, #283
- [common] ComparisonExpression, a more concise way of storing checkers, #283
- [composites] protect against adding a child to multiple parents, #281
- [display] completely remove blackboard variables from the dot layout, #280
- [trees] setup timeout error with last behaviour name included in the error message, #279
- [blackboard] rooted variables in namespaced clients working as designed, fixed docs, #277
- [demos] display modes demonstrating usage of various options, #275
- [display] enforce left to right ordering of children in dot graphs
- [display] bugfix and use elipsis on ascii visited only display modes, #273
- [display] option for only visited behaviours in text tree snapshot displays, #272
- [display] enum agnostic display for local and remote activity view displays
- [display] optional show_title in unicode_blackboard_activity_stream
- [trees] revert to using user signals if available to avoid shenanigans with SIGINT, #264
- [trees] play nicely, reset signal handlers after setup, #262
- [visitors] bugfix the snapshot visitor to look for exclusive write keys as well
- [blackboard] static methods have a namespace too (root), use absolute names, #261
- [blackboard] do not register keys on the client when xclusive write aborts the process, #261
The 2.0.x release wraps up the experimental blackboard improvements being rolled out in 1.3.x and 1.4.x. At this point, the changes to the blackboard framework are so extensive it makes sense to release it with a major version bump and to consider the 1.2.x release as the official goto release for the 1.x.y series.
New Features
- [blackboard] exclusive write access, #260
- [blackboard] key remappings, #259
- [blackboard] formalise namespaces with separators, #256
- [blackboard] distinguish primitives vs nested for refined read activity detection, #255
See the 1.3.x and 1.4.x changelog notes for additional details.
Breaking API
- [blackboard] fixed read/write ambiguity, now use
py_trees.common.Access
, #250
# Previously
self.blackboard.register_key(key="foo", write=True)
# Now
self.blackboard.register_key(key="foo", access=py_trees.common.Access.WRITE)
- [blackboard] drop
SubBlackboard
, it has problems, #249
New Features
- [blackboard] namespaced blackboard clients, #250
# Previously, a single blackboard client exists per behaviour
# Now, no blackboard client on construction, instead attach on demand:
self.blackboard = self.attach_blackboard_client(name="Foo")
self.parameters = self.attach_blackboard_client(
name="FooParams",
namespace="parameters_foo_"
)
self.state = self.attach_blackboard_client(
name="FooState",
namespace="state_foo_"
)
# create a local key 'speed' that maps to 'state_foo_speed' on the blackboard
self.state.register_key(key="speed", access=py_trees.common.Access.WRITE)
self.state.speed = 30.0
- [blackboard] required keys and batch verification method, #254
self.blackboard = self.attach_blackboard_client(name="Foo")
self.blackboard.register_key(name="foo", access=py_trees.common.Access.READ, required=True)
# ...
self.verify_required_keys_exist() # KeyError if any required keys do not yet exist on the blackboard
- [visitors]
SnapshotVisitor
tracking blackboards on the visited path, #250
# Previously tangled in DisplaySnapshotVisitor:
display_snapshot_visitor.visited.keys() # blackboard client uuid's (also behaviour uuid's), typing.Set[uuid.UUID]
display_snapshot_visitor.visited_keys # blackboard keys, typing.Set[str]
# Now in SnapshotVisitor:
snapshot_visitor.visited_blackboard_client_ids # typing.Set[uuid.UUID]
snapshot_visitor.visited_blackboard_keys # typing.Set[str]
- [blackboard] client
Blackboard.unregister_key()
method
- [blackboard] global
Blackboard.clear()
method
- [blackboard] don't do any copying, just pass handles around, #239
- [blackboard] client
exists()
method, #238 - [blackboard] global
Blackboard.set()
method - [blackboard] client
Blackboard.unset()
method, #239
Breaking API
- [decorators] updated
EternalGuard
to accommodate new blackboard variable tracking mechanisms - [behaviours] blackboard behaviours decoupled -
CheckBlackboardVariableExists
,WaitForBlackboardVariable
- [behaviours] blackboard behaviours decoupled -
CheckBlackboardVariableValue
,WaitForBlackboardVariableValue
- [behaviours] blackboard behaviours dropped use of the largely redundant
ClearingPolicy
- [visitors] collapsed
SnapshotVisitor
andWindsOfChangeVisitor
functionality, #228
New Features
- [blackboard] read/write access configuration for clients on blackboard keys
- [blackboard] log the activity on the blackboard
- [display] dot graphs now have an option to display blackboard variables
- [display] unicode to console the entire blackboard key-value store
- [display] unicode to console the blackboard activity stream
- [visitors] new
DisplaySnapshotVisitor
to simplify collection/printing the tree to console, #228
Bugfixes
- [infra] only require test html reports on circle ci builds (saves a dependency requirement), #229
- [trees] standalone
setup()
method with timer for use on unmanaged trees, #198 - [examples] fix api in
skeleton_tree.py
, #199
- [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195
Breaking API
- [trees] removes the curious looking and unused
destroy()
method, #193 - [display]
ascii_tree
->ascii_tree
/unicode_tree()
, no longer subverts the choice depending on your stdout, #192 - [display]
dot_graph
->dot_tree
for consistency with the text tree methods, #192
New Features
- [behaviour]
shutdown()
method to complimentsetup()
, #193 - [decorators]
StatusToBlackboard
reflects the status of it's child to the blackboard, #195 - [decorators]
EternalGuard
decorator that continuously guards a subtree (c.f. Unreal conditions), #195 - [display]
xhtml_tree
provides an xhtml compatible equivalent to theascii_tree
representation, #192 - [idioms]
eternal_guard
counterpart to the decorator whose conditions are behaviours, #195 - [trees] walks the tree calling
shutdown()
on each node in it's ownshutdown()
method, #193 - [visitors] get a
finalise()
method called immediately prior to post tick handlers, #191
Breaking API
- [display] print_ascii_tree -> ascii_tree, #178.
- [display] generate_pydot_graph -> dot_graph, #178.
- [trees] tick_tock(sleep_ms, ..) -> tick_tock(period_ms, ...), #182.
New Features
- [trees] add missing
add_visitor()
method - [trees] flexible
setup()
for children via kwargs - [trees] convenience method for ascii tree debugging
- [display] highlight the tip in ascii tree snapshots
Bugfixes
- [trees] threaded timers for setup (avoids multiprocessing problems)
- [behaviour|composites] bugfix tip behaviour, add tests
- [display] correct first indent when non-zero in ascii_tree
- [display] apply same formatting to root as children in ascii_tree
- [display] optional arguments for generate_pydot_graph
- [decorators] fix missing root feedback message in ascii graphs
- [decorators] fix timeout bug that doesn't respect a child's last tick
- [display] drop spline curves, it's buggy with graphviz 2.38
- [visitors] winds of change visitor and logging demo
- [console] fallbacks for unicode chars when (UTF-8) encoding cannot support them
- [trees] don't use multiprocess on setup if not using timeouts
Breaking API
- [behaviour] setup() no longer returns a boolean, catch exceptions instead, #143.
- [behaviour] setup() no longer takes timeouts, responsibility moved to BehaviourTree, #148.
- [decorators] new-style decorators found in py_trees.decorators
- [decorators] new-style decorators stop their running child on completion (SUCCESS||FAILURE)
- [decorators] old-style decorators in py_trees.meta deprecated
New Features
- [blackboard] added a method for clearing the entire blackboard (useful for tests)
- [composites] raise TypeError when children's setup methods don't return a bool (common mistake)
- [composites] new parallel policies, SuccessOnAll, SuccessOnSelected
- [decorators] oneshot policies for activating on completion or successful completion only
- [meta] behaviours from functions can now automagically generate names
Breaking API
- Lower level namespace types no longer exist (PR117), e.g.
py_trees.Status
->py_trees.common.Status
- Python2 support dropped
New Features
- [idioms] 'Pick Up Where You Left Off'
- [idioms] 'OneShot'
- [infra] shortcuts to types in __init__.py removed (PR117)
- [bugfix] python3 rosdeps
- [idioms] pick_up_where_you_left_off added
- [idioms] oneshot added
- [bugfix] properly set/reset parents when replacing/removing children in composites
- [announce] python3 only support from this point forward
- [announce] now compatible for ros2 projects
- [bugfix] pick up missing feedback messages in inverters
- [bugfix] eliminate costly/spammy blackboard variable check feedback message
- [bugfix] replace awkward newlines with spaces in ascii trees
- [bugfix] don't send the parellel's status to running children, invalidate them instead
- [bugfix] oneshot now reacts to priority interrupts correctly
- [bugfix] oneshot no longer permanently modifies the original class
- [infra] python 2/3 compatibility
- [meta] add children monkeypatching for composite imposters
- [blackboard] check for nested variables in WaitForBlackboard
- [docs] bugfix image links and rewrite the motivation
- [infra] setup.py tests_require, not test_require
- [infra] update maintainer email
- [docs] many minor doc updates
- [meta] bugfix so that imposter now ticks over composite children
- [trees] method for getting the tip of the tree
- [programs] py-trees-render program added
- [infra] handle pypi/catkin conflicts with install_requires
- [docs] disable colour when building
- [docs] sidebar headings
- [docs] dont require project installation
- [infra] pypi package enabled
- [ros] components moved to py_trees_ros
- [timeout] bugfix to ensure timeout decorator initialises properly
- [docs] rolled over with napolean style
- [docs] sphinx documentation updated
- [imposter] make sure tip() drills down into composites
- [demos] re-organised into modules
- [trees] add pre/post handlers after setup, just in case setup fails
- [introspection] do parent lookups so you can crawl back up a tree
- [blackboard] permit init of subscriber2blackboard behaviours
- [blackboard] watchers
- [timers] better feedback messages
- [imposter] ensure stop() directly calls the composited behaviour
failure_is_running decorator
(meta).
- do terminate properly amongst relevant classes
- blackboxes
- chooser variant of selectors
- bugfix the decorators
- blackboard updates on change only
- improved dot graph creation
- many bugfixes to composites
- subscriber behaviours
- timer behaviours
- one shot sequences
- abort() renamed more appropriately to stop()
- lots of bugfixing stabilising py_trees for the spain field test
- complement decorator for behaviours
- dot tree views
- ascii tree and tick views
- use generators and visitors to more efficiently walk/introspect trees
- a first implementation of behaviour trees in python