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