File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -405,6 +405,10 @@ LifecycleNode::LifecycleNodeInterfaceImpl::change_state(
405405 // keep the initial state to pass to a transition callback
406406 initial_state = State (state_machine_.current_state );
407407
408+ const rcl_lifecycle_transition_t * const original_transition =
409+ rcl_lifecycle_get_transition_by_id (state_machine_.current_state , transition_id);
410+
411+
408412 if (
409413 rcl_lifecycle_trigger_transition_by_id (
410414 &state_machine_, transition_id, publish_update) != RCL_RET_OK)
@@ -459,12 +463,15 @@ LifecycleNode::LifecycleNodeInterfaceImpl::change_state(
459463 // Update the internal current_state_
460464 current_state_ = State (state_machine_.current_state );
461465
462- // error handling ?!
466+ // error handling
463467 // TODO(karsten1987): iterate over possible ret value
464468 if (cb_return_code == node_interfaces::LifecycleNodeInterface::CallbackReturn::ERROR) {
465- RCLCPP_WARN (
466- node_logging_interface_->get_logger (),
467- " Error occurred while doing error handling." );
469+ if (original_transition) {
470+ RCLCPP_WARN (
471+ node_logging_interface_->get_logger (),
472+ " Callback returned ERROR during the transition: %s" , original_transition->label );
473+ }
474+
468475
469476 auto error_cb_code = execute_callback (current_state_id, initial_state);
470477 auto error_cb_label = get_label_for_return_code (error_cb_code);
You can’t perform that action at this time.
0 commit comments