Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_DAL/AP_DAL_RangeFinder.h
Views: 1798
#pragma once12#include <AP_RangeFinder/AP_RangeFinder.h>34#if AP_RANGEFINDER_ENABLED56#include <AP_Logger/LogStructure.h>78class AP_RangeFinder_Backend;910class AP_DAL_RangeFinder {11public:1213// RangeFinder-like methods:14enum class Status {15NotConnected = 0,16NoData,17OutOfRangeLow,18OutOfRangeHigh,19Good20};2122int16_t ground_clearance_cm_orient(enum Rotation orientation) const;23int16_t max_distance_cm_orient(enum Rotation orientation) const;2425// return true if we have a range finder with the specified orientation26bool has_orientation(enum Rotation orientation) const;2728// DAL methods:29AP_DAL_RangeFinder();3031void start_frame();3233class AP_DAL_RangeFinder_Backend *get_backend(uint8_t id) const;3435void handle_message(const log_RRNH &msg);36void handle_message(const log_RRNI &msg);3738private:3940struct log_RRNH _RRNH;41struct log_RRNI *_RRNI;42AP_DAL_RangeFinder_Backend **_backend;43};444546class AP_DAL_RangeFinder_Backend {47public:4849AP_DAL_RangeFinder_Backend(struct log_RRNI &RRNI);5051// RangeFinder-backend-like methods5253enum Rotation orientation() const {54return (Rotation)_RRNI.orientation;55}5657AP_DAL_RangeFinder::Status status() const {58return (AP_DAL_RangeFinder::Status)_RRNI.status;59}6061uint16_t distance_cm() const { return _RRNI.distance_cm; }6263const Vector3f &get_pos_offset() const { return _RRNI.pos_offset; }6465// DAL methods:66void start_frame(AP_RangeFinder_Backend *backend);6768private:6970struct log_RRNI &_RRNI;71};7273#endif // AP_RANGEFINDER_ENABLED747576