ros2_interfaces_rolling/dynamixel_sdk_custom_interfaces/srv/
get_position.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
use serde::{Deserialize, Serialize};


#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetPositionReq {
    pub id: u8,
}

impl Default for GetPositionReq {
    fn default() -> Self {
        GetPositionReq {
            id: 0,
        }
    }
}

impl ros2_client::Message for GetPositionReq {}



#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetPositionRes {
    pub position: i32,
}

impl Default for GetPositionRes {
    fn default() -> Self {
        GetPositionRes {
            position: 0,
        }
    }
}

impl ros2_client::Message for GetPositionRes {}


pub struct GetPosition;
impl ros2_client::Service for GetPosition {
    type Request = GetPositionReq;
    type Response = GetPositionRes;

    fn request_type_name(&self) -> &str { "GetPositionReq" }
    fn response_type_name(&self) -> &str { "GetPositionRes" }
}