Set error message when there is an invalid goal transition
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This commit is contained in:
parent
b301180872
commit
8de90f66aa
1 changed files with 4 additions and 0 deletions
|
@ -88,6 +88,10 @@ rcl_action_update_goal_state(
|
||||||
rcl_action_goal_state_t new_state = rcl_action_transition_goal_state(
|
rcl_action_goal_state_t new_state = rcl_action_transition_goal_state(
|
||||||
goal_handle->impl->state, goal_event);
|
goal_handle->impl->state, goal_event);
|
||||||
if (GOAL_STATE_UNKNOWN == new_state) {
|
if (GOAL_STATE_UNKNOWN == new_state) {
|
||||||
|
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
|
||||||
|
"goal_handle attempted invalid transition from state %d with event %d",
|
||||||
|
goal_handle->impl->state,
|
||||||
|
goal_event);
|
||||||
return RCL_RET_ACTION_GOAL_EVENT_INVALID;
|
return RCL_RET_ACTION_GOAL_EVENT_INVALID;
|
||||||
}
|
}
|
||||||
goal_handle->impl->state = new_state;
|
goal_handle->impl->state = new_state;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue