ros2_interfaces_rolling/action_msgs/srv/
cancel_goal.rs1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct CancelGoalRequest {
6 pub goal_info: crate::action_msgs::msg::GoalInfo,
7}
8
9impl Default for CancelGoalRequest {
10 fn default() -> Self {
11 CancelGoalRequest {
12 goal_info: crate::action_msgs::msg::GoalInfo::default(),
13 }
14 }
15}
16
17impl ros2_client::Message for CancelGoalRequest {}
18
19
20
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub struct CancelGoalResponse {
23 pub return_code: i8,
24 pub goals_canceling: Vec<crate::action_msgs::msg::GoalInfo>,
25}
26
27impl CancelGoalResponse {
28 pub const ERROR_NONE: i8 = 0;
29 pub const ERROR_REJECTED: i8 = 1;
30 pub const ERROR_UNKNOWN_GOAL_ID: i8 = 2;
31 pub const ERROR_GOAL_TERMINATED: i8 = 3;
32}
33
34impl Default for CancelGoalResponse {
35 fn default() -> Self {
36 CancelGoalResponse {
37 return_code: 0,
38 goals_canceling: Vec::new(),
39 }
40 }
41}
42
43impl ros2_client::Message for CancelGoalResponse {}
44
45
46pub struct CancelGoal;
47impl ros2_client::Service for CancelGoal {
48 type Request = CancelGoalRequest;
49 type Response = CancelGoalResponse;
50
51 fn request_type_name(&self) -> &str { "CancelGoalRequest" }
52 fn response_type_name(&self) -> &str { "CancelGoalResponse" }
53}