Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions behaviortree_ros2/src/bt_executor_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ bt_server:
type: int,
default_value: 1667,
read_only: true,
description: "Server port value to publish Groot2 messages on",
description: "Server port value to publish Groot2 messages on. Set to 0 to disable.",
validation: {
bounds<>: [1, 49151]
bounds<>: [0, 49151]
}
}
plugins: {
Expand Down
7 changes: 5 additions & 2 deletions behaviortree_ros2/src/tree_execution_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ void TreeExecutionServer::execute(
// call user defined function after the tree has been created
onTreeCreated(p_->tree);
p_->groot_publisher.reset();
p_->groot_publisher =
std::make_shared<BT::Groot2Publisher>(p_->tree, p_->params.groot2_port);
const auto groot2_port = p_->params.groot2_port;
if(groot2_port > 0)
{
p_->groot_publisher = std::make_shared<BT::Groot2Publisher>(p_->tree, groot2_port);
}

// Loop until the tree is done or a cancel is requested
const auto period =
Expand Down