RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_hil_optical_flow.h
1#pragma once
2// MESSAGE HIL_OPTICAL_FLOW PACKING
3
4#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114
5
6MAVPACKED(
7typedef struct __mavlink_hil_optical_flow_t {
8 uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/
9 uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/
10 float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/
11 float integrated_y; /*< Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)*/
12 float integrated_xgyro; /*< RH rotation around X axis (rad)*/
13 float integrated_ygyro; /*< RH rotation around Y axis (rad)*/
14 float integrated_zgyro; /*< RH rotation around Z axis (rad)*/
15 uint32_t time_delta_distance_us; /*< Time in microseconds since the distance was sampled.*/
16 float distance; /*< Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance.*/
17 int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/
18 uint8_t sensor_id; /*< Sensor ID*/
19 uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/
20}) mavlink_hil_optical_flow_t;
21
22#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 44
23#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN 44
24#define MAVLINK_MSG_ID_114_LEN 44
25#define MAVLINK_MSG_ID_114_MIN_LEN 44
26
27#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC 237
28#define MAVLINK_MSG_ID_114_CRC 237
29
30
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
34 114, \
35 "HIL_OPTICAL_FLOW", \
36 12, \
37 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
38 { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
39 { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
40 { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
41 { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
42 { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
43 { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
44 { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
45 { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
46 { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
47 { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
48 { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
49 } \
50}
51#else
52#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \
53 "HIL_OPTICAL_FLOW", \
54 12, \
55 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \
56 { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \
57 { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \
58 { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \
59 { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \
60 { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \
61 { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \
62 { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \
63 { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \
64 { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \
65 { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \
66 { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \
67 } \
68}
69#endif
70
91static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
93{
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
96 _mav_put_uint64_t(buf, 0, time_usec);
97 _mav_put_uint32_t(buf, 8, integration_time_us);
98 _mav_put_float(buf, 12, integrated_x);
99 _mav_put_float(buf, 16, integrated_y);
100 _mav_put_float(buf, 20, integrated_xgyro);
101 _mav_put_float(buf, 24, integrated_ygyro);
102 _mav_put_float(buf, 28, integrated_zgyro);
103 _mav_put_uint32_t(buf, 32, time_delta_distance_us);
104 _mav_put_float(buf, 36, distance);
105 _mav_put_int16_t(buf, 40, temperature);
106 _mav_put_uint8_t(buf, 42, sensor_id);
107 _mav_put_uint8_t(buf, 43, quality);
108
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
110#else
111 mavlink_hil_optical_flow_t packet;
112 packet.time_usec = time_usec;
113 packet.integration_time_us = integration_time_us;
114 packet.integrated_x = integrated_x;
115 packet.integrated_y = integrated_y;
116 packet.integrated_xgyro = integrated_xgyro;
117 packet.integrated_ygyro = integrated_ygyro;
118 packet.integrated_zgyro = integrated_zgyro;
119 packet.time_delta_distance_us = time_delta_distance_us;
120 packet.distance = distance;
121 packet.temperature = temperature;
122 packet.sensor_id = sensor_id;
123 packet.quality = quality;
124
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
126#endif
127
128 msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
130}
131
152static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
153 mavlink_message_t* msg,
154 uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance)
155{
156#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157 char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
158 _mav_put_uint64_t(buf, 0, time_usec);
159 _mav_put_uint32_t(buf, 8, integration_time_us);
160 _mav_put_float(buf, 12, integrated_x);
161 _mav_put_float(buf, 16, integrated_y);
162 _mav_put_float(buf, 20, integrated_xgyro);
163 _mav_put_float(buf, 24, integrated_ygyro);
164 _mav_put_float(buf, 28, integrated_zgyro);
165 _mav_put_uint32_t(buf, 32, time_delta_distance_us);
166 _mav_put_float(buf, 36, distance);
167 _mav_put_int16_t(buf, 40, temperature);
168 _mav_put_uint8_t(buf, 42, sensor_id);
169 _mav_put_uint8_t(buf, 43, quality);
170
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
172#else
173 mavlink_hil_optical_flow_t packet;
174 packet.time_usec = time_usec;
175 packet.integration_time_us = integration_time_us;
176 packet.integrated_x = integrated_x;
177 packet.integrated_y = integrated_y;
178 packet.integrated_xgyro = integrated_xgyro;
179 packet.integrated_ygyro = integrated_ygyro;
180 packet.integrated_zgyro = integrated_zgyro;
181 packet.time_delta_distance_us = time_delta_distance_us;
182 packet.distance = distance;
183 packet.temperature = temperature;
184 packet.sensor_id = sensor_id;
185 packet.quality = quality;
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
188#endif
189
190 msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW;
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
192}
193
202static inline uint16_t mavlink_msg_hil_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
203{
204 return mavlink_msg_hil_optical_flow_pack(system_id, component_id, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
205}
206
216static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow)
217{
218 return mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, chan, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
219}
220
238#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
239
240static inline void mavlink_msg_hil_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
241{
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN];
244 _mav_put_uint64_t(buf, 0, time_usec);
245 _mav_put_uint32_t(buf, 8, integration_time_us);
246 _mav_put_float(buf, 12, integrated_x);
247 _mav_put_float(buf, 16, integrated_y);
248 _mav_put_float(buf, 20, integrated_xgyro);
249 _mav_put_float(buf, 24, integrated_ygyro);
250 _mav_put_float(buf, 28, integrated_zgyro);
251 _mav_put_uint32_t(buf, 32, time_delta_distance_us);
252 _mav_put_float(buf, 36, distance);
253 _mav_put_int16_t(buf, 40, temperature);
254 _mav_put_uint8_t(buf, 42, sensor_id);
255 _mav_put_uint8_t(buf, 43, quality);
256
257 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
258#else
259 mavlink_hil_optical_flow_t packet;
260 packet.time_usec = time_usec;
261 packet.integration_time_us = integration_time_us;
262 packet.integrated_x = integrated_x;
263 packet.integrated_y = integrated_y;
264 packet.integrated_xgyro = integrated_xgyro;
265 packet.integrated_ygyro = integrated_ygyro;
266 packet.integrated_zgyro = integrated_zgyro;
267 packet.time_delta_distance_us = time_delta_distance_us;
268 packet.distance = distance;
269 packet.temperature = temperature;
270 packet.sensor_id = sensor_id;
271 packet.quality = quality;
272
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
274#endif
275}
276
282static inline void mavlink_msg_hil_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_hil_optical_flow_t* hil_optical_flow)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 mavlink_msg_hil_optical_flow_send(chan, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance);
286#else
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)hil_optical_flow, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
288#endif
289}
290
291#if MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
292/*
293 This varient of _send() can be used to save stack space by re-using
294 memory from the receive buffer. The caller provides a
295 mavlink_message_t which is the size of a full mavlink message. This
296 is usually the receive buffer for the channel, and allows a reply to an
297 incoming message with minimum stack space usage.
298 */
299static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance)
300{
301#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
302 char *buf = (char *)msgbuf;
303 _mav_put_uint64_t(buf, 0, time_usec);
304 _mav_put_uint32_t(buf, 8, integration_time_us);
305 _mav_put_float(buf, 12, integrated_x);
306 _mav_put_float(buf, 16, integrated_y);
307 _mav_put_float(buf, 20, integrated_xgyro);
308 _mav_put_float(buf, 24, integrated_ygyro);
309 _mav_put_float(buf, 28, integrated_zgyro);
310 _mav_put_uint32_t(buf, 32, time_delta_distance_us);
311 _mav_put_float(buf, 36, distance);
312 _mav_put_int16_t(buf, 40, temperature);
313 _mav_put_uint8_t(buf, 42, sensor_id);
314 _mav_put_uint8_t(buf, 43, quality);
315
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
317#else
318 mavlink_hil_optical_flow_t *packet = (mavlink_hil_optical_flow_t *)msgbuf;
319 packet->time_usec = time_usec;
320 packet->integration_time_us = integration_time_us;
321 packet->integrated_x = integrated_x;
322 packet->integrated_y = integrated_y;
323 packet->integrated_xgyro = integrated_xgyro;
324 packet->integrated_ygyro = integrated_ygyro;
325 packet->integrated_zgyro = integrated_zgyro;
326 packet->time_delta_distance_us = time_delta_distance_us;
327 packet->distance = distance;
328 packet->temperature = temperature;
329 packet->sensor_id = sensor_id;
330 packet->quality = quality;
331
332 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC);
333#endif
334}
335#endif
336
337#endif
338
339// MESSAGE HIL_OPTICAL_FLOW UNPACKING
340
341
347static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_message_t* msg)
348{
349 return _MAV_RETURN_uint64_t(msg, 0);
350}
351
357static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_message_t* msg)
358{
359 return _MAV_RETURN_uint8_t(msg, 42);
360}
361
367static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_uint32_t(msg, 8);
370}
371
377static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_float(msg, 12);
380}
381
387static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_message_t* msg)
388{
389 return _MAV_RETURN_float(msg, 16);
390}
391
397static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_float(msg, 20);
400}
401
407static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_float(msg, 24);
410}
411
417static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_float(msg, 28);
420}
421
427static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_int16_t(msg, 40);
430}
431
437static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_uint8_t(msg, 43);
440}
441
447static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_uint32_t(msg, 32);
450}
451
457static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_message_t* msg)
458{
459 return _MAV_RETURN_float(msg, 36);
460}
461
468static inline void mavlink_msg_hil_optical_flow_decode(const mavlink_message_t* msg, mavlink_hil_optical_flow_t* hil_optical_flow)
469{
470#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
471 hil_optical_flow->time_usec = mavlink_msg_hil_optical_flow_get_time_usec(msg);
472 hil_optical_flow->integration_time_us = mavlink_msg_hil_optical_flow_get_integration_time_us(msg);
473 hil_optical_flow->integrated_x = mavlink_msg_hil_optical_flow_get_integrated_x(msg);
474 hil_optical_flow->integrated_y = mavlink_msg_hil_optical_flow_get_integrated_y(msg);
475 hil_optical_flow->integrated_xgyro = mavlink_msg_hil_optical_flow_get_integrated_xgyro(msg);
476 hil_optical_flow->integrated_ygyro = mavlink_msg_hil_optical_flow_get_integrated_ygyro(msg);
477 hil_optical_flow->integrated_zgyro = mavlink_msg_hil_optical_flow_get_integrated_zgyro(msg);
478 hil_optical_flow->time_delta_distance_us = mavlink_msg_hil_optical_flow_get_time_delta_distance_us(msg);
479 hil_optical_flow->distance = mavlink_msg_hil_optical_flow_get_distance(msg);
480 hil_optical_flow->temperature = mavlink_msg_hil_optical_flow_get_temperature(msg);
481 hil_optical_flow->sensor_id = mavlink_msg_hil_optical_flow_get_sensor_id(msg);
482 hil_optical_flow->quality = mavlink_msg_hil_optical_flow_get_quality(msg);
483#else
484 uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN;
485 memset(hil_optical_flow, 0, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN);
486 memcpy(hil_optical_flow, _MAV_PAYLOAD(msg), len);
487#endif
488}