3 #define MAVLINK_MSG_ID_OPTICAL_FLOW 100
17 #define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26
18 #define MAVLINK_MSG_ID_100_LEN 26
20 #define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175
21 #define MAVLINK_MSG_ID_100_CRC 175
25 #define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
28 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
29 { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
30 { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
31 { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
32 { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
33 { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
34 { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
35 { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
56 static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
57 uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y,
float flow_comp_m_x,
float flow_comp_m_y, uint8_t quality,
float ground_distance)
59 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
109 static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
110 mavlink_message_t* msg,
111 uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,
float flow_comp_m_x,
float flow_comp_m_y,uint8_t quality,
float ground_distance)
113 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
140 #if MAVLINK_CRC_EXTRA
155 static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_optical_flow_t* optical_flow)
157 return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->
time_usec, optical_flow->
sensor_id, optical_flow->
flow_x, optical_flow->
flow_y, optical_flow->
flow_comp_m_x, optical_flow->
flow_comp_m_y, optical_flow->
quality, optical_flow->
ground_distance);
169 static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_optical_flow_t* optical_flow)
171 return mavlink_msg_optical_flow_pack_chan(system_id, component_id, chan, msg, optical_flow->
time_usec, optical_flow->
sensor_id, optical_flow->
flow_x, optical_flow->
flow_y, optical_flow->
flow_comp_m_x, optical_flow->
flow_comp_m_y, optical_flow->
quality, optical_flow->
ground_distance);
187 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
189 static inline void mavlink_msg_optical_flow_send(
mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y,
float flow_comp_m_x,
float flow_comp_m_y, uint8_t quality,
float ground_distance)
191 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
202 #if MAVLINK_CRC_EXTRA
218 #if MAVLINK_CRC_EXTRA
226 #if MAVLINK_MSG_ID_OPTICAL_FLOW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
234 static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf,
mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y,
float flow_comp_m_x,
float flow_comp_m_y, uint8_t quality,
float ground_distance)
236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237 char *buf = (
char *)msgbuf;
247 #if MAVLINK_CRC_EXTRA
263 #if MAVLINK_CRC_EXTRA
282 static inline uint64_t mavlink_msg_optical_flow_get_time_usec(
const mavlink_message_t* msg)
284 return _MAV_RETURN_uint64_t(msg, 0);
292 static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(
const mavlink_message_t* msg)
302 static inline int16_t mavlink_msg_optical_flow_get_flow_x(
const mavlink_message_t* msg)
304 return _MAV_RETURN_int16_t(msg, 20);
312 static inline int16_t mavlink_msg_optical_flow_get_flow_y(
const mavlink_message_t* msg)
314 return _MAV_RETURN_int16_t(msg, 22);
322 static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(
const mavlink_message_t* msg)
324 return _MAV_RETURN_float(msg, 8);
332 static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(
const mavlink_message_t* msg)
334 return _MAV_RETURN_float(msg, 12);
342 static inline uint8_t mavlink_msg_optical_flow_get_quality(
const mavlink_message_t* msg)
352 static inline float mavlink_msg_optical_flow_get_ground_distance(
const mavlink_message_t* msg)
354 return _MAV_RETURN_float(msg, 16);
363 static inline void mavlink_msg_optical_flow_decode(
const mavlink_message_t* msg,
mavlink_optical_flow_t* optical_flow)
365 #if MAVLINK_NEED_BYTE_SWAP
366 optical_flow->
time_usec = mavlink_msg_optical_flow_get_time_usec(msg);
367 optical_flow->
flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg);
368 optical_flow->
flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg);
369 optical_flow->
ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg);
370 optical_flow->
flow_x = mavlink_msg_optical_flow_get_flow_x(msg);
371 optical_flow->
flow_y = mavlink_msg_optical_flow_get_flow_y(msg);
372 optical_flow->
sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg);
373 optical_flow->
quality = mavlink_msg_optical_flow_get_quality(msg);
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
uint8_t quality
Optical flow quality / confidence. 0: bad, 255: maximum quality.
Definition: mavlink_msg_optical_flow.h:14
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN
Definition: mavlink_msg_optical_flow.h:17
#define MAVLINK_MSG_ID_OPTICAL_FLOW
Definition: mavlink_msg_optical_flow.h:3
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t length)
Finalize a MAVLink message with MAVLINK_COMM_0 as default channel.
Definition: mavlink_helpers.h:105
uint64_t time_usec
Timestamp (UNIX)
Definition: mavlink_msg_optical_flow.h:7
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:143
#define _MAV_PAYLOAD_NON_CONST(msg)
Definition: mavlink_types.h:172
int16_t flow_y
Flow in pixels * 10 in y-sensor direction (dezi-pixels)
Definition: mavlink_msg_optical_flow.h:12
mavlink_channel_t
Definition: mavlink_types.h:178
int16_t flow_x
Flow in pixels * 10 in x-sensor direction (dezi-pixels)
Definition: mavlink_msg_optical_flow.h:11
float flow_comp_m_y
Flow in meters in y-sensor direction, angular-speed compensated.
Definition: mavlink_msg_optical_flow.h:9
#define _MAV_PAYLOAD(msg)
Definition: mavlink_types.h:171
float ground_distance
Ground distance in meters. Positive value: distance known. Negative value: Unknown distance...
Definition: mavlink_msg_optical_flow.h:10
Definition: mavlink_msg_optical_flow.h:5
float flow_comp_m_x
Flow in meters in x-sensor direction, angular-speed compensated.
Definition: mavlink_msg_optical_flow.h:8
uint8_t sensor_id
Sensor ID.
Definition: mavlink_msg_optical_flow.h:13
struct __mavlink_optical_flow_t mavlink_optical_flow_t
MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t chan, uint8_t length)
Finalize a MAVLink message with channel assignment.
Definition: mavlink_helpers.h:71
#define _mav_put_int16_t(buf, wire_offset, b)
Definition: protocol.h:140
#define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC
Definition: mavlink_msg_optical_flow.h:20