Skip to content

Commit 74b3a7a

Browse files
committed
prepare release 4.6
1 parent 9bce572 commit 74b3a7a

File tree

7 files changed

+65
-25
lines changed

7 files changed

+65
-25
lines changed

Diff for: CHANGELOG.rst

+31
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22
Changelog for package behaviortree_cpp
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
Forthcoming
6+
-----------
7+
* add tutorial 19 about the global blackboard
8+
* renamed examples to match website
9+
* Update TestNode and the corresponding tutorial
10+
* bug fixes related to sequence_id and unit tests added
11+
* Add string concatenation operator to scripting (`#802 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/802>`_)
12+
* Add library alias for BT::behaviortree_cpp (`#808 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/808>`_)
13+
* add Time Stamped blackboard (`#805 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/805>`_)
14+
* add additional information and functionality to SQLiteLogger
15+
* add syntax for entries in the root blackboard ("@" prefix)
16+
* Fix/pixi build (`#791 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/791>`_)
17+
* fix unit tests in Windows
18+
* fix windows compilation
19+
* Update cmake_windows.yml
20+
* Deprecate Balckboard::clear(). Issue `#794 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/794>`_
21+
* Support string vector conversion for ports (`#790 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/790>`_)
22+
* add more convertToString for integers
23+
* warn about overwritten enums
24+
* fix ambiguous to_json
25+
* Extend unit test for blackboard backup to run the second tree (`#789 <https://github.com/BehaviorTree/BehaviorTree.CPP/issues/789>`_)
26+
* json convertion changed and
27+
* 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>`_)
28+
* Update switch_node.h
29+
* test moved and port remapping fixed
30+
* Create pull_request_template.md
31+
32+
* adding pre-commit
33+
* handle enums conversions is assignment
34+
* Contributors: Davide Faconti, Sean Geles, Sebastian Castro, Victor Massagué Respall, avikus-seonghyeon.kwon, tony-p
35+
536
4.5.2 (2024-03-07)
637
------------------
738
* bugfix: string to enum/integer/boolean in scripts

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.16.3) # version on Ubuntu Focal
22

3-
project(behaviortree_cpp VERSION 4.5.2 LANGUAGES C CXX)
3+
project(behaviortree_cpp VERSION 4.6.0 LANGUAGES C CXX)
44

55
set(CMAKE_CONFIG_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
66
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH}")

Diff for: README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
![License MIT](https://img.shields.io/github/license/BehaviorTree/BehaviorTree.CPP?color=blue)
2-
![Version](https://img.shields.io/badge/version-4.5-blue.svg)
2+
![Version](https://img.shields.io/badge/version-4.6-blue.svg)
33
[![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)
44
[![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)
55
[![ros1](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1)
66
[![ros2](https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2)
77
[![pixi (Conda)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml/badge.svg)](https://github.com/BehaviorTree/BehaviorTree.CPP/actions/workflows/pixi.yaml)
88

9-
# BehaviorTree.CPP 4.5
9+
# BehaviorTree.CPP 4.6
1010

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

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

43-
## Previous version
44-
45-
Version 3.8 of the software can be found in the branch
46-
[v3.8](https://github.com/BehaviorTree/BehaviorTree.CPP/tree/v3.8).
47-
48-
That branch might receive bug fixes, but the new features will be implemented
49-
only in the master branch.
50-
5143
# GUI Editor
5244

5345
Editing a BehaviorTree is as simple as editing an XML file in your favorite text editor.
@@ -105,6 +97,13 @@ You can contact the primary author, **[email protected]**, to discuss y
10597

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

100+
## Previous version
101+
102+
Version 3.8 of the software can be found in the branch
103+
[v3.8](https://github.com/BehaviorTree/BehaviorTree.CPP/tree/v3.8).
104+
105+
That branch might receive bug fixes, but the new features will be implemented
106+
only in the master branch.
108107

109108
# License
110109

Diff for: examples/t10_observer.cpp

+7-11
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,14 @@ int main()
5252
// a certain set of transitions happened as expected
5353
BT::TreeObserver observer(tree);
5454

55+
std::map<int, std::string> UID_to_path;
56+
5557
// Print the unique ID and the corresponding human readable path
5658
// Path is also expected to be unique.
57-
std::map<uint16_t, std::string> ordered_UID_to_path;
58-
for(const auto& [name, uid] : observer.pathToUID())
59-
{
60-
ordered_UID_to_path[uid] = name;
61-
}
62-
63-
for(const auto& [uid, name] : ordered_UID_to_path)
64-
{
65-
std::cout << uid << " -> " << name << std::endl;
66-
}
59+
tree.applyVisitor([&UID_to_path](BT::TreeNode* node) {
60+
UID_to_path[node->UID()] = node->fullPath();
61+
std::cout << node->UID() << " -> " << node->fullPath() << std::endl;
62+
});
6763

6864
tree.tickWhileRunning();
6965

@@ -73,7 +69,7 @@ int main()
7369

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

Diff for: examples/t19_global_blackboard.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ class PrintNumber : public BT::SyncActionNode
5353
: BT::SyncActionNode(name, config)
5454
{}
5555

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

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

7981
// No one "own" this blackboard
8082
auto global_blackboard = BT::Blackboard::create();
81-
// This blackboard will be owned by "MainTree". It parent is global_blackboard
83+
// This blackboard will be owned by "MainTree". Its parent is global_blackboard
8284
auto root_blackboard = BT::Blackboard::create(global_blackboard);
8385

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

88+
// we can interact directly with global_blackboard
8689
for(int i = 1; i <= 3; i++)
8790
{
8891
global_blackboard->set("value", i);

Diff for: include/behaviortree_cpp/blackboard.h

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class Blackboard
133133
*/
134134
void cloneInto(Blackboard& dst) const;
135135

136+
Blackboard::Ptr parent();
137+
136138
private:
137139
mutable std::mutex mutex_;
138140
mutable std::recursive_mutex entry_mutex_;

Diff for: src/blackboard.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ void Blackboard::cloneInto(Blackboard& dst) const
210210
}
211211
}
212212

213+
Blackboard::Ptr Blackboard::parent()
214+
{
215+
if(auto parent = parent_bb_.lock())
216+
{
217+
return parent;
218+
}
219+
return {};
220+
}
221+
213222
std::shared_ptr<Blackboard::Entry> Blackboard::createEntryImpl(const std::string& key,
214223
const TypeInfo& info)
215224
{

0 commit comments

Comments
 (0)