Skip to content

Commit

Permalink
moved descriptions to type.c/.h
Browse files Browse the repository at this point in the history
  • Loading branch information
skucheria committed May 21, 2019
1 parent d8517c4 commit 4375391
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 0 additions & 4 deletions rcl_action/include/rcl_action/goal_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ extern "C"
/// Internal rcl action goal implementation struct.
struct rcl_action_goal_handle_impl_t;

/// User friendly error messages for invalid trasntions
extern const char * goal_state_descriptions[];
extern const char * goal_event_descriptions[];

/// Goal handle for an action.
typedef struct rcl_action_goal_handle_t
{
Expand Down
4 changes: 4 additions & 0 deletions rcl_action/include/rcl_action/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ typedef int8_t rcl_action_goal_state_t;
#define GOAL_STATE_ABORTED action_msgs__msg__GoalStatus__STATUS_ABORTED
#define GOAL_STATE_NUM_STATES 7

/// User friendly error messages for invalid trasntions
// Description variables in types.c should be changed if enum values change
extern const char * goal_state_descriptions[];
extern const char * goal_event_descriptions[];

/// Goal state transition events
typedef enum rcl_action_goal_event_t
Expand Down
7 changes: 0 additions & 7 deletions rcl_action/src/rcl_action/goal_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ extern "C"
#include "rcl/rcl.h"
#include "rcl/error_handling.h"

const char * goal_state_descriptions[] =
{"UNKNOWN", "ACCEPTED", "EXECUTING", "CANCELING", "SUCCEEDED", "CANCELED", "ABORTED"};

const char * goal_event_descriptions[] =
{"EXECUTE", "CANCEL_GOAL", "SUCCEED", "ABORT", "CANCELED", "NUM_EVENTS"};


typedef struct rcl_action_goal_handle_impl_t
{
rcl_action_goal_info_t info;
Expand Down
7 changes: 7 additions & 0 deletions rcl_action/src/rcl_action/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ rcl_action_cancel_response_fini(rcl_action_cancel_response_t * cancel_response)
return RCL_RET_OK;
}

/// Values should be changed if enum values chang
const char * goal_state_descriptions[] =
{"UNKNOWN", "ACCEPTED", "EXECUTING", "CANCELING", "SUCCEEDED", "CANCELED", "ABORTED"};

const char * goal_event_descriptions[] =
{"EXECUTE", "CANCEL_GOAL", "SUCCEED", "ABORT", "CANCELED", "NUM_EVENTS"};

#ifdef __cplusplus
}
#endif

0 comments on commit 4375391

Please sign in to comment.