ros.h
Go to the documentation of this file.
1 /**************************************************************************/ /**
2  * @brief ROS support messages.
3  * @file
4  ******************************************************************************/
5 
6 #pragma once
7 
9 
10 namespace point_one {
11 namespace fusion_engine {
12 namespace messages {
13 namespace ros {
14 
15 // Enforce 4-byte alignment and packing of all data structures and values so
16 // that floating point values are aligned on platforms that require it.
17 #pragma pack(push, 4)
18 
19 /**
20  * @defgroup ros_messages ROS Support Message Definitions
21  * @brief Messages designed for direct translation to ROS.
22  * @ingroup messages
23  *
24  * The messages defined in this file are intended to be translated into their
25  * corresponding ROS message structures where ROS integration is needed.
26  *
27  * @note
28  * The messages defined here are _not_ guaranteed to be byte-compatible with ROS
29  * messages. They are designed to have the same or similar content, which can be
30  * easily copied into a ROS message.
31  *
32  * See also @ref messages.
33  */
34 
35 /**
36  * @brief ROS `Pose` message (MessageType::ROS_POSE).
37  * @ingroup ros_messages
38  *
39  * See http://docs.ros.org/api/geometry_msgs/html/msg/Pose.html.
40  */
41 struct PoseMessage {
42  /** The time of the message, in P1 time (beginning at power-on). */
44 
45  /**
46  * The relative change in ENU position since the time of the first @ref
47  * PoseMessage, resolved in the local ENU frame at the time of the first @ref
48  * PoseMessage.
49  *
50  * @warning
51  * The [ROS Pose message API documentation](
52  * http://docs.ros.org/api/geometry_msgs/html/msg/Pose.html)
53  * does not currently define the origin or reference frame of its position
54  * field. Using the Novatel SPAN driver as a reference
55  * (http://docs.ros.org/api/novatel_span_driver/html/publisher_8py_source.html),
56  * we have chosen to report a relative ENU position. Absolute world position
57  * is available in the @ref GPSFixMessage and @ref messages::PoseMessage
58  * classes.
59  */
60  double position_rel_m[3] = {NAN, NAN, NAN};
61 
62  /**
63  * The platform body orientation with respect to the local ENU frame,
64  * represented as a quaternion with the scalar component last (x, y, z, w).
65  */
66  double orientation[4] = {NAN, NAN, NAN, NAN};
67 };
68 
69 /**
70  * @brief ROS `GPSFix` message (MessageType::ROS_GPS_FIX).
71  * @ingroup ros_messages
72  *
73  * See http://docs.ros.org/api/gps_common/html/msg/GPSFix.html.
74  */
75 struct GPSFixMessage {
76  /**
77  * @defgroup ros_covariance_type ROS Covariance Type Values
78  * @{
79  */
80  static const uint8_t COVARIANCE_TYPE_UNKNOWN = 0;
81  static const uint8_t COVARIANCE_TYPE_APPROXIMATED = 1;
82  static const uint8_t COVARIANCE_TYPE_DIAGONAL_KNOWN = 2;
83  static const uint8_t COVARIANCE_TYPE_KNOWN = 3;
84  /** @} */
85 
86  /** The time of the message, in P1 time (beginning at power-on). */
88 
89  /**
90  * @name WGS-84 Geodetic Position
91  * @{
92  */
93 
94  /**
95  * The WGS-84 geodetic latitude (in degrees).
96  */
97  double latitude_deg = NAN;
98 
99  /**
100  * The WGS-84 geodetic longitude (in degrees).
101  */
102  double longitude_deg = NAN;
103 
104  /**
105  * The WGS-84 altitude above the ellipsoid (in meters).
106  */
107  double altitude_m = NAN;
108 
109  /** @} */
110 
111  /**
112  * @name Velocity
113  * @{
114  */
115 
116  /**
117  * The vehicle direction from north (in degrees).
118  */
119  double track_deg = NAN;
120 
121  /**
122  * The vehicle ground speed (in meters/second).
123  */
124  double speed_mps = NAN;
125 
126  /**
127  * The vehicle vertical speed (in meters/second).
128  */
129  double climb_mps = NAN;
130 
131  /** @} */
132 
133  /**
134  * @name Vehicle Orientation
135  *
136  * @warning
137  * The pitch/roll/dip field definition listed in the
138  * [ROS GPSFix message definition](http://docs.ros.org/api/gps_common/html/msg/GPSFix.html)
139  * uses non-standard terminology, and the order of the Euler angles is not
140  * explicitly defined. We do not currently support this field. See @ref
141  * PoseMessage::orientation or @ref messages::PoseMessage::ypr_deg instead.
142  *
143  * @{
144  */
145 
146  /**
147  * The platform pitch angle (in degrees).
148  */
149  double pitch_deg = NAN;
150 
151  /**
152  * The platform roll angle (in degrees).
153  */
154  double roll_deg = NAN;
155 
156  /**
157  * The platform dip angle (in degrees).
158  */
159  double dip_deg = NAN;
160 
161  /** @} */
162 
163  /** The GPS time of the message (in seconds), referenced to 1980/1/6. */
164  double gps_time = NAN;
165 
166  /**
167  * @name Dilution Of Precision
168  * @{
169  */
170 
171  double gdop = NAN; ///< Geometric (position + time) DOP.
172  double pdop = NAN; ///< Positional (3D) DOP.
173  double hdop = NAN; ///< Horizontal DOP.
174  double vdop = NAN; ///< Vertical DOP.
175  double tdop = NAN; ///< Time DOP.
176 
177  /** @} */
178 
179  /**
180  * @name Measurement Uncertainty (95% Confidence)
181  * @{
182  */
183 
184  /** Spherical position uncertainty (in meters) [epe] */
185  double err_3d_m = NAN;
186 
187  /** Horizontal position uncertainty (in meters) [eph] */
188  double err_horiz_m = NAN;
189 
190  /** Vertical position uncertainty (in meters) [epv] */
191  double err_vert_m = NAN;
192 
193  /** Track uncertainty (in degrees) [epd] */
194  double err_track_deg = NAN;
195 
196  /** Ground speed uncertainty (in meters/second) [eps] */
197  double err_speed_mps = NAN;
198 
199  /** Vertical speed uncertainty (in meters/second) [epc] */
200  double err_climb_mps = NAN;
201 
202  /** Time uncertainty (in seconds) [ept] */
203  double err_time_sec = NAN;
204 
205  /** Pitch uncertainty (in degrees) */
206  double err_pitch_deg = NAN;
207 
208  /** Roll uncertainty (in degrees) */
209  double err_roll_deg = NAN;
210 
211  /** Dip uncertainty (in degrees) */
212  double err_dip_deg = NAN;
213 
214  /** @} */
215 
216  /**
217  * @name Position Covariance
218  * @{
219  */
220 
221  /**
222  * The 3x3 position covariance matrix (in m^2), resolved in the local ENU
223  * frame. Values are stored in row-major order.
224  */
225  double position_covariance_m2[9] = {NAN};
226 
227  /**
228  * The method in which @ref position_covariance_m2 was populated. See @ref
229  * ros_covariance_type.
230  */
232 
233  /** @} */
234 
235  uint8_t reserved[3] = {0};
236 };
237 
238 /**
239  * @brief ROS `Imu` message (MessageType::ROS_IMU).
240  * @ingroup ros_messages
241  *
242  * If any of the data elements are not available (e.g., IMU doesn't produce an
243  * orientation estimate), they will be set to 0 and their associated covariance
244  * matrices will be set to -1.
245  *
246  * See http://docs.ros.org/api/sensor_msgs/html/msg/Imu.html.
247  *
248  * @note
249  * The data contained in this message has been corrected for accelerometer and
250  * gyro biases and scale factors, and has been rotated into the vehicle body
251  * frame from the original IMU orientation using the FusionEngine sensor
252  * calibration data.
253  */
254 struct IMUMessage {
255  /** The time of the message, in P1 time (beginning at power-on). */
257 
258  /**
259  * The platform body orientation with respect to the local ENU frame,
260  * represented as a quaternion with the scalar component last (x, y, z, w).
261  */
262  double orientation[4] = {NAN, NAN, NAN, NAN};
263 
264  /**
265  * Orientation covariance matrix. Set to -1 if not available.
266  */
267  double orientation_covariance[9] = {-1};
268 
269  /**
270  * Vehicle x/y/z rate of rotation (in radians/second), resolved in the body
271  * frame.
272  */
273  double angular_velocity_rps[3] = {NAN, NAN, NAN};
274 
275  /**
276  * Vehicle rate of rotation covariance matrix. Set to -1 if not available.
277  */
278  double angular_velocity_covariance[9] = {-1};
279 
280  /**
281  * Vehicle x/y/z linear acceleration (in meters/second^2), resolved in the
282  * body frame.
283  */
284  double acceleration_mps2[3] = {NAN, NAN, NAN};
285 
286  /**
287  * Vehicle x/y/z acceleration covariance matrix. Set to -1 if not available.
288  */
289  double acceleration_covariance[9] = {-1};
290 };
291 
292 #pragma pack(pop)
293 
294 } // namespace ros
295 } // namespace messages
296 } // namespace fusion_engine
297 } // namespace point_one
double dip_deg
The platform dip angle (in degrees).
Definition: ros.h:159
static const uint8_t COVARIANCE_TYPE_KNOWN
Definition: ros.h:83
double track_deg
The vehicle direction from north (in degrees).
Definition: ros.h:119
double position_rel_m[3]
The relative change in ENU position since the time of the first PoseMessage, resolved in the local EN...
Definition: ros.h:60
double acceleration_mps2[3]
Vehicle x/y/z linear acceleration (in meters/second^2), resolved in the body frame.
Definition: ros.h:284
static const uint8_t COVARIANCE_TYPE_APPROXIMATED
Definition: ros.h:81
double latitude_deg
The WGS-84 geodetic latitude (in degrees).
Definition: ros.h:97
double err_horiz_m
Horizontal position uncertainty (in meters) [eph].
Definition: ros.h:188
double err_roll_deg
Roll uncertainty (in degrees)
Definition: ros.h:209
Timestamp p1_time
The time of the message, in P1 time (beginning at power-on).
Definition: ros.h:43
double angular_velocity_covariance[9]
Vehicle rate of rotation covariance matrix.
Definition: ros.h:278
double err_time_sec
Time uncertainty (in seconds) [ept].
Definition: ros.h:203
double acceleration_covariance[9]
Vehicle x/y/z acceleration covariance matrix.
Definition: ros.h:289
ROS Imu message (MessageType::ROS_IMU).
Definition: ros.h:254
double err_track_deg
Track uncertainty (in degrees) [epd].
Definition: ros.h:194
double hdop
Horizontal DOP.
Definition: ros.h:173
static const uint8_t COVARIANCE_TYPE_UNKNOWN
Definition: ros.h:80
double orientation_covariance[9]
Orientation covariance matrix.
Definition: ros.h:267
double pdop
Positional (3D) DOP.
Definition: ros.h:172
double longitude_deg
The WGS-84 geodetic longitude (in degrees).
Definition: ros.h:102
double speed_mps
The vehicle ground speed (in meters/second).
Definition: ros.h:124
double tdop
Time DOP.
Definition: ros.h:175
Definition: crc.cc:52
Timestamp p1_time
The time of the message, in P1 time (beginning at power-on).
Definition: ros.h:256
ROS GPSFix message (MessageType::ROS_GPS_FIX).
Definition: ros.h:75
double gps_time
The GPS time of the message (in seconds), referenced to 1980/1/6.
Definition: ros.h:164
double orientation[4]
The platform body orientation with respect to the local ENU frame, represented as a quaternion with t...
Definition: ros.h:66
double err_climb_mps
Vertical speed uncertainty (in meters/second) [epc].
Definition: ros.h:200
double err_pitch_deg
Pitch uncertainty (in degrees)
Definition: ros.h:206
double pitch_deg
The platform pitch angle (in degrees).
Definition: ros.h:149
Timestamp p1_time
The time of the message, in P1 time (beginning at power-on).
Definition: ros.h:87
ROS Pose message (MessageType::ROS_POSE).
Definition: ros.h:41
double vdop
Vertical DOP.
Definition: ros.h:174
uint8_t position_covariance_type
The method in which position_covariance_m2 was populated.
Definition: ros.h:231
double gdop
Geometric (position + time) DOP.
Definition: ros.h:171
double err_vert_m
Vertical position uncertainty (in meters) [epv].
Definition: ros.h:191
double err_speed_mps
Ground speed uncertainty (in meters/second) [eps].
Definition: ros.h:197
double err_dip_deg
Dip uncertainty (in degrees)
Definition: ros.h:212
double orientation[4]
The platform body orientation with respect to the local ENU frame, represented as a quaternion with t...
Definition: ros.h:262
double altitude_m
The WGS-84 altitude above the ellipsoid (in meters).
Definition: ros.h:107
Point One FusionEngine output message common definitions.
Generic timestamp representation.
Definition: defs.h:107
double climb_mps
The vehicle vertical speed (in meters/second).
Definition: ros.h:129
static const uint8_t COVARIANCE_TYPE_DIAGONAL_KNOWN
Definition: ros.h:82
double roll_deg
The platform roll angle (in degrees).
Definition: ros.h:154
double err_3d_m
Spherical position uncertainty (in meters) [epe].
Definition: ros.h:185
double position_covariance_m2[9]
The 3x3 position covariance matrix (in m^2), resolved in the local ENU frame.
Definition: ros.h:225
double angular_velocity_rps[3]
Vehicle x/y/z rate of rotation (in radians/second), resolved in the body frame.
Definition: ros.h:273