Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 "subsystems/abi.h"
#include "state.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "subsystems/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

#define MAVLINK_OPTICAL_FLOW_MSG_ID   100

Definition at line 48 of file px4flow.c.

Referenced by px4flow_init().

#define MAVLINK_OPTICAL_FLOW_RAD_MSG_ID   106

Definition at line 49 of file px4flow.c.

Referenced by px4flow_init().

#define MAVLINK_OPTICAL_HEARTBEAT_MSG_ID   0

Definition at line 47 of file px4flow.c.

Referenced by px4flow_init().

#define PX4FLOW_QUALITY_THRESHOLD   0.1

Definition at line 59 of file px4flow.c.

Referenced by decode_optical_flow_msg().

Function Documentation

static void decode_heartbeat_msg ( struct mavlink_message msg)
static

Definition at line 127 of file px4flow.c.

Referenced by px4flow_init().

+ Here is the caller graph for this function:

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 122 of file px4flow.c.

Referenced by px4flow_init().

+ Here is the caller graph for this function:

Variable Documentation

struct mavlink_heartbeat heartbeat

Definition at line 42 of file px4flow.c.

Referenced by jevois_mavlink_event(), and px4flow_init().

struct mavlink_optical_flow optical_flow

Definition at line 43 of file px4flow.c.

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

struct mavlink_optical_flow_rad optical_flow_rad

Definition at line 44 of file px4flow.c.

Referenced by px4flow_init().

bool px4flow_compensate_rotation

Definition at line 71 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

float px4flow_stddev

Definition at line 74 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

bool px4flow_update_agl

Definition at line 68 of file px4flow.c.

Referenced by decode_optical_flow_msg(), and px4flow_init().

struct mavlink_msg_req req_flow

Definition at line 63 of file px4flow.c.

Referenced by px4flow_init().

struct mavlink_msg_req req_flow_rad

Definition at line 64 of file px4flow.c.

Referenced by px4flow_init().

struct mavlink_msg_req req_heartbeat

Definition at line 65 of file px4flow.c.

Referenced by px4flow_init().