use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
use crate::message::Message;
pub type GoalId = crate::unique_identifier_msgs::UUID;
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct GoalInfo {
pub goal_id: GoalId,
pub stamp: crate::builtin_interfaces::Time, }
impl Message for GoalInfo {}
#[derive(Clone, Copy, Serialize_repr, Deserialize_repr, PartialEq, Debug)]
#[repr(i8)]
pub enum GoalStatusEnum {
Unknown = 0, Accepted = 1,
Executing = 2,
Canceling = 3,
Succeeded = 4,
Canceled = 5,
Aborted = 6,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct GoalStatus {
pub goal_info: GoalInfo,
pub status: GoalStatusEnum,
}
impl Message for GoalStatus {}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct GoalStatusArray {
pub status_list: Vec<GoalStatus>,
}
impl Message for GoalStatusArray {}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct CancelGoalRequest {
pub(crate) goal_info: GoalInfo,
}
impl Message for CancelGoalRequest {}
#[derive(Clone, Copy, Serialize_repr, Deserialize_repr, PartialEq, Debug)]
#[repr(i8)]
pub enum CancelGoalResponseEnum {
None = 0,
Rejected = 1,
UnknownGoal = 2,
GoalTerminated = 3,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct CancelGoalResponse {
pub return_code: CancelGoalResponseEnum,
pub goals_canceling: Vec<GoalInfo>,
}
impl Message for CancelGoalResponse {}