MAV'RIC
|
Interface for Optic Flow sensors. More...
#include <px4flow.hpp>
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. |
Interface for Optic Flow sensors.
uint8_t PX4Flow::flow_quality | ( | void | ) | const |
Get flow quality.
float PX4Flow::flow_x | ( | void | ) | const |
Get flow in x direction.
float PX4Flow::flow_y | ( | void | ) | const |
Get flow in y direction.
float PX4Flow::ground_distance | ( | void | ) | const |
Get ground distance.
bool PX4Flow::healthy | ( | void | ) | const |
Indicates whether the measurements can be trusted.
float PX4Flow::last_update_s | ( | void | ) | const |
Get last update time in seconds.
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.
orientation | Orientation of camera |
flow_x_raw | X flow in camera frmae |
flow_y_raw | Y flow in camera frmae |
velocity_x_raw | X velocity in camera frmae |
velocity_y_raw | Y velocity in camera frmae |
virtual bool PX4Flow::update | ( | void | ) | [pure virtual] |
Main update function.
Implemented in PX4Flow_serial, and PX4Flow_i2c.
static bool PX4Flow::update_task | ( | PX4Flow * | flow | ) | [inline, static] |
Glue function used for scheduler.
flow | Pointer to flow object |
float PX4Flow::velocity_x | ( | void | ) | const |
Get velocity in x direction.
float PX4Flow::velocity_y | ( | void | ) | const |
Get velocity in y direction.
float PX4Flow::velocity_z | ( | void | ) | const |
Get velocity in z direction.