3 #define MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW 166
19 #define MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN 174
20 #define MAVLINK_MSG_ID_166_LEN 174
22 #define MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC 23
23 #define MAVLINK_MSG_ID_166_CRC 23
25 #define MAVLINK_MSG_SPHERICAL_OPTIC_FLOW_FIELD_OF_AZIMUTH_LEN 18
26 #define MAVLINK_MSG_SPHERICAL_OPTIC_FLOW_FIELD_OF_ELEVATION_LEN 18
27 #define MAVLINK_MSG_SPHERICAL_OPTIC_FLOW_FIELD_AZIMUTH_LEN 18
28 #define MAVLINK_MSG_SPHERICAL_OPTIC_FLOW_FIELD_ELEVATION_LEN 18
29 #define MAVLINK_MSG_SPHERICAL_OPTIC_FLOW_FIELD_OF_INFO_LEN 18
31 #define MAVLINK_MESSAGE_INFO_SPHERICAL_OPTIC_FLOW { \
32 "SPHERICAL_OPTIC_FLOW", \
34 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_spherical_optic_flow_t, time_usec) }, \
35 { "of_azimuth", NULL, MAVLINK_TYPE_INT16_T, 18, 8, offsetof(mavlink_spherical_optic_flow_t, of_azimuth) }, \
36 { "of_elevation", NULL, MAVLINK_TYPE_INT16_T, 18, 44, offsetof(mavlink_spherical_optic_flow_t, of_elevation) }, \
37 { "azimuth", NULL, MAVLINK_TYPE_INT16_T, 18, 80, offsetof(mavlink_spherical_optic_flow_t, azimuth) }, \
38 { "elevation", NULL, MAVLINK_TYPE_INT16_T, 18, 116, offsetof(mavlink_spherical_optic_flow_t, elevation) }, \
39 { "id_sensor", NULL, MAVLINK_TYPE_UINT8_T, 0, 152, offsetof(mavlink_spherical_optic_flow_t, id_sensor) }, \
40 { "nb_sensors", NULL, MAVLINK_TYPE_UINT8_T, 0, 153, offsetof(mavlink_spherical_optic_flow_t, nb_sensors) }, \
41 { "nb_of", NULL, MAVLINK_TYPE_UINT8_T, 0, 154, offsetof(mavlink_spherical_optic_flow_t, nb_of) }, \
42 { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 155, offsetof(mavlink_spherical_optic_flow_t, status) }, \
43 { "of_info", NULL, MAVLINK_TYPE_UINT8_T, 18, 156, offsetof(mavlink_spherical_optic_flow_t, of_info) }, \
66 static inline uint16_t mavlink_msg_spherical_optic_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
67 uint64_t time_usec, uint8_t id_sensor, uint8_t nb_sensors, uint8_t nb_of, uint8_t status,
const int16_t *of_azimuth,
const int16_t *of_elevation,
const int16_t *azimuth,
const int16_t *elevation,
const uint8_t *of_info)
69 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
70 char buf[MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN];
71 _mav_put_uint64_t(buf, 0, time_usec);
72 _mav_put_uint8_t(buf, 152, id_sensor);
73 _mav_put_uint8_t(buf, 153, nb_sensors);
74 _mav_put_uint8_t(buf, 154, nb_of);
75 _mav_put_uint8_t(buf, 155, status);
76 _mav_put_int16_t_array(buf, 8, of_azimuth, 18);
77 _mav_put_int16_t_array(buf, 44, of_elevation, 18);
78 _mav_put_int16_t_array(buf, 80, azimuth, 18);
79 _mav_put_int16_t_array(buf, 116, elevation, 18);
80 _mav_put_uint8_t_array(buf, 156, of_info, 18);
81 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
89 mav_array_memcpy(packet.
of_azimuth, of_azimuth,
sizeof(int16_t)*18);
90 mav_array_memcpy(packet.
of_elevation, of_elevation,
sizeof(int16_t)*18);
91 mav_array_memcpy(packet.
azimuth, azimuth,
sizeof(int16_t)*18);
92 mav_array_memcpy(packet.
elevation, elevation,
sizeof(int16_t)*18);
93 mav_array_memcpy(packet.
of_info, of_info,
sizeof(uint8_t)*18);
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
97 msg->msgid = MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW;
99 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
101 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
123 static inline uint16_t mavlink_msg_spherical_optic_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
124 mavlink_message_t* msg,
125 uint64_t time_usec,uint8_t id_sensor,uint8_t nb_sensors,uint8_t nb_of,uint8_t status,
const int16_t *of_azimuth,
const int16_t *of_elevation,
const int16_t *azimuth,
const int16_t *elevation,
const uint8_t *of_info)
127 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
128 char buf[MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN];
129 _mav_put_uint64_t(buf, 0, time_usec);
130 _mav_put_uint8_t(buf, 152, id_sensor);
131 _mav_put_uint8_t(buf, 153, nb_sensors);
132 _mav_put_uint8_t(buf, 154, nb_of);
133 _mav_put_uint8_t(buf, 155, status);
134 _mav_put_int16_t_array(buf, 8, of_azimuth, 18);
135 _mav_put_int16_t_array(buf, 44, of_elevation, 18);
136 _mav_put_int16_t_array(buf, 80, azimuth, 18);
137 _mav_put_int16_t_array(buf, 116, elevation, 18);
138 _mav_put_uint8_t_array(buf, 156, of_info, 18);
139 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
145 packet.
nb_of = nb_of;
147 mav_array_memcpy(packet.
of_azimuth, of_azimuth,
sizeof(int16_t)*18);
148 mav_array_memcpy(packet.
of_elevation, of_elevation,
sizeof(int16_t)*18);
149 mav_array_memcpy(packet.
azimuth, azimuth,
sizeof(int16_t)*18);
150 mav_array_memcpy(packet.
elevation, elevation,
sizeof(int16_t)*18);
151 mav_array_memcpy(packet.
of_info, of_info,
sizeof(uint8_t)*18);
152 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
155 msg->msgid = MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW;
156 #if MAVLINK_CRC_EXTRA
157 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
159 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
171 static inline uint16_t mavlink_msg_spherical_optic_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_spherical_optic_flow_t* spherical_optic_flow)
173 return mavlink_msg_spherical_optic_flow_pack(system_id, component_id, msg, spherical_optic_flow->
time_usec, spherical_optic_flow->
id_sensor, spherical_optic_flow->
nb_sensors, spherical_optic_flow->
nb_of, spherical_optic_flow->
status, spherical_optic_flow->
of_azimuth, spherical_optic_flow->
of_elevation, spherical_optic_flow->
azimuth, spherical_optic_flow->
elevation, spherical_optic_flow->
of_info);
185 static inline uint16_t mavlink_msg_spherical_optic_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_spherical_optic_flow_t* spherical_optic_flow)
187 return mavlink_msg_spherical_optic_flow_pack_chan(system_id, component_id, chan, msg, spherical_optic_flow->
time_usec, spherical_optic_flow->
id_sensor, spherical_optic_flow->
nb_sensors, spherical_optic_flow->
nb_of, spherical_optic_flow->
status, spherical_optic_flow->
of_azimuth, spherical_optic_flow->
of_elevation, spherical_optic_flow->
azimuth, spherical_optic_flow->
elevation, spherical_optic_flow->
of_info);
205 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
207 static inline void mavlink_msg_spherical_optic_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t id_sensor, uint8_t nb_sensors, uint8_t nb_of, uint8_t status,
const int16_t *of_azimuth,
const int16_t *of_elevation,
const int16_t *azimuth,
const int16_t *elevation,
const uint8_t *of_info)
209 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
210 char buf[MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN];
211 _mav_put_uint64_t(buf, 0, time_usec);
212 _mav_put_uint8_t(buf, 152, id_sensor);
213 _mav_put_uint8_t(buf, 153, nb_sensors);
214 _mav_put_uint8_t(buf, 154, nb_of);
215 _mav_put_uint8_t(buf, 155, status);
216 _mav_put_int16_t_array(buf, 8, of_azimuth, 18);
217 _mav_put_int16_t_array(buf, 44, of_elevation, 18);
218 _mav_put_int16_t_array(buf, 80, azimuth, 18);
219 _mav_put_int16_t_array(buf, 116, elevation, 18);
220 _mav_put_uint8_t_array(buf, 156, of_info, 18);
221 #if MAVLINK_CRC_EXTRA
222 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
224 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
231 packet.
nb_of = nb_of;
233 mav_array_memcpy(packet.
of_azimuth, of_azimuth,
sizeof(int16_t)*18);
234 mav_array_memcpy(packet.
of_elevation, of_elevation,
sizeof(int16_t)*18);
235 mav_array_memcpy(packet.
azimuth, azimuth,
sizeof(int16_t)*18);
236 mav_array_memcpy(packet.
elevation, elevation,
sizeof(int16_t)*18);
237 mav_array_memcpy(packet.
of_info, of_info,
sizeof(uint8_t)*18);
238 #if MAVLINK_CRC_EXTRA
239 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, (
const char *)&packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
241 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, (
const char *)&packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
246 #if MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
254 static inline void mavlink_msg_spherical_optic_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t id_sensor, uint8_t nb_sensors, uint8_t nb_of, uint8_t status,
const int16_t *of_azimuth,
const int16_t *of_elevation,
const int16_t *azimuth,
const int16_t *elevation,
const uint8_t *of_info)
256 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
257 char *buf = (
char *)msgbuf;
258 _mav_put_uint64_t(buf, 0, time_usec);
259 _mav_put_uint8_t(buf, 152, id_sensor);
260 _mav_put_uint8_t(buf, 153, nb_sensors);
261 _mav_put_uint8_t(buf, 154, nb_of);
262 _mav_put_uint8_t(buf, 155, status);
263 _mav_put_int16_t_array(buf, 8, of_azimuth, 18);
264 _mav_put_int16_t_array(buf, 44, of_elevation, 18);
265 _mav_put_int16_t_array(buf, 80, azimuth, 18);
266 _mav_put_int16_t_array(buf, 116, elevation, 18);
267 _mav_put_uint8_t_array(buf, 156, of_info, 18);
268 #if MAVLINK_CRC_EXTRA
269 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
271 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, buf, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
278 packet->
nb_of = nb_of;
280 mav_array_memcpy(packet->
of_azimuth, of_azimuth,
sizeof(int16_t)*18);
281 mav_array_memcpy(packet->
of_elevation, of_elevation,
sizeof(int16_t)*18);
282 mav_array_memcpy(packet->
azimuth, azimuth,
sizeof(int16_t)*18);
283 mav_array_memcpy(packet->
elevation, elevation,
sizeof(int16_t)*18);
284 mav_array_memcpy(packet->
of_info, of_info,
sizeof(uint8_t)*18);
285 #if MAVLINK_CRC_EXTRA
286 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, (
const char *)packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_CRC);
288 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW, (
const char *)packet, MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
304 static inline uint64_t mavlink_msg_spherical_optic_flow_get_time_usec(
const mavlink_message_t* msg)
306 return _MAV_RETURN_uint64_t(msg, 0);
314 static inline uint8_t mavlink_msg_spherical_optic_flow_get_id_sensor(
const mavlink_message_t* msg)
316 return _MAV_RETURN_uint8_t(msg, 152);
324 static inline uint8_t mavlink_msg_spherical_optic_flow_get_nb_sensors(
const mavlink_message_t* msg)
326 return _MAV_RETURN_uint8_t(msg, 153);
334 static inline uint8_t mavlink_msg_spherical_optic_flow_get_nb_of(
const mavlink_message_t* msg)
336 return _MAV_RETURN_uint8_t(msg, 154);
344 static inline uint8_t mavlink_msg_spherical_optic_flow_get_status(
const mavlink_message_t* msg)
346 return _MAV_RETURN_uint8_t(msg, 155);
354 static inline uint16_t mavlink_msg_spherical_optic_flow_get_of_azimuth(
const mavlink_message_t* msg, int16_t *of_azimuth)
356 return _MAV_RETURN_int16_t_array(msg, of_azimuth, 18, 8);
364 static inline uint16_t mavlink_msg_spherical_optic_flow_get_of_elevation(
const mavlink_message_t* msg, int16_t *of_elevation)
366 return _MAV_RETURN_int16_t_array(msg, of_elevation, 18, 44);
374 static inline uint16_t mavlink_msg_spherical_optic_flow_get_azimuth(
const mavlink_message_t* msg, int16_t *azimuth)
376 return _MAV_RETURN_int16_t_array(msg, azimuth, 18, 80);
384 static inline uint16_t mavlink_msg_spherical_optic_flow_get_elevation(
const mavlink_message_t* msg, int16_t *elevation)
386 return _MAV_RETURN_int16_t_array(msg, elevation, 18, 116);
394 static inline uint16_t mavlink_msg_spherical_optic_flow_get_of_info(
const mavlink_message_t* msg, uint8_t *of_info)
396 return _MAV_RETURN_uint8_t_array(msg, of_info, 18, 156);
407 #if MAVLINK_NEED_BYTE_SWAP
408 spherical_optic_flow->
time_usec = mavlink_msg_spherical_optic_flow_get_time_usec(msg);
409 mavlink_msg_spherical_optic_flow_get_of_azimuth(msg, spherical_optic_flow->
of_azimuth);
410 mavlink_msg_spherical_optic_flow_get_of_elevation(msg, spherical_optic_flow->
of_elevation);
411 mavlink_msg_spherical_optic_flow_get_azimuth(msg, spherical_optic_flow->
azimuth);
412 mavlink_msg_spherical_optic_flow_get_elevation(msg, spherical_optic_flow->
elevation);
413 spherical_optic_flow->
id_sensor = mavlink_msg_spherical_optic_flow_get_id_sensor(msg);
414 spherical_optic_flow->
nb_sensors = mavlink_msg_spherical_optic_flow_get_nb_sensors(msg);
415 spherical_optic_flow->
nb_of = mavlink_msg_spherical_optic_flow_get_nb_of(msg);
416 spherical_optic_flow->
status = mavlink_msg_spherical_optic_flow_get_status(msg);
417 mavlink_msg_spherical_optic_flow_get_of_info(msg, spherical_optic_flow->
of_info);
419 memcpy(spherical_optic_flow, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SPHERICAL_OPTIC_FLOW_LEN);
Definition: mavlink_msg_spherical_optic_flow.h:5
uint8_t nb_of
Number of Optic Flow vectors sent in this message (between 0 and 16)
Definition: mavlink_msg_spherical_optic_flow.h:14
int16_t of_elevation[18]
Elevation component of optic flow vectors, in millirad /sec.
Definition: mavlink_msg_spherical_optic_flow.h:9
uint8_t of_info[18]
Information on the optic flow vectors.
Definition: mavlink_msg_spherical_optic_flow.h:16
int16_t azimuth[18]
Azimuth of regions used for optic flow computation, in millirad.
Definition: mavlink_msg_spherical_optic_flow.h:10
int16_t of_azimuth[18]
Azimuthal component of optic flow vectors, in millirad /sec.
Definition: mavlink_msg_spherical_optic_flow.h:8
uint8_t status
Status of the sensor.
Definition: mavlink_msg_spherical_optic_flow.h:15
uint8_t nb_sensors
Number of sensors sending data, this can also be used to indicate in how many messages the data from ...
Definition: mavlink_msg_spherical_optic_flow.h:13
uint64_t time_usec
Timestamp (microseconds since UNIX epoch or microseconds since system boot)
Definition: mavlink_msg_spherical_optic_flow.h:7
uint8_t id_sensor
Sensor ID.
Definition: mavlink_msg_spherical_optic_flow.h:12
int16_t elevation[18]
Elevation of regions used for optic flow computation, in millirad.
Definition: mavlink_msg_spherical_optic_flow.h:11