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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! Corresponds to package [rcl_interfaces](https://index.ros.org/p/rcl_interfaces/). Defines message types for Parameter manipulation.
//!
//! For logging, see [`log`](crate::log).

use serde::{Deserialize, Serialize};

use crate::{parameters, service::AService, Message};

pub type ListParametersService = AService<ListParametersRequest, ListParametersResponse>;

pub type GetParametersService = AService<GetParametersRequest, GetParametersResponse>;

pub type GetParameterTypesService = AService<GetParameterTypesRequest, GetParameterTypesResponse>;

pub type SetParametersService = AService<SetParametersRequest, SetParametersResponse>;

pub type DescribeParametersService =
  AService<DescribeParametersRequest, DescribeParametersResponse>;

// This is structurally identical to SetParamtersService, but the operation
// of the service is slightly different.
pub type SetParametersAtomicallyService = AService<SetParametersRequest, SetParametersResponse>;

#[allow(non_snake_case)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListParametersRequest {
  pub prefixes: Vec<String>,
  pub depth: u64, //
}
impl Message for ListParametersRequest {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListParametersResult {
  pub names: Vec<String>,
  pub prefixes: Vec<String>,
}
impl Message for ListParametersResult {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListParametersResponse {
  pub result: ListParametersResult,
}
impl Message for ListParametersResponse {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetParametersRequest {
  pub names: Vec<String>,
}
impl Message for GetParametersRequest {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetParametersResponse {
  pub values: Vec<parameters::raw::ParameterValue>,
}
impl Message for GetParametersResponse {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetParameterTypesRequest {
  pub names: Vec<String>,
}
impl Message for GetParameterTypesRequest {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GetParameterTypesResponse {
  pub values: Vec<u8>,
}
impl Message for GetParameterTypesResponse {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SetParametersRequest {
  pub parameter: Vec<parameters::raw::Parameter>,
}
impl Message for SetParametersRequest {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SetParametersResponse {
  pub results: Vec<parameters::raw::SetParametersResult>,
}
impl Message for SetParametersResponse {}

pub type SetParametersAtomicallyResponse = SetParametersResponse;

// https://github.com/ros2/rcl_interfaces/blob/humble/rcl_interfaces/srv/DescribeParameters.srv
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DescribeParametersRequest {
  pub names: Vec<String>,
}
impl Message for DescribeParametersRequest {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DescribeParametersResponse {
  pub values: Vec<parameters::raw::ParameterDescriptor>,
}
impl Message for DescribeParametersResponse {}