Line data Source code
1 : /* 2 : This program is free software: you can redistribute it and/or modify 3 : it under the terms of the GNU General Public License as published by 4 : the Free Software Foundation, either version 3 of the License, or 5 : (at your option) any later version. 6 : 7 : This program is distributed in the hope that it will be useful, 8 : but WITHOUT ANY WARRANTY; without even the implied warranty of 9 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 : GNU General Public License for more details. 11 : 12 : You should have received a copy of the GNU General Public License 13 : along with this program. If not, see <http://www.gnu.org/licenses/>. 14 : */ 15 : 16 : #include "AP_OpticalFlow.h" 17 : 18 : #if AP_OPTICALFLOW_ENABLED 19 : 20 : extern const AP_HAL::HAL& hal; 21 : 22 14 : OpticalFlow_backend::OpticalFlow_backend(AP_OpticalFlow &_frontend) : 23 14 : frontend(_frontend) 24 : { 25 14 : } 26 : 27 0 : OpticalFlow_backend::~OpticalFlow_backend(void) 28 : { 29 0 : } 30 : 31 : // update the frontend 32 10128 : void OpticalFlow_backend::_update_frontend(const struct AP_OpticalFlow::OpticalFlow_state &state) 33 : { 34 10128 : frontend.update_state(state); 35 10128 : } 36 : 37 : // apply yaw angle to a vector 38 10128 : void OpticalFlow_backend::_applyYaw(Vector2f &v) 39 : { 40 10128 : float yawAngleRad = _yawAngleRad(); 41 10128 : if (is_zero(yawAngleRad)) { 42 10128 : return; 43 : } 44 0 : v.rotate(yawAngleRad); 45 : } 46 : 47 : #endif