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 RPLidar S2 proximity sensor 17 : 18 : ./Tools/autotest/sim_vehicle.py --gdb --debug -v ArduCopter -A --serial5=sim:rplidars2 --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 : #pragma once 44 : 45 : #include "SIM_config.h" 46 : 47 : #if AP_SIM_PS_RPLIDARS2_ENABLED 48 : 49 : #include "SIM_PS_RPLidar.h" 50 : 51 : namespace SITL { 52 : 53 : class PS_RPLidarS2 : public PS_RPLidar { 54 : public: 55 1 : uint8_t device_info_model() const override { return 0x71; } 56 135520 : uint8_t max_range() const override { return 50; } 57 : }; 58 : 59 : } 60 : 61 : #endif // AP_SIM_PS_RPLIDARS2_ENABLED