Skip to content

Commit

Permalink
Register transitions from primary states to errorProcessing
Browse files Browse the repository at this point in the history
Signed-off-by: thebyohazard <[email protected]>
  • Loading branch information
thebyohazard committed Apr 14, 2020
1 parent 94b5a1d commit 00ee6cb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions rcl_lifecycle/src/default_state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 00ee6cb

Please sign in to comment.