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
opticflow_pmw3901.c File Reference
#include "modules/sensors/opticflow_pmw3901.h"
#include "subsystems/abi.h"
#include "subsystems/datalink/downlink.h"
#include "generated/modules.h"
#include "state.h"
#include "std.h"
#include <math.h>
+ Include dependency graph for opticflow_pmw3901.c:

Go to the source code of this file.

Macros

#define OPTICFLOW_PMW3901_SENSOR_ANGLE   270
 
#define OPTICFLOW_PMW3901_SUBPIXEL_FACTOR   100
 
#define OPTICFLOW_PMW3901_STD_PX   50
 
#define OPTICFLOW_PMW3901_AGL_ID   ABI_BROADCAST
 
#define OPTICFLOW_PMW3901_AGL_TIMEOUT_US   500000
 

Functions

static void agl_cb (uint8_t sender_id, uint32_t stamp, float distance)
 
static bool agl_valid (uint32_t at_ts)
 
static void opticflow_pmw3901_publish (int16_t delta_x, int16_t delta_y, uint32_t ts_usec)
 
void opticflow_pmw3901_init (void)
 
void opticflow_pmw3901_periodic (void)
 
void opticflow_pmw3901_event (void)
 

Variables

struct opticflow_pmw3901_t of_pmw
 
abi_event agl_ev
 
static float agl_dist
 
static uint32_t agl_ts
 

Detailed Description

Author
Tom van Dijk Driver for PMW3901 optical flow sensor

Definition in file opticflow_pmw3901.c.

Macro Definition Documentation

#define OPTICFLOW_PMW3901_AGL_ID   ABI_BROADCAST

Definition at line 52 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

#define OPTICFLOW_PMW3901_AGL_TIMEOUT_US   500000

Definition at line 57 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

#define OPTICFLOW_PMW3901_SENSOR_ANGLE   270

Definition at line 40 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

#define OPTICFLOW_PMW3901_STD_PX   50

Definition at line 48 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

#define OPTICFLOW_PMW3901_SUBPIXEL_FACTOR   100

Definition at line 44 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

Function Documentation

static void agl_cb ( uint8_t  sender_id,
uint32_t  stamp,
float  distance 
)
static

Definition at line 68 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_init().

+ Here is the caller graph for this function:

static bool agl_valid ( uint32_t  at_ts)
static

Definition at line 74 of file opticflow_pmw3901.c.

References opticflow_pmw3901_t::agl_timeout, agl_ts, and of_pmw.

Referenced by opticflow_pmw3901_publish().

+ Here is the caller graph for this function:

void opticflow_pmw3901_event ( void  )
void opticflow_pmw3901_periodic ( void  )

Definition at line 178 of file opticflow_pmw3901.c.

References of_pmw, opticflow_pmw3901_t::pmw, pmw3901_is_idle(), and pmw3901_start_read().

+ Here is the call graph for this function:

static void opticflow_pmw3901_publish ( int16_t  delta_x,
int16_t  delta_y,
uint32_t  ts_usec 
)
static

Variable Documentation

float agl_dist
static

Definition at line 64 of file opticflow_pmw3901.c.

Referenced by opticflow_pmw3901_publish().

abi_event agl_ev

Definition at line 63 of file opticflow_pmw3901.c.

uint32_t agl_ts
static

Definition at line 65 of file opticflow_pmw3901.c.

Referenced by agl_valid().