Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary state error transitions #618

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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