From a27ac818fad319b75b5e972dfc747af1be22d036 Mon Sep 17 00:00:00 2001 From: thebyohazard <> Date: Mon, 13 Apr 2020 15:21:55 -0500 Subject: [PATCH] Register transitions from primary states to errorProcessing Signed-off-by: thebyohazard --- rcl_lifecycle/src/default_state_machine.c | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/rcl_lifecycle/src/default_state_machine.c b/rcl_lifecycle/src/default_state_machine.c index 20272b5a57..5f5def3c8f 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 = {