37 #include "pprzlink/messages.h"
42 #ifndef MATEKSYS_3901_L0X_MOTION_THRES
43 #define MATEKSYS_3901_L0X_MOTION_THRES 100
46 #ifndef MATEKSYS_3901_L0X_DISTANCE_THRES
47 #define MATEKSYS_3901_L0X_DISTANCE_THRES 200
50 #ifndef MATEKSYS_3901_L0X_MAX_FLOW
51 #define MATEKSYS_3901_L0X_MAX_FLOW 300
54 #ifndef MATEKSYS_3901_L0X_MAX_DISTANCE
55 #define MATEKSYS_3901_L0X_MAX_DISTANCE 3000
58 #ifndef USE_MATEKSYS_3901_L0X_AGL
59 #define USE_MATEKSYS_3901_L0X_AGL 1
62 #ifndef USE_MATEKSYS_3901_L0X_OPTICAL_FLOW
63 #define USE_MATEKSYS_3901_L0X_OPTICAL_FLOW 1
66 #ifndef MATEKSYS_3901_L0X_COMPENSATE_ROTATION
67 #define MATEKSYS_3901_L0X_COMPENSATE_ROTATION 1
70 #ifndef MATEKSYS_3901_L0X_FLOW_X_SCALER
71 #define MATEKSYS_3901_L0X_FLOW_X_SCALER 1
74 #ifndef MATEKSYS_3901_L0X_FLOW_Y_SCALER
75 #define MATEKSYS_3901_L0X_FLOW_Y_SCALER 1
84 #if PERIODIC_TELEMETRY
92 pprz_msg_send_OPTICAL_FLOW(trans,
dev, AC_ID,
127 #if PERIODIC_TELEMETRY
200 if (
byte == 0x01 ||
byte == 0x02) {
219 if (
byte == 0x05 ||
byte == 0x09) {
Main include for ABI (AirBorneInterface).
#define AGL_LIDAR_MATEKSYS_3901_L0X_ID
#define FLOW_OPTICFLOW_MATEKSYS_3901_L0X_ID
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Common code for AP and FBW telemetry.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
#define MATEKSYS_3901_L0X_FLOW_X_SCALER
#define USE_MATEKSYS_3901_L0X_AGL
#define MATEKSYS_3901_L0X_DISTANCE_THRES
void mateksys_3901_l0x_scale_X(float scalex)
Scale the Flow X.
void mateksys3901l0x_init(void)
Initialization function.
static void mateksys3901l0x_parse(uint8_t byte)
Parse the sensor MSP output bytes 1 by 1.
#define MATEKSYS_3901_L0X_MAX_DISTANCE
#define MATEKSYS_3901_L0X_MOTION_THRES
#define USE_MATEKSYS_3901_L0X_OPTICAL_FLOW
void mateksys3901l0x_event(void)
Receive bytes from the UART port and parse them.
#define MATEKSYS_3901_L0X_MAX_FLOW
#define MATEKSYS_3901_L0X_COMPENSATE_ROTATION
#define MATEKSYS_3901_L0X_FLOW_Y_SCALER
void mateksys_3901_l0x_scale_Y(float scaley)
Scale the Flow Y.
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)
struct Mateksys3901l0X mateksys3901l0x
Driver for the mateksys_3901_l0x sensor via MSP protocol output.
float distance_compensated
enum Mateksys3901l0XParseStatus parse_status
uint8_t distancemm_quality
@ MATEKSYS_3901_L0X_PARSE_DISTANCEQUALITY
@ MATEKSYS_3901_L0X_PARSE_POINTER
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B4
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B1
@ MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B2
@ MATEKSYS_3901_L0X_PARSE_CHECKSUM
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B2
@ MATEKSYS_3901_L0X_PARSE_HEAD
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B2
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B3
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B3
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B3
@ MATEKSYS_3901_L0X_INITIALIZE
@ MATEKSYS_3901_L0X_PARSE_LENGTH
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B2
@ MATEKSYS_3901_L0X_PARSE_DISTANCE_B4
@ MATEKSYS_3901_L0X_PARSE_MOTIONQUALITY
@ MATEKSYS_3901_L0X_PARSE_DIRECTION
@ MATEKSYS_3901_L0X_PARSE_FUNCTION_ID_B1
@ MATEKSYS_3901_L0X_PARSE_SIZE
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B1
@ MATEKSYS_3901_L0X_PARSE_HEAD2
@ MATEKSYS_3901_L0X_PARSE_MOTIONY_B4
@ MATEKSYS_3901_L0X_PARSE_MOTIONX_B1
struct link_device * device
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.