File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -187,15 +187,18 @@ void TreeExecutionServer::execute(
187187    //  cancel requested or by onLoopAfterTick()
188188    auto  stop_action = [this , &action_result](BT::NodeStatus status,
189189                                              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 ());
193190      p_->tree .haltTree ();
191+       action_result->node_status  = ConvertNodeStatus (status);
194192      //  override the message value if the user defined function returns it
195193      if (auto  msg = onTreeExecutionCompleted (status, true ))
196194      {
197195        action_result->return_message  = msg.value ();
198196      }
197+       else 
198+       {
199+         action_result->return_message  = message;
200+       }
201+       RCLCPP_WARN (kLogger , action_result->return_message .c_str ());
199202    };
200203
201204    while (rclcpp::ok () && status == BT::NodeStatus::RUNNING)
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments