Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include <stdlib.h>
#include "mateksys_3901_l0x.h"
#include "mcu_periph/uart.h"
#include "modules/core/abi.h"
#include "state.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
Macros | |
#define | MATEKSYS_3901_L0X_MOTION_THRES 100 |
#define | MATEKSYS_3901_L0X_DISTANCE_THRES 200 |
#define | MATEKSYS_3901_L0X_MAX_FLOW 300 |
#define | MATEKSYS_3901_L0X_MAX_DISTANCE 3000 |
#define | USE_MATEKSYS_3901_L0X_AGL 1 |
#define | USE_MATEKSYS_3901_L0X_OPTICAL_FLOW 1 |
#define | MATEKSYS_3901_L0X_COMPENSATE_ROTATION 1 |
#define | MATEKSYS_3901_L0X_FLOW_X_SCALER 1 |
#define | MATEKSYS_3901_L0X_FLOW_Y_SCALER 1 |
Functions | |
static void | mateksys3901l0x_parse (uint8_t byte) |
Parse the sensor MSP output bytes 1 by 1. More... | |
static void | mateksys3901l0x_send_optical_flow (struct transport_tx *trans, struct link_device *dev) |
Downlink message flow and lidar (included velocity estimation, not yet tested) More... | |
void | mateksys3901l0x_init (void) |
Initialization function. More... | |
void | mateksys_3901_l0x_scale_X (float scalex) |
Scale the Flow X. More... | |
void | mateksys_3901_l0x_scale_Y (float scaley) |
Scale the Flow Y. More... | |
void | mateksys3901l0x_event (void) |
Receive bytes from the UART port and parse them. More... | |
Variables | |
struct Mateksys3901l0X | mateksys3901l0x |
#define MATEKSYS_3901_L0X_COMPENSATE_ROTATION 1 |
Definition at line 67 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_DISTANCE_THRES 200 |
Definition at line 47 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_FLOW_X_SCALER 1 |
Definition at line 71 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_FLOW_Y_SCALER 1 |
Definition at line 75 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_MAX_DISTANCE 3000 |
Definition at line 55 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_MAX_FLOW 300 |
Definition at line 51 of file mateksys_3901_l0x.c.
#define MATEKSYS_3901_L0X_MOTION_THRES 100 |
Definition at line 43 of file mateksys_3901_l0x.c.
#define USE_MATEKSYS_3901_L0X_AGL 1 |
Definition at line 59 of file mateksys_3901_l0x.c.
#define USE_MATEKSYS_3901_L0X_OPTICAL_FLOW 1 |
Definition at line 63 of file mateksys_3901_l0x.c.
void mateksys3901l0x_event | ( | void | ) |
Receive bytes from the UART port and parse them.
Definition at line 151 of file mateksys_3901_l0x.c.
References Mateksys3901l0X::device, mateksys3901l0x, mateksys3901l0x_parse(), MATEKSYS_3901_L0X_INITIALIZE, and Mateksys3901l0X::parse_status.
void mateksys3901l0x_init | ( | void | ) |
Initialization function.
Definition at line 110 of file mateksys_3901_l0x.c.
References DefaultPeriodic, Mateksys3901l0X::device, Mateksys3901l0X::distance_compensated, Mateksys3901l0X::distancemm, Mateksys3901l0X::distancemm_quality, Mateksys3901l0X::distancemm_temp, mateksys3901l0x, mateksys3901l0x_send_optical_flow(), MATEKSYS_3901_L0X_FLOW_X_SCALER, MATEKSYS_3901_L0X_FLOW_Y_SCALER, MATEKSYS_3901_L0X_PARSE_HEAD, Mateksys3901l0X::motion_quality, Mateksys3901l0X::motionX, Mateksys3901l0X::motionX_temp, Mateksys3901l0X::motionY, Mateksys3901l0X::motionY_temp, Mateksys3901l0X::parse_crc, Mateksys3901l0X::parse_status, register_periodic_telemetry(), Mateksys3901l0X::scaler_x, and Mateksys3901l0X::scaler_y.
|
static |
Parse the sensor MSP output bytes 1 by 1.
Definition at line 161 of file mateksys_3901_l0x.c.
References AGL_LIDAR_MATEKSYS_3901_L0X_ID, byte, Mateksys3901l0X::distance_compensated, Mateksys3901l0X::distancemm, Mateksys3901l0X::distancemm_quality, Mateksys3901l0X::distancemm_temp, FLOW_OPTICFLOW_MATEKSYS_3901_L0X_ID, get_sys_time_usec(), mateksys3901l0x, MATEKSYS_3901_L0X_COMPENSATE_ROTATION, MATEKSYS_3901_L0X_DISTANCE_THRES, MATEKSYS_3901_L0X_INITIALIZE, MATEKSYS_3901_L0X_MAX_DISTANCE, MATEKSYS_3901_L0X_MAX_FLOW, MATEKSYS_3901_L0X_MOTION_THRES, MATEKSYS_3901_L0X_PARSE_CHECKSUM, MATEKSYS_3901_L0X_PARSE_DIRECTION, MATEKSYS_3901_L0X_PARSE_DISTANCE_B1, MATEKSYS_3901_L0X_PARSE_DISTANCE_B2, MATEKSYS_3901_L0X_PARSE_DISTANCE_B3, MATEKSYS_3901_L0X_PARSE_DISTANCE_B4, MATEKSYS_3901_L0X_PARSE_DISTANCEQUALITY, MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B1, MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B2, MATEKSYS_3901_L0X_PARSE_HEAD, MATEKSYS_3901_L0X_PARSE_HEAD2, MATEKSYS_3901_L0X_PARSE_LENGTH, MATEKSYS_3901_L0X_PARSE_MOTIONQUALITY, MATEKSYS_3901_L0X_PARSE_MOTIONX_B1, MATEKSYS_3901_L0X_PARSE_MOTIONX_B2, MATEKSYS_3901_L0X_PARSE_MOTIONX_B3, MATEKSYS_3901_L0X_PARSE_MOTIONX_B4, MATEKSYS_3901_L0X_PARSE_MOTIONY_B1, MATEKSYS_3901_L0X_PARSE_MOTIONY_B2, MATEKSYS_3901_L0X_PARSE_MOTIONY_B3, MATEKSYS_3901_L0X_PARSE_MOTIONY_B4, MATEKSYS_3901_L0X_PARSE_POINTER, MATEKSYS_3901_L0X_PARSE_SIZE, Mateksys3901l0X::motion_quality, Mateksys3901l0X::motionX, Mateksys3901l0X::motionX_temp, Mateksys3901l0X::motionY, Mateksys3901l0X::motionY_temp, Mateksys3901l0X::parse_crc, Mateksys3901l0X::parse_status, FloatEulers::phi, Mateksys3901l0X::scaler_x, Mateksys3901l0X::scaler_y, Mateksys3901l0X::sensor_id, stateGetNedToBodyEulers_f(), FloatEulers::theta, Mateksys3901l0X::time_usec, USE_MATEKSYS_3901_L0X_AGL, USE_MATEKSYS_3901_L0X_OPTICAL_FLOW, Mateksys3901l0X::velocityX, and Mateksys3901l0X::velocityY.
Referenced by mateksys3901l0x_event().
|
static |
Downlink message flow and lidar (included velocity estimation, not yet tested)
Definition at line 90 of file mateksys_3901_l0x.c.
References dev, Mateksys3901l0X::distance_compensated, Mateksys3901l0X::distancemm, Mateksys3901l0X::distancemm_quality, mateksys3901l0x, Mateksys3901l0X::motion_quality, Mateksys3901l0X::motionX, Mateksys3901l0X::motionY, Mateksys3901l0X::sensor_id, Mateksys3901l0X::time_usec, Mateksys3901l0X::velocityX, and Mateksys3901l0X::velocityY.
Referenced by mateksys3901l0x_init().
void mateksys_3901_l0x_scale_X | ( | float | scalex | ) |
Scale the Flow X.
Definition at line 135 of file mateksys_3901_l0x.c.
References mateksys3901l0x, and Mateksys3901l0X::scaler_x.
void mateksys_3901_l0x_scale_Y | ( | float | scaley | ) |
Scale the Flow Y.
Definition at line 143 of file mateksys_3901_l0x.c.
References mateksys3901l0x, and Mateksys3901l0X::scaler_y.
struct Mateksys3901l0X mateksys3901l0x |
Definition at line 1 of file mateksys_3901_l0x.c.
Referenced by mateksys3901l0x_event(), mateksys3901l0x_init(), mateksys3901l0x_parse(), mateksys3901l0x_send_optical_flow(), mateksys_3901_l0x_scale_X(), and mateksys_3901_l0x_scale_Y().