Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1d89c8

Browse files
committed
updated all the loggers
1 parent 7246614 commit f1d89c8

16 files changed

+447
-149
lines changed

examples/t05_crossdoor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ int main()
6666
auto tree = factory.createTreeFromText(xml_text);
6767

6868
// Create some loggers
69-
StdCoutLogger logger_cout(tree.root_node);
70-
MinitraceLogger logger_minitrace(tree.root_node, "bt_trace.json");
71-
FileLogger logger_file(tree.root_node, "bt_trace.fbl");
69+
StdCoutLogger logger_cout(tree);
70+
MinitraceLogger logger_minitrace(tree, "bt_trace.json");
71+
FileLogger logger_file(tree, "bt_trace.fbl");
7272
#ifdef ZMQ_FOUND
73-
PublisherZMQ publisher_zmq(tree.root_node);
73+
PublisherZMQ publisher_zmq(tree);
7474
#endif
7575

7676
printTreeRecursively(tree.root_node);

include/behaviortree_cpp/bt_factory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct Tree
5050
TreeNode* root_node;
5151
std::vector<TreeNode::Ptr> nodes;
5252
std::vector<Blackboard::Ptr> blackboard_stack;
53+
std::unordered_map<std::string, TreeNodeManifest> manifests;
5354

5455
Tree() : root_node(nullptr) { }
5556
~Tree();

include/behaviortree_cpp/loggers/BT_logger.fbs

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
namespace BT_Serialization;
1+
namespace Serialization;
22

3-
enum Status : byte {
3+
enum NodeStatus : byte {
44
IDLE = 0,
55
RUNNING,
66
SUCCESS,
77
FAILURE
88
}
99

10-
enum Type : byte {
10+
enum NodeType : byte {
1111
UNDEFINED = 0,
1212
ACTION,
1313
CONDITION,
@@ -16,38 +16,62 @@ enum Type : byte {
1616
SUBTREE
1717
}
1818

19-
struct Timestamp
19+
enum PortDirection : byte {
20+
INPUT = 0,
21+
OUTPUT,
22+
INOUT
23+
}
24+
25+
table PortModel
2026
{
21-
usec_since_epoch : uint64;
27+
port_name : string;
28+
direction : PortDirection;
29+
type_info : string;
30+
description: string;
2231
}
2332

2433
table PortConfig
2534
{
26-
port_name : string;
27-
value : string;
35+
port_name : string;
36+
remap : string;
2837
}
2938

3039
table TreeNode
3140
{
3241
uid : uint16;
3342
children_uid : [uint16];
34-
status : Status;
43+
status : NodeStatus;
3544
instance_name : string (required);
3645
registration_name : string (required);
37-
ports : [PortConfig];
46+
port_remaps : [PortConfig];
47+
}
48+
49+
table NodeModel
50+
{
51+
registration_name : string (required);
52+
type : NodeType;
53+
ports : [PortModel];
3854
}
3955

56+
4057
table BehaviorTree
4158
{
4259
root_uid : uint16;
4360
nodes : [TreeNode];
61+
node_models : [NodeModel];
62+
}
63+
64+
struct Timestamp
65+
{
66+
usec_since_epoch : uint64;
4467
}
4568

69+
4670
struct StatusChange
4771
{
4872
uid : uint16;
49-
prev_status : Status;
50-
status : Status;
73+
prev_status : NodeStatus;
74+
status : NodeStatus;
5175
timestamp : Timestamp;
5276
}
5377

0 commit comments

Comments
 (0)