Skip to content

Commit ed62064

Browse files
devis12adrianabasbous
authored andcommitted
BBInit in tree execution server for ExecuteTree action
1 parent 55b9688 commit ed62064

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

behaviortree_ros2/src/tree_execution_server.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ void TreeExecutionServer::execute(
204204
// Handle non-JSON payload case
205205
}
206206

207+
for(const auto& bb_entry : goal->bb_init)
208+
{
209+
RCLCPP_INFO(kLogger, "Setting blackboard key \"%s\" to \"%s\"", bb_entry.key.c_str(), bb_entry.value.c_str());
210+
root_blackboard->set(bb_entry.key, bb_entry.value);
211+
}
212+
207213
// call user defined function after the tree has been created
208214
onTreeCreated(p_->tree);
209215
p_->groot_publisher.reset();

btcpp_ros2_interfaces/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ find_package(rosidl_default_generators REQUIRED)
99

1010
rosidl_generate_interfaces(btcpp_ros2_interfaces
1111
"msg/NodeStatus.msg"
12+
"msg/BBEntry.msg"
1213
"msg/CustomMsg.msg"
1314
"action/ExecuteTree.action"
1415
"action/Sleep.action")

btcpp_ros2_interfaces/action/ExecuteTree.action

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Name of the tree to execute
44
string target_tree
5+
BBEntry[] bb_init
56
# Optional, implementation-dependent, payload.
67
string payload
78
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
string key
2+
string value

0 commit comments

Comments
 (0)