Skip to content

4.2 : Important change in Sequence and Fallback!

Compare
Choose a tag to compare
@facontidavide facontidavide released this 23 May 10:40
· 314 commits to master since this release

Breaking change

Since version 4.0, the behavior of Sequence and Fallback was changes, compared to 3.x.

The new implementation would return RUNNING after executing a Synchronous child.

This new behavior was reverted in 4.2.
Now the default behavior is the same as 3.8.

If you want to use the new behavior, you should switch to AsyncSequence and AsyncFallback.

Thread-safe access to ports with reference semantic

It is not uncommon to store objects with reference semantic (for instance std::shared_ptr<T>) in the blackboard.

Unfortunately, this makes it impossible for the setter and getter of the Blackboard to make the access to the object T thread-safe.

We propose a solution to this problem that uses:

  • Blackboard::getAnyLocked
  • TreeNode::getLockedPortContent

These new interfaces return an object called AnyPtrLocked.

This contains the pointer to the object Any, but will also keep the a mutex locked as long as the object exist.

To see a practical example, check LoopNode and the example 4 (ex4_waypoints).

Other changes

  • New FileLogger2, replacing the old (and deprecated) one.
  • RunOnce node added.
  • Tree::getNodesByPath added.