mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-08 08:53:56 -04:00
uncrustify libraries/AP_OpticalFlow/AP_OpticalFlow.h
This commit is contained in:
parent
80f5d0bb51
commit
ff94bd7696
@ -2,19 +2,19 @@
|
||||
#define AP_OPTICALFLOW_H
|
||||
|
||||
/*
|
||||
AP_OpticalFlow.cpp - OpticalFlow Base Class for Ardupilot Mega
|
||||
Code by Randy Mackay. DIYDrones.com
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
Methods:
|
||||
init() : initializate sensor and library.
|
||||
read : reads latest value from OpticalFlow and stores values in x,y, surface_quality parameter
|
||||
read_register() : reads a value from the sensor (will be sensor specific)
|
||||
write_register() : writes a value to one of the sensor's register (will be sensor specific)
|
||||
* AP_OpticalFlow.cpp - OpticalFlow Base Class for Ardupilot Mega
|
||||
* Code by Randy Mackay. DIYDrones.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Methods:
|
||||
* init() : initializate sensor and library.
|
||||
* read : reads latest value from OpticalFlow and stores values in x,y, surface_quality parameter
|
||||
* read_register() : reads a value from the sensor (will be sensor specific)
|
||||
* write_register() : writes a value to one of the sensor's register (will be sensor specific)
|
||||
*/
|
||||
|
||||
#include <FastSerial.h>
|
||||
@ -38,14 +38,22 @@ class AP_OpticalFlow
|
||||
float change_x, change_y;
|
||||
float x_cm, y_cm;
|
||||
|
||||
AP_OpticalFlow() { _sensor = this; };
|
||||
~AP_OpticalFlow() { _sensor = NULL; };
|
||||
AP_OpticalFlow() {
|
||||
_sensor = this;
|
||||
};
|
||||
~AP_OpticalFlow() {
|
||||
_sensor = NULL;
|
||||
};
|
||||
virtual bool init(bool initCommAPI = true); // parameter controls whether I2C/SPI interface is initialised (set to false if other devices are on the I2C/SPI bus and have already initialised the interface)
|
||||
virtual byte read_register(byte address);
|
||||
virtual void write_register(byte address, byte value);
|
||||
virtual void set_orientation(enum Rotation rotation); // Rotation vector to transform sensor readings to the body frame.
|
||||
virtual void set_field_of_view(const float fov) { field_of_view = fov; update_conversion_factors(); }; // sets field of view of sensor
|
||||
static void read(uint32_t ) { if( _sensor != NULL ) _sensor->update(); }; // call to update all attached sensors
|
||||
virtual void set_field_of_view(const float fov) {
|
||||
field_of_view = fov; update_conversion_factors();
|
||||
}; // sets field of view of sensor
|
||||
static void read(uint32_t ) {
|
||||
if( _sensor != NULL ) _sensor->update();
|
||||
}; // call to update all attached sensors
|
||||
virtual bool update(); // read latest values from sensor and fill in x,y and totals. returns true on success
|
||||
virtual void update_position(float roll, float pitch, float cos_yaw_x, float sin_yaw_y, float altitude); // updates internal lon and lat with estimation based on optical flow
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user