|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
39 #include "pprzlink/messages.h"
47 #define MAVLINK_OPTICAL_HEARTBEAT_MSG_ID 0
48 #define MAVLINK_OPTICAL_FLOW_MSG_ID 100
49 #define MAVLINK_OPTICAL_FLOW_RAD_MSG_ID 106
58 #ifndef PX4FLOW_QUALITY_THRESHOLD
59 #define PX4FLOW_QUALITY_THRESHOLD 0.1
80 static float quality = 0;
81 static float noise = 0;
85 noise = noise * noise;
104 float gain = (float)fabs( (
double) (cosf(phi) * cosf(theta)));
164 static float timestamp = 0;
165 static uint8_t distance_quality = 0;
Structure to submit a callback.
static void decode_heartbeat_msg(struct mavlink_message *msg)
void px4flow_init(void)
Initialization function.
static void decode_optical_flow_msg(struct mavlink_message *msg)
Mavlink optical flow structure.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static void decode_optical_flow_rad_msg(struct mavlink_message *msg)
According to https://pixhawk.org/modules/px4flow the PX4flow module outputs OPTICAL_FLOW_RAD message ...
uint8_t sensor_id
Sensor ID.
float ground_distance
Ground distance in meters. Positive value: distance known. Negative value: Unknown distance.
struct mavlink_transport mavlink_tp
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define MAVLINK_OPTICAL_FLOW_MSG_ID
float flow_comp_m_x
Flow in meters in x-sensor direction, angular-speed compensated [meters/sec].
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
struct mavlink_msg_req req_heartbeat
struct mavlink_optical_flow_rad optical_flow_rad
#define PX4FLOW_QUALITY_THRESHOLD
Mavlink optical flow rad structure.
uint8_t quality
Optical flow quality / confidence. 0: bad, 255: maximum quality.
void(* callback)(struct mavlink_message *msg)
Callback function.
driver for the optical flow sensor PX4FLOW
struct mavlink_message msg
Mavlink message.
Common code for AP and FBW telemetry.
uint8_t msg_id
Requested message ID.
float flow_comp_m_y
Flow in meters in y-sensor direction, angular-speed compensated [meters/sec].
simple decoder of mavlink message
struct mavlink_heartbeat heartbeat
#define AGL_SONAR_PX4FLOW_ID
int32_t flow_x
Flow in pixels in x-sensor direction.
#define MAVLINK_OPTICAL_FLOW_RAD_MSG_ID
bool px4flow_compensate_rotation
uint64_t time_usec
Timestamp (UNIX)
struct mavlink_msg_req req_flow_rad
Mavlink v1.0 message structure.
static void mavlink_register_msg(struct mavlink_transport *t, struct mavlink_msg_req *req)
Register a callback for a mavlink message.
int32_t flow_y
Flow in pixels in y-sensor direction.
struct mavlink_msg_req req_flow
#define MAVLINK_OPTICAL_HEARTBEAT_MSG_ID
struct mavlink_optical_flow optical_flow
void px4flow_downlink(void)
Downlink message for debug.