MAV'RIC
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
PX4Flow Class Reference

Interface for Optic Flow sensors. More...

#include <px4flow.hpp>

Inheritance diagram for PX4Flow:
Inheritance graph
[legend]
Collaboration diagram for PX4Flow:
Collaboration graph
[legend]

List of all members.

Public Types

enum  orientation_t { ORIENT_0_DEG = 0, ORIENT_90_DEG = 1, ORIENT_180_DEG = 2, ORIENT_270_DEG = 3 }
 Enumeration of possible orientations for the sensor rel. to the drone.

Public Member Functions

 PX4Flow (void)
 Constructor.
bool healthy (void) const
 Indicates whether the measurements can be trusted.
virtual bool update (void)=0
 Main update function.
float flow_x (void) const
 Get flow in x direction.
float flow_y (void) const
 Get flow in y direction.
uint8_t flow_quality (void) const
 Get flow quality.
float velocity_x (void) const
 Get velocity in x direction.
float velocity_y (void) const
 Get velocity in y direction.
float velocity_z (void) const
 Get velocity in z direction.
float ground_distance (void) const
 Get ground distance.
float last_update_s (void) const
 Get last update time in seconds.

Static Public Member Functions

static bool update_task (PX4Flow *flow)
 Glue function used for scheduler.

Protected Member Functions

void rotate_raw_values (orientation_t orientation, float flow_x_raw, float flow_y_raw, float velocity_x_raw, float velocity_y_raw)
 Applies rotation to raw readings based on how the camera is mounted on drone.

Protected Attributes

float flow_x_
 Optic flow in x direction (rad/s)
float flow_y_
 Optic flow in y direction (rad/s)
uint8_t flow_quality_
 Quality of optic flow measurement (between 0 and 255)
float velocity_x_
 Velocity in x direction (m/s)
float velocity_y_
 Velocity in y direction (m/s)
float velocity_z_
 Velocity in z direction (m/s)
float ground_distance_
 Ground distance (m)
Buffer_T< 3, float > ground_distance_buffer_
 Buffer used to filter sonar measurement.
float last_update_s_
 Last update time in seconds.
bool is_healthy_
 Indicates if sensor data can be trusted.

Detailed Description

Interface for Optic Flow sensors.


Member Function Documentation

uint8_t PX4Flow::flow_quality ( void  ) const

Get flow quality.

Returns:
Value
float PX4Flow::flow_x ( void  ) const

Get flow in x direction.

Returns:
Value
float PX4Flow::flow_y ( void  ) const

Get flow in y direction.

Returns:
Value
float PX4Flow::ground_distance ( void  ) const

Get ground distance.

Returns:
Value
bool PX4Flow::healthy ( void  ) const

Indicates whether the measurements can be trusted.

Returns:
Value

Here is the caller graph for this function:

float PX4Flow::last_update_s ( void  ) const

Get last update time in seconds.

Returns:
Value

Here is the caller graph for this function:

void PX4Flow::rotate_raw_values ( orientation_t  orientation,
float  flow_x_raw,
float  flow_y_raw,
float  velocity_x_raw,
float  velocity_y_raw 
) [protected]

Applies rotation to raw readings based on how the camera is mounted on drone.

Parameters:
orientationOrientation of camera
flow_x_rawX flow in camera frmae
flow_y_rawY flow in camera frmae
velocity_x_rawX velocity in camera frmae
velocity_y_rawY velocity in camera frmae

Here is the caller graph for this function:

virtual bool PX4Flow::update ( void  ) [pure virtual]

Main update function.

Returns:
success

Implemented in PX4Flow_serial, and PX4Flow_i2c.

Here is the caller graph for this function:

static bool PX4Flow::update_task ( PX4Flow flow) [inline, static]

Glue function used for scheduler.

Parameters:
flowPointer to flow object
Returns:
success

Here is the call graph for this function:

float PX4Flow::velocity_x ( void  ) const

Get velocity in x direction.

Returns:
Value
float PX4Flow::velocity_y ( void  ) const

Get velocity in y direction.

Returns:
Value
float PX4Flow::velocity_z ( void  ) const

Get velocity in z direction.

Returns:
Value

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines