Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
px4flow.c File Reference

driver for the optical flow sensor PX4FLOW More...

#include "modules/optical_flow/px4flow.h"
#include "modules/datalink/mavlink_decoder.h"
#include "modules/core/abi.h"
#include "state.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
+ Include dependency graph for px4flow.c:

Go to the source code of this file.

Macros

#define MAVLINK_OPTICAL_HEARTBEAT_MSG_ID   0
 
#define MAVLINK_OPTICAL_FLOW_MSG_ID   100
 
#define MAVLINK_OPTICAL_FLOW_RAD_MSG_ID   106
 
#define PX4FLOW_QUALITY_THRESHOLD   0.1
 

Functions

static void decode_optical_flow_msg (struct mavlink_message *msg)
 
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 as well as OPTICAL_FLOW message. More...
 
static void decode_heartbeat_msg (struct mavlink_message *msg)
 
void px4flow_init (void)
 Initialization function. More...
 
void px4flow_downlink (void)
 Downlink message for debug. More...
 

Variables

struct mavlink_heartbeat heartbeat
 
struct mavlink_optical_flow optical_flow
 
struct mavlink_optical_flow_rad optical_flow_rad
 
struct mavlink_msg_req req_flow
 
struct mavlink_msg_req req_flow_rad
 
struct mavlink_msg_req req_heartbeat
 
bool px4flow_update_agl
 
bool px4flow_compensate_rotation
 
float px4flow_stddev
 

Detailed Description

driver for the optical flow sensor PX4FLOW

driver for the optical flow sensor PX4FLOW over i2c

Sensor from the PIXHAWK project

Definition in file px4flow.c.

Macro Definition Documentation

◆ MAVLINK_OPTICAL_FLOW_MSG_ID

#define MAVLINK_OPTICAL_FLOW_MSG_ID   100

Definition at line 48 of file px4flow.c.

◆ MAVLINK_OPTICAL_FLOW_RAD_MSG_ID

#define MAVLINK_OPTICAL_FLOW_RAD_MSG_ID   106

Definition at line 49 of file px4flow.c.

◆ MAVLINK_OPTICAL_HEARTBEAT_MSG_ID

#define MAVLINK_OPTICAL_HEARTBEAT_MSG_ID   0

Definition at line 47 of file px4flow.c.

◆ PX4FLOW_QUALITY_THRESHOLD

#define PX4FLOW_QUALITY_THRESHOLD   0.1

Definition at line 59 of file px4flow.c.

Function Documentation

◆ decode_heartbeat_msg()

static void decode_heartbeat_msg ( struct mavlink_message msg)
static

Definition at line 128 of file px4flow.c.

Referenced by px4flow_init().

+ Here is the caller graph for this function:

◆ decode_optical_flow_msg()

◆ decode_optical_flow_rad_msg()

static void decode_optical_flow_rad_msg ( struct mavlink_message msg)
static

According to https://pixhawk.org/modules/px4flow the PX4flow module outputs OPTICAL_FLOW_RAD message as well as OPTICAL_FLOW message.

However, on my camera only OPTICAL_FLOW is received. Maybe different firmwares send different messages?

Definition at line 123 of file px4flow.c.

Referenced by px4flow_init().

+ Here is the caller graph for this function:

◆ px4flow_downlink()

◆ px4flow_init()

Variable Documentation

◆ heartbeat

struct mavlink_heartbeat heartbeat

Definition at line 1 of file px4flow.c.

Referenced by jevois_mavlink_event(), and px4flow_init().

◆ optical_flow

struct mavlink_optical_flow optical_flow

Definition at line 1 of file px4flow.c.

Referenced by decode_optical_flow_msg(), px4flow_downlink(), and px4flow_init().

◆ optical_flow_rad

struct mavlink_optical_flow_rad optical_flow_rad

Definition at line 1 of file px4flow.c.

Referenced by px4flow_init().

◆ px4flow_compensate_rotation

bool px4flow_compensate_rotation

Definition at line 71 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

◆ px4flow_stddev

float px4flow_stddev

Definition at line 74 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

◆ px4flow_update_agl

bool px4flow_update_agl

Definition at line 68 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

◆ req_flow

struct mavlink_msg_req req_flow

Definition at line 1 of file px4flow.c.

Referenced by px4flow_init().

◆ req_flow_rad

struct mavlink_msg_req req_flow_rad

Definition at line 1 of file px4flow.c.

Referenced by px4flow_init().

◆ req_heartbeat

struct mavlink_msg_req req_heartbeat

Definition at line 1 of file px4flow.c.

Referenced by px4flow_init().