ros2_interfaces_rolling/robot_localization/srv/
get_state.rs

1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct GetStateRequest {
6    pub time_stamp: crate::builtin_interfaces::msg::Time,
7    pub frame_id: ::std::string::String,
8}
9
10impl Default for GetStateRequest {
11    fn default() -> Self {
12        GetStateRequest {
13            time_stamp: crate::builtin_interfaces::msg::Time::default(),
14            frame_id: ::std::string::String::new(),
15        }
16    }
17}
18
19impl ros2_client::Message for GetStateRequest {}
20
21
22use serde_with::serde_as;
23
24#[serde_as]
25#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
26pub struct GetStateResponse {
27    pub state: [f64; 15],
28    #[serde_as(as = "[_; 225]")]
29    pub covariance: [f64; 225],
30}
31
32impl Default for GetStateResponse {
33    fn default() -> Self {
34        GetStateResponse {
35            state: [0.0; 15],
36            covariance: [0.0; 225],
37        }
38    }
39}
40
41impl ros2_client::Message for GetStateResponse {}
42
43
44pub struct GetState;
45impl ros2_client::Service for GetState {
46    type Request = GetStateRequest;
47    type Response = GetStateResponse;
48
49    fn request_type_name(&self) -> &str { "GetStateRequest" }
50    fn response_type_name(&self) -> &str { "GetStateResponse" }
51}