File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
include/behaviortree_cpp/actions Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ struct TestNodeConfig
3737 // / if async_delay > 0, this action become asynchronous and wait this amount of time
3838 std::chrono::milliseconds async_delay = std::chrono::milliseconds(0 );
3939
40- // / Function invoked when the action is completed. By default just return [return_status]
41- // / Override it to intorduce more comple cases
42- std::function<NodeStatus(void )> complete_func = [ this ]() { return return_status; } ;
40+ // / Function invoked when the action is completed.
41+ // / If not specified, the node will return [return_status]
42+ std::function<NodeStatus(void )> complete_func;
4343};
4444
4545/* *
Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ BT::NodeStatus BT::TestNode::onCompleted()
6868{
6969 Ast::Environment env = { config ().blackboard , config ().enums };
7070
71- auto status = _test_config.complete_func ();
71+ auto status = (_test_config.complete_func ) ? _test_config.complete_func () :
72+ _test_config.return_status ;
7273 if (status == NodeStatus::SUCCESS && _success_executor)
7374 {
7475 _success_executor (env);
You can’t perform that action at this time.
0 commit comments