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 : This program is distributed in the hope that it will be useful, 7 : but WITHOUT ANY WARRANTY; without even the implied warranty of 8 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 : GNU General Public License for more details. 10 : You should have received a copy of the GNU General Public License 11 : along with this program. If not, see <http://www.gnu.org/licenses/>. 12 : */ 13 : /* 14 : Simulator for the TeraRanger NEO RangeFinder 15 : ./Tools/autotest/sim_vehicle.py --gdb --debug -v ArduCopter -A --serial5=sim:teraranger_serial --speedup=1 16 : param set SERIAL5_PROTOCOL 9 17 : param set RNGFND1_TYPE 35 18 : graph RANGEFINDER.distance 19 : graph GLOBAL_POSITION_INT.relative_alt/1000-RANGEFINDER.distance 20 : reboot 21 : arm throttle 22 : rc 3 1600 23 : */ 24 : 25 : #pragma once 26 : 27 : #include "SIM_SerialRangeFinder.h" 28 : 29 : namespace SITL { 30 : 31 : class RF_TeraRanger_Serial : public SerialRangeFinder { 32 : public: 33 : 34 1 : static SerialRangeFinder *create() { return NEW_NOTHROW RF_TeraRanger_Serial(); } 35 : 36 : uint32_t packet_for_alt(float alt_m, uint8_t *buffer, uint8_t buflen) override; 37 : 38 : 39 : }; 40 : 41 : }