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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
use crate::standard::Header;
use cdds_derive::Topic;
use cyclonedds_rs::*;
use serde_derive::{Deserialize, Serialize};

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Vector3 {
    pub x: f64,
    pub y: f64,
    pub z: f64,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Acceleration {
    pub linear: Vector3,
    pub angular: Vector3,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct AccelerationStamped {
    pub header: Header,
    pub accel: Acceleration,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct AccelerationWithCovariance {
    pub accel: Acceleration,
    pub covariance: [[f32; 6]; 6],
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct AccelerationWithCovarianceStamped {
    pub header: Header,
    pub accel: AccelerationWithCovariance,
}

///
/// Inertia Tensor [kg-m^2]
///     | ixx ixy ixz |
/// I = | ixy iyy iyz |
///     | ixz iyz izz |
///
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Inertia {
    pub mass: f64,
    pub centre_of_mass: Vector3,
    pub ixx: f64,
    pub ixy: f64,
    pub ixz: f64,
    pub iyy: f64,
    pub iyz: f64,
    pub izz: f64,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct InertiaStamped {
    header: Header,
    inertia: Inertia,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Point {
    pub x: f64,
    pub y: f64,
    pub z: f64,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Point32 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct PointStamped {
    pub header: Header,
    pub point: Point,
}

///A specification of a polygon where the first and last points are assumed to be connected
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Polygon {
    pub points: Vec<Point32>,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct PolygonStamped {
    pub header: Header,
    pub polygon: Polygon,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Quarternion {
    pub x: f64,
    pub y: f64,
    pub z: f64,
    pub w: f64,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct QuarternionStamped {
    pub header: Header,
    pub quaternion: Quarternion,
}

///# A representation of pose in free space, composed of position and orientation.
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Pose {
    pub position: Point,
    pub orientation: Quarternion,
}

/// This represents a pose in free space with uncertainty.A representation of pose in free space, composed of position and orientation.
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct PoseWithCovariance {
    pub pose: Pose,

    /// Row-major representation of the 6x6 covariance matrix
    /// The orientation parameters use a fixed-axis representation.
    /// In order, the parameters are:
    /// (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
    pub covariance: [[f64; 6]; 6],
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct PoseStamped {
    pub header: Header,
    pub pose: Pose,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct PoseWithCovarianceStamped {
    pub header: Header,
    pub pose: Pose,

    /// Row-major representation of the 6x6 covariance matrix
    /// The orientation parameters use a fixed-axis representation.
    /// In order, the parameters are:
    /// (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
    pub covariance: [[f64; 6]; 6],
}

/// This represents the transform between two coordinate frames in free space.
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Transform {
    pub translation: Vector3,
    pub rotation: Quarternion,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct TransformStamped {
    pub header: Header,
    pub child_frame_id: String,
    pub transform: Transform,
}

#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Twist {
    pub linear: Vector3,
    pub angular: Vector3,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct TwistStamped {
    pub header: Header,
    pub twist: Twist,
}

/// This expresses velocity in free space with uncertainty.
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct TwistWithCovariance {
    pub twist: Twist,
    /// Row-major representation of the 6x6 covariance matrix
    /// The orientation parameters use a fixed-axis representation.
    /// In order, the parameters are:
    /// (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
    pub covariance: [[f32; 6]; 6],
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct TwistWithCovarianceStamped {
    pub header: Header,
    pub twist: TwistWithCovariance,
}
/// This represents force in free space, separated into
/// its linear and angular parts.
#[repr(C)]
#[derive(Serialize, Deserialize)]
pub struct Wrench {
    pub force: Vector3,
    pub torque: Vector3,
}

#[repr(C)]
#[derive(Serialize, Deserialize, Topic)]
pub struct WrenchStamped {
    pub header: Header,
    pub wrench: Wrench,
}