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 : Simulator for the RPLidarA2 proximity sensor 17 : 18 : ./Tools/autotest/sim_vehicle.py --gdb --debug -v ArduCopter -A --serial5=sim:rplidara2 --speedup=1 -l 51.8752066,14.6487840,0,0 --map 19 : 20 : param set SERIAL5_PROTOCOL 11 21 : param set PRX1_TYPE 5 22 : reboot 23 : 24 : arm throttle 25 : rc 3 1600 26 : 27 : # for avoidance: 28 : param set DISARM_DELAY 0 29 : param set AVOID_ENABLE 2 # use proximity sensor 30 : param set AVOID_MARGIN 2.00 # 2m 31 : param set AVOID_BEHAVE 0 # slide 32 : param set OA_DB_OUTPUT 3 33 : param set OA_TYPE 2 34 : reboot 35 : mode loiter 36 : script /tmp/post-locations.scr 37 : arm throttle 38 : rc 3 1600 39 : rc 3 1500 40 : rc 2 1450 41 : 42 : */ 43 : 44 : #pragma once 45 : 46 : #include "SIM_config.h" 47 : 48 : #if AP_SIM_PS_RPLIDARA2_ENABLED 49 : 50 : #include "SIM_PS_RPLidar.h" 51 : 52 : namespace SITL { 53 : 54 : class PS_RPLidarA2 : public PS_RPLidar { 55 : public: 56 2 : uint8_t device_info_model() const override { return 0x28; } 57 82488 : uint8_t max_range() const override { return 16.0f; }; 58 : }; 59 : 60 : } 61 : 62 : #endif // AP_SIM_PS_RPLIDARA2_ENABLED