ros2_interfaces_rolling/controller_manager_msgs/srv/
switch_controller.rs

1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct SwitchControllerRequest {
6    pub activate_controllers: Vec<::std::string::String>,
7    pub deactivate_controllers: Vec<::std::string::String>,
8    pub strictness: i32,
9    pub activate_asap: bool,
10    pub timeout: crate::builtin_interfaces::msg::Duration,
11}
12
13impl SwitchControllerRequest {
14    pub const BEST_EFFORT: i32 = 1;
15    pub const STRICT: i32 = 2;
16}
17
18impl Default for SwitchControllerRequest {
19    fn default() -> Self {
20        SwitchControllerRequest {
21            activate_controllers: Vec::new(),
22            deactivate_controllers: Vec::new(),
23            strictness: 0,
24            activate_asap: false,
25            timeout: crate::builtin_interfaces::msg::Duration::default(),
26        }
27    }
28}
29
30impl ros2_client::Message for SwitchControllerRequest {}
31
32
33
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct SwitchControllerResponse {
36    pub ok: bool,
37}
38
39impl Default for SwitchControllerResponse {
40    fn default() -> Self {
41        SwitchControllerResponse {
42            ok: false,
43        }
44    }
45}
46
47impl ros2_client::Message for SwitchControllerResponse {}
48
49
50pub struct SwitchController;
51impl ros2_client::Service for SwitchController {
52    type Request = SwitchControllerRequest;
53    type Response = SwitchControllerResponse;
54
55    fn request_type_name(&self) -> &str { "SwitchControllerRequest" }
56    fn response_type_name(&self) -> &str { "SwitchControllerResponse" }
57}