Skip to content

Commit

Permalink
prepare release 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Apr 28, 2024
1 parent 9bce572 commit 74b3a7a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 25 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@
Changelog for package behaviortree_cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* add tutorial 19 about the global blackboard
* renamed examples to match website
* Update TestNode and the corresponding tutorial
* bug fixes related to sequence_id and unit tests added
* Add string concatenation operator to scripting (`#802 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/802>`_)
* Add library alias for BT::behaviortree_cpp (`#808 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/808>`_)
* add Time Stamped blackboard (`#805 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/805>`_)
* add additional information and functionality to SQLiteLogger
* add syntax for entries in the root blackboard ("@" prefix)
* Fix/pixi build (`#791 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/791>`_)
* fix unit tests in Windows
* fix windows compilation
* Update cmake_windows.yml
* Deprecate Balckboard::clear(). Issue `#794 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/794>`_
* Support string vector conversion for ports (`#790 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/790>`_)
* add more convertToString for integers
* warn about overwritten enums
* fix ambiguous to_json
* Extend unit test for blackboard backup to run the second tree (`#789 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/789>`_)
* json convertion changed and
* issue `#755 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/755>`_ : add backchaining test and change reactive nodes checks (`#770 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/770>`_)
* Update switch_node.h
* test moved and port remapping fixed
* Create pull_request_template.md

* adding pre-commit
* handle enums conversions is assignment
* Contributors: Davide Faconti, Sean Geles, Sebastian Castro, Victor Massagué Respall, avikus-seonghyeon.kwon, tony-p

4.5.2 (2024-03-07)
------------------
* bugfix: string to enum/integer/boolean in scripts
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16.3) # version on Ubuntu Focal

project(behaviortree_cpp VERSION 4.5.2 LANGUAGES C CXX)
project(behaviortree_cpp VERSION 4.6.0 LANGUAGES C CXX)

set(CMAKE_CONFIG_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH}")
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
![License MIT](https://img.shields.io/github/license/BehaviorTree/BehaviorTree.CPP?color=blue)
![Version](https://img.shields.io/badge/version-4.5-blue.svg)
![Version](https://img.shields.io/badge/version-4.6-blue.svg)
[![conan Ubuntu](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_ubuntu.yml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_ubuntu.yml)
[![conan Windows](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_windows.yml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/cmake_windows.yml)
[![ros1](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1)
[![ros2](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2)
[![pixi (Conda)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml)

# BehaviorTree.CPP 4.5
# BehaviorTree.CPP 4.6

<p align="center"><img width=350 src="animated.svg"></p>

Expand Down Expand Up @@ -40,14 +40,6 @@ You can learn about the main concepts, the API and the tutorials here: https://w
If the documentation doesn't answer your questions and/or you want to
connect with the other **BT.CPP** users, visit [our forum](https://github.com/BehaviorTree/BehaviorTree.CPP/discussions)

## Previous version

Version 3.8 of the software can be found in the branch
[v3.8](https://github.com/BehaviorTree/BehaviorTree.CPP/tree/v3.8).

That branch might receive bug fixes, but the new features will be implemented
only in the master branch.

# GUI Editor

Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.
Expand Down Expand Up @@ -105,6 +97,13 @@ You can contact the primary author, **dfaconti@aurynrobotics.com**, to discuss y

[![Star History Chart](https://api.star-history.com/svg?repos=BehaviorTree/BehaviorTree.CPP&type=Date)](https://star-history.com/#BehaviorTree/BehaviorTree.CPP&Date)

## Previous version

Version 3.8 of the software can be found in the branch
[v3.8](https://github.com/BehaviorTree/BehaviorTree.CPP/tree/v3.8).

That branch might receive bug fixes, but the new features will be implemented
only in the master branch.

# License

Expand Down
18 changes: 7 additions & 11 deletions examples/t10_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,14 @@ int main()
// a certain set of transitions happened as expected
BT::TreeObserver observer(tree);

std::map<int, std::string> UID_to_path;

// Print the unique ID and the corresponding human readable path
// Path is also expected to be unique.
std::map<uint16_t, std::string> ordered_UID_to_path;
for(const auto& [name, uid] : observer.pathToUID())
{
ordered_UID_to_path[uid] = name;
}

for(const auto& [uid, name] : ordered_UID_to_path)
{
std::cout << uid << " -> " << name << std::endl;
}
tree.applyVisitor([&UID_to_path](BT::TreeNode* node) {
UID_to_path[node->UID()] = node->fullPath();
std::cout << node->UID() << " -> " << node->fullPath() << std::endl;
});

tree.tickWhileRunning();

Expand All @@ -73,7 +69,7 @@ int main()

std::cout << "----------------" << std::endl;
// print all the statistics
for(const auto& [uid, name] : ordered_UID_to_path)
for(const auto& [uid, name] : UID_to_path)
{
const auto& stats = observer.getStatistics(uid);

Expand Down
9 changes: 6 additions & 3 deletions examples/t19_global_blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ class PrintNumber : public BT::SyncActionNode
: BT::SyncActionNode(name, config)
{}

// You must override the virtual function tick()
NodeStatus tick() override
{
const int val = getInput<int>("val").value();
// If you prefer not having a port and accessing the top-level blackboard
// directly with an hardcoded address... you should question your own choices!
// But this is the way it is done
// val = config().blackboard-><int>("@value");
std::cout << "[" << name() << "] val: " << val << std::endl;
return NodeStatus::SUCCESS;
}

// It is mandatory to define this static method.
static BT::PortsList providedPorts()
{
return { BT::InputPort<int>("val") };
Expand All @@ -78,11 +80,12 @@ int main()

// No one "own" this blackboard
auto global_blackboard = BT::Blackboard::create();
// This blackboard will be owned by "MainTree". It parent is global_blackboard
// This blackboard will be owned by "MainTree". Its parent is global_blackboard
auto root_blackboard = BT::Blackboard::create(global_blackboard);

auto tree = factory.createTree("MainTree", root_blackboard);

// we can interact directly with global_blackboard
for(int i = 1; i <= 3; i++)
{
global_blackboard->set("value", i);
Expand Down
2 changes: 2 additions & 0 deletions include/behaviortree_cpp/blackboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class Blackboard
*/
void cloneInto(Blackboard& dst) const;

Blackboard::Ptr parent();

private:
mutable std::mutex mutex_;
mutable std::recursive_mutex entry_mutex_;
Expand Down
9 changes: 9 additions & 0 deletions src/blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ void Blackboard::cloneInto(Blackboard& dst) const
}
}

Blackboard::Ptr Blackboard::parent()
{
if(auto parent = parent_bb_.lock())
{
return parent;
}
return {};
}

std::shared_ptr<Blackboard::Entry> Blackboard::createEntryImpl(const std::string& key,
const TypeInfo& info)
{
Expand Down

0 comments on commit 74b3a7a

Please sign in to comment.