ros2_client/
rcl_interfaces.rs

1//! Corresponds to package [rcl_interfaces](https://index.ros.org/p/rcl_interfaces/). Defines message types for Parameter manipulation.
2//!
3//! For logging, see [`log`](crate::log).
4
5use serde::{Deserialize, Serialize};
6
7use crate::{parameters, service::AService, Message};
8
9pub type ListParametersService = AService<ListParametersRequest, ListParametersResponse>;
10
11pub type GetParametersService = AService<GetParametersRequest, GetParametersResponse>;
12
13pub type GetParameterTypesService = AService<GetParameterTypesRequest, GetParameterTypesResponse>;
14
15pub type SetParametersService = AService<SetParametersRequest, SetParametersResponse>;
16
17pub type DescribeParametersService =
18  AService<DescribeParametersRequest, DescribeParametersResponse>;
19
20// This is structurally identical to SetParamtersService, but the operation
21// of the service is slightly different.
22pub type SetParametersAtomicallyService = AService<SetParametersRequest, SetParametersResponse>;
23
24#[allow(non_snake_case)]
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct ListParametersRequest {
27  pub prefixes: Vec<String>,
28  pub depth: u64, //
29}
30impl Message for ListParametersRequest {}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct ListParametersResult {
34  pub names: Vec<String>,
35  pub prefixes: Vec<String>,
36}
37impl Message for ListParametersResult {}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct ListParametersResponse {
41  pub result: ListParametersResult,
42}
43impl Message for ListParametersResponse {}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct GetParametersRequest {
47  pub names: Vec<String>,
48}
49impl Message for GetParametersRequest {}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
52pub struct GetParametersResponse {
53  pub values: Vec<parameters::raw::ParameterValue>,
54}
55impl Message for GetParametersResponse {}
56
57#[derive(Debug, Clone, Serialize, Deserialize)]
58pub struct GetParameterTypesRequest {
59  pub names: Vec<String>,
60}
61impl Message for GetParameterTypesRequest {}
62
63#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct GetParameterTypesResponse {
65  pub values: Vec<u8>,
66}
67impl Message for GetParameterTypesResponse {}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
70pub struct SetParametersRequest {
71  pub parameter: Vec<parameters::raw::Parameter>,
72}
73impl Message for SetParametersRequest {}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
76pub struct SetParametersResponse {
77  pub results: Vec<parameters::raw::SetParametersResult>,
78}
79impl Message for SetParametersResponse {}
80
81pub type SetParametersAtomicallyResponse = SetParametersResponse;
82
83// https://github.com/ros2/rcl_interfaces/blob/humble/rcl_interfaces/srv/DescribeParameters.srv
84#[derive(Debug, Clone, Serialize, Deserialize)]
85pub struct DescribeParametersRequest {
86  pub names: Vec<String>,
87}
88impl Message for DescribeParametersRequest {}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
91pub struct DescribeParametersResponse {
92  pub values: Vec<parameters::raw::ParameterDescriptor>,
93}
94impl Message for DescribeParametersResponse {}