@@ -174,6 +174,26 @@ pub enum RclReturnCode {
174
174
EventInvalid = 2000 ,
175
175
/// Failed to take an event from the event handle
176
176
EventTakeFailed = 2001 ,
177
+ // ====== 2XXX: action-specific errors ======
178
+ /// Action name does not pass validation
179
+ // TODO(nwn): Consult with upstream about this reused error code.
180
+ // ActionNameInvalid = 2000,
181
+ /// Action goal accepted
182
+ ActionGoalAccepted = 2100 ,
183
+ /// Action goal rejected
184
+ ActionGoalRejected = 2101 ,
185
+ /// Action client is invalid
186
+ ActionClientInvalid = 2102 ,
187
+ /// Action client failed to take response
188
+ ActionClientTakeFailed = 2103 ,
189
+ /// Action server is invalid
190
+ ActionServerInvalid = 2200 ,
191
+ /// Action server failed to take request
192
+ ActionServerTakeFailed = 2201 ,
193
+ /// Action goal handle invalid
194
+ ActionGoalHandleInvalid = 2300 ,
195
+ /// Action invalid event
196
+ ActionGoalEventInvalid = 2301 ,
177
197
// ====== 30XX: lifecycle-specific errors ======
178
198
/// `rcl_lifecycle` state registered
179
199
LifecycleStateRegistered = 3000 ,
@@ -222,6 +242,15 @@ impl TryFrom<i32> for RclReturnCode {
222
242
x if x == Self :: InvalidLogLevelRule as i32 => Self :: InvalidLogLevelRule ,
223
243
x if x == Self :: EventInvalid as i32 => Self :: EventInvalid ,
224
244
x if x == Self :: EventTakeFailed as i32 => Self :: EventTakeFailed ,
245
+ // x if x == Self::ActionNameInvalid as i32 => Self::ActionNameInvalid,
246
+ x if x == Self :: ActionGoalAccepted as i32 => Self :: ActionGoalAccepted ,
247
+ x if x == Self :: ActionGoalRejected as i32 => Self :: ActionGoalRejected ,
248
+ x if x == Self :: ActionClientInvalid as i32 => Self :: ActionClientInvalid ,
249
+ x if x == Self :: ActionClientTakeFailed as i32 => Self :: ActionClientTakeFailed ,
250
+ x if x == Self :: ActionServerInvalid as i32 => Self :: ActionServerInvalid ,
251
+ x if x == Self :: ActionServerTakeFailed as i32 => Self :: ActionServerTakeFailed ,
252
+ x if x == Self :: ActionGoalHandleInvalid as i32 => Self :: ActionGoalHandleInvalid ,
253
+ x if x == Self :: ActionGoalEventInvalid as i32 => Self :: ActionGoalEventInvalid ,
225
254
x if x == Self :: LifecycleStateRegistered as i32 => Self :: LifecycleStateRegistered ,
226
255
x if x == Self :: LifecycleStateNotRegistered as i32 => Self :: LifecycleStateNotRegistered ,
227
256
other => {
@@ -303,6 +332,15 @@ impl Display for RclReturnCode {
303
332
Self :: EventTakeFailed => {
304
333
"Failed to take an event from the event handle (RCL_RET_EVENT_TAKE_FAILED)."
305
334
}
335
+ // Self::ActionNameInvalid => "Action name does not pass validation (RCL_RET_ACTION_NAME_INVALID).",
336
+ Self :: ActionGoalAccepted => "Action goal accepted (RCL_RET_ACTION_GOAL_ACCEPTED)." ,
337
+ Self :: ActionGoalRejected => "Action goal rejected (RCL_RET_ACTION_GOAL_REJECTED)." ,
338
+ Self :: ActionClientInvalid => "Action client is invalid (RCL_RET_ACTION_CLIENT_INVALID)." ,
339
+ Self :: ActionClientTakeFailed => "Action client failed to take response (RCL_RET_ACTION_CLIENT_TAKE_FAILED)." ,
340
+ Self :: ActionServerInvalid => "Action server is invalid (RCL_RET_ACTION_SERVER_INVALID)." ,
341
+ Self :: ActionServerTakeFailed => "Action server failed to take request (RCL_RET_ACTION_SERVER_TAKE_FAILED)." ,
342
+ Self :: ActionGoalHandleInvalid => "Action goal handle invalid (RCL_RET_ACTION_GOAL_HANDLE_INVALID)." ,
343
+ Self :: ActionGoalEventInvalid => "Action invalid event (RCL_RET_ACTION_GOAL_EVENT_INVALID)." ,
306
344
Self :: LifecycleStateRegistered => {
307
345
"`rcl_lifecycle` state registered (RCL_RET_LIFECYCLE_STATE_REGISTERED)."
308
346
}
0 commit comments