ros2_interfaces_rolling/controller_manager_msgs/srv/
switch_controller.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use serde::{Deserialize, Serialize};


#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SwitchControllerReq {
    pub activate_controllers: Vec<::std::string::String>,
    pub deactivate_controllers: Vec<::std::string::String>,
    pub strictness: i32,
    pub activate_asap: bool,
    pub timeout: crate::builtin_interfaces::msg::Duration,
}

impl SwitchControllerReq {
    pub const BEST_EFFORT: i32 = 1;
    pub const STRICT: i32 = 2;
}

impl Default for SwitchControllerReq {
    fn default() -> Self {
        SwitchControllerReq {
            activate_controllers: Vec::new(),
            deactivate_controllers: Vec::new(),
            strictness: 0,
            activate_asap: false,
            timeout: crate::builtin_interfaces::msg::Duration::default(),
        }
    }
}

impl ros2_client::Message for SwitchControllerReq {}



#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SwitchControllerRes {
    pub ok: bool,
}

impl Default for SwitchControllerRes {
    fn default() -> Self {
        SwitchControllerRes {
            ok: false,
        }
    }
}

impl ros2_client::Message for SwitchControllerRes {}


pub struct SwitchController;
impl ros2_client::Service for SwitchController {
    type Request = SwitchControllerReq;
    type Response = SwitchControllerRes;

    fn request_type_name(&self) -> &str { "SwitchControllerReq" }
    fn response_type_name(&self) -> &str { "SwitchControllerRes" }
}