Skip to content

4.6: Lot of new features and tutorials

Compare
Choose a tag to compare
@facontidavide facontidavide released this 28 Apr 14:17
· 14 commits to master since this release

This release includes a lot of important changes. This is a non comprehensive list.

With my great surprise, this release seems to be ABI compatible with 4.5.2

Default behavior of ReactiveSequence and ReactiveFallback

ReactiveSequence and ReactiveFallback are unfortunately hard to use correctly.
There was a long discussion about what should happen when one of these nodes has multiple asynchronous children and there is no easy answer.

The default behavior is not more similar to version 3.8, but this also means that users must be very careful.
Read this issue for details: #755

The "global blackboard" idiom

We introduce here a new idiom and syntax: the global blackboard.
Usually each Subtree (including the main tree) has its own blackboard, isolated from the others, unless we do remapping.

We additionally provide a top-level blackboard that can be accessed from everywhere, without any manual remapping, using the prefix "@"

See example: https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t19_global_blackboard.cpp

Entries of the blackboard are now timestamped!

We added a timestamp and a sequence number to each entry in the blackboard (both updated when we set the value).

This allow use to determine if the value we are reading in the blackboard is "new" (since the last time we accessed it) or "obsolate".

We added the methods Blackboard::getStamped and TreeNode::getInputStamped.

Additionally, we added 3 new builtin nodes that use this functionality:

  • SkipUnlessUpdated: decorator that skip the execution of the children unless an entry was updated, since the last time.
  • WaitValueUpdate: decorator that remains in RUNNING state, unless an entry was updated. Executes the child if it did.
  • WasEntryUpdated: action that returns SUCCESS if an entry was updated, FAILURE otherwise.

String + number concatenation in the scripting language

Details: #802

We use the operator ".." to concatenate strings and numbers (inspired by Lua).
Give this:

prefix := 'value_';
val := 42;
str:= prefix .. val

The variable "str" should contain the string "value_42"

Enhanced SQlite logger

We added a method to send comands directly to the database and to append extra information to a state transition in the Transitions table.

See example https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t16_sqlite_log.cpp

Refactored API to register JSON convertions.

We simplified the way a custom type can be converted from/to JSON. See the example here:
https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t11_groot_howto.cpp#L13-L27

Blackup / restore a blackboard state.

Related somehow to the JSON convertion mentioned earlier.
We add some methods to save/load the state of a blackboard. usefull if you want to reset it correctly, withour destrying it and rebuilding it from scratch.

See this tutorial: https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t17_blackboard_backup.cpp

convertToString

Added more convertToString specializations