mirror of https://github.com/ArduPilot/ardupilot
uncrustify libraries/AP_RangeFinder/RangeFinder.h
This commit is contained in:
parent
b57832e19b
commit
c6f99a7b6e
|
@ -7,25 +7,26 @@
|
|||
#include "../Filter/Filter.h" // Filter library
|
||||
|
||||
/*
|
||||
#define AP_RANGEFINDER_ORIENTATION_FRONT 0, 10, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_RIGHT -10, 0, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_BACK 0,-10, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_LEFT 10, 0, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_UP 0, 0,-10
|
||||
#define AP_RANGEFINDER_ORIENTATION_DOWN 0, 0, 10
|
||||
#define AP_RANGEFINDER_ORIENTATION_FRONT_RIGHT -5, -5, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_BACK_RIGHT -5, -5, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_BACK_LEFT 5, -5, 0
|
||||
#define AP_RANGEFINDER_ORIENTATION_FRONT_LEFT 5, 5, 0
|
||||
*/
|
||||
* #define AP_RANGEFINDER_ORIENTATION_FRONT 0, 10, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_RIGHT -10, 0, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_BACK 0,-10, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_LEFT 10, 0, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_UP 0, 0,-10
|
||||
* #define AP_RANGEFINDER_ORIENTATION_DOWN 0, 0, 10
|
||||
* #define AP_RANGEFINDER_ORIENTATION_FRONT_RIGHT -5, -5, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_BACK_RIGHT -5, -5, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_BACK_LEFT 5, -5, 0
|
||||
* #define AP_RANGEFINDER_ORIENTATION_FRONT_LEFT 5, 5, 0
|
||||
*/
|
||||
|
||||
class RangeFinder
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
RangeFinder(AP_AnalogSource * source, FilterInt16 *filter) :
|
||||
_analog_source(source),
|
||||
_mode_filter(filter) {}
|
||||
public:
|
||||
_mode_filter(filter) {
|
||||
}
|
||||
public:
|
||||
|
||||
int raw_value; // raw value from the sensor
|
||||
int distance; // distance in cm
|
||||
|
@ -34,10 +35,12 @@ class RangeFinder
|
|||
int orientation_x, orientation_y, orientation_z;
|
||||
|
||||
virtual void set_orientation(int x, int y, int z);
|
||||
virtual int convert_raw_to_distance(int _raw_value) { return _raw_value; } // function that each child class should override to convert voltage to distance
|
||||
virtual int convert_raw_to_distance(int _raw_value) {
|
||||
return _raw_value;
|
||||
} // function that each child class should override to convert voltage to distance
|
||||
virtual int read(); // read value from sensor and return distance in cm
|
||||
|
||||
AP_AnalogSource *_analog_source;
|
||||
FilterInt16 *_mode_filter;
|
||||
AP_AnalogSource * _analog_source;
|
||||
FilterInt16 * _mode_filter;
|
||||
};
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue