diff --git a/rcl_lifecycle/src/default_state_machine.c b/rcl_lifecycle/src/default_state_machine.c index 20272b5a5..5f5def3c8 100644 --- a/rcl_lifecycle/src/default_state_machine.c +++ b/rcl_lifecycle/src/default_state_machine.c @@ -36,6 +36,7 @@ const char * rcl_lifecycle_cleanup_label = "cleanup"; const char * rcl_lifecycle_activate_label = "activate"; const char * rcl_lifecycle_deactivate_label = "deactivate"; const char * rcl_lifecycle_shutdown_label = "shutdown"; +const char * rcl_lifecycle_error_label = "error"; const char * rcl_lifecycle_transition_success_label = "transition_success"; const char * rcl_lifecycle_transition_failure_label = "transition_failure"; @@ -391,6 +392,22 @@ _register_transitions( } } + // register transition from inactive to errorprocessing + { + rcl_lifecycle_transition_t rcl_transition_inactive_error = { + rcl_lifecycle_error_label, + lifecycle_msgs__msg__Transition__TRANSITION_INACTIVE_ERROR, + inactive_state, errorprocessing_state + }; + ret = rcl_lifecycle_register_transition( + transition_map, + rcl_transition_inactive_error, + allocator); + if (ret != RCL_RET_OK) { + return ret; + } + } + // register transition from activating to active { rcl_lifecycle_transition_t rcl_transition_on_activate_success = { @@ -455,6 +472,22 @@ _register_transitions( } } + // register transition from active to errorprocessing + { + rcl_lifecycle_transition_t rcl_transition_active_error = { + rcl_lifecycle_error_label, + lifecycle_msgs__msg__Transition__TRANSITION_ACTIVE_ERROR, + active_state, errorprocessing_state + }; + ret = rcl_lifecycle_register_transition( + transition_map, + rcl_transition_active_error, + allocator); + if (ret != RCL_RET_OK) { + return ret; + } + } + // register transition from deactivating to inactive { rcl_lifecycle_transition_t rcl_transition_on_deactivate_success = {