Skip to content

Commit 6113ae1

Browse files
committed
Enable serde for goal status info
Signed-off-by: Michael X. Grey <[email protected]>
1 parent d7b0734 commit 6113ae1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rclrs/src/action.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ pub use action_server::*;
1212
use crate::{log_error, rcl_bindings::*, vendor::builtin_interfaces::msg::Time, DropGuard};
1313
use std::fmt;
1414

15+
#[cfg(feature = "serde")]
16+
use serde::{Deserialize, Serialize};
17+
1518
/// A unique identifier for a goal request.
19+
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
20+
#[cfg_attr(feature = "serde", serde(transparent))]
1621
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
1722
pub struct GoalUuid(pub [u8; RCL_ACTION_UUID_SIZE]);
1823

@@ -148,6 +153,7 @@ impl MultiCancelResponse {
148153
}
149154

150155
/// Values defined by `action_msgs/msg/GoalStatus`
156+
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
151157
#[repr(i8)]
152158
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
153159
pub enum GoalStatusCode {
@@ -192,6 +198,7 @@ impl From<i8> for GoalStatusCode {
192198

193199
/// A status update for a goal. Includes the status code, the goal uuid, and the
194200
/// timestamp of when the status was set by the action server.
201+
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
195202
#[derive(Debug, Clone, PartialEq, PartialOrd)]
196203
pub struct GoalStatus {
197204
/// The status code describing what status was set by the action server.

0 commit comments

Comments
 (0)