File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -187,15 +187,18 @@ void TreeExecutionServer::execute(
187
187
// cancel requested or by onLoopAfterTick()
188
188
auto stop_action = [this , &action_result](BT::NodeStatus status,
189
189
const std::string& message) {
190
- action_result->node_status = ConvertNodeStatus (status);
191
- action_result->return_message = message;
192
- RCLCPP_WARN (kLogger , action_result->return_message .c_str ());
193
190
p_->tree .haltTree ();
191
+ action_result->node_status = ConvertNodeStatus (status);
194
192
// override the message value if the user defined function returns it
195
193
if (auto msg = onTreeExecutionCompleted (status, true ))
196
194
{
197
195
action_result->return_message = msg.value ();
198
196
}
197
+ else
198
+ {
199
+ action_result->return_message = message;
200
+ }
201
+ RCLCPP_WARN (kLogger , action_result->return_message .c_str ());
199
202
};
200
203
201
204
while (rclcpp::ok () && status == BT::NodeStatus::RUNNING)
You can’t perform that action at this time.
0 commit comments