File tree 2 files changed +5
-4
lines changed
include/behaviortree_cpp/actions
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ struct TestNodeConfig
37
37
// / if async_delay > 0, this action become asynchronous and wait this amount of time
38
38
std::chrono::milliseconds async_delay = std::chrono::milliseconds(0 );
39
39
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;
43
43
};
44
44
45
45
/* *
Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ BT::NodeStatus BT::TestNode::onCompleted()
68
68
{
69
69
Ast::Environment env = { config ().blackboard , config ().enums };
70
70
71
- auto status = _test_config.complete_func ();
71
+ auto status = (_test_config.complete_func ) ? _test_config.complete_func () :
72
+ _test_config.return_status ;
72
73
if (status == NodeStatus::SUCCESS && _success_executor)
73
74
{
74
75
_success_executor (env);
You can’t perform that action at this time.
0 commit comments