2019-08-15 05:23:36 -03:00
|
|
|
/*
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-07-10 19:15:58 -03:00
|
|
|
#pragma once
|
|
|
|
|
2023-04-05 09:25:54 -03:00
|
|
|
#include "AP_Proximity_config.h"
|
|
|
|
|
|
|
|
#if AP_PROXIMITY_AIRSIMSITL_ENABLED
|
2019-07-10 19:15:58 -03:00
|
|
|
|
2023-04-05 09:25:54 -03:00
|
|
|
#include "AP_Proximity_Backend.h"
|
2021-03-25 04:32:09 -03:00
|
|
|
|
2019-07-10 19:15:58 -03:00
|
|
|
#include <SITL/SITL.h>
|
|
|
|
|
|
|
|
class AP_Proximity_AirSimSITL : public AP_Proximity_Backend
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
// constructor
|
2019-09-27 06:33:18 -03:00
|
|
|
using AP_Proximity_Backend::AP_Proximity_Backend;
|
2019-07-10 19:15:58 -03:00
|
|
|
|
|
|
|
// update state
|
|
|
|
void update(void) override;
|
|
|
|
|
|
|
|
// get maximum and minimum distances (in meters) of sensor
|
|
|
|
float distance_max() const override;
|
|
|
|
float distance_min() const override;
|
|
|
|
|
|
|
|
// get distance upwards in meters. returns true on success
|
|
|
|
bool get_upward_distance(float &distance) const override;
|
|
|
|
|
|
|
|
private:
|
2021-07-30 07:15:25 -03:00
|
|
|
SITL::SIM *sitl = AP::sitl();
|
2021-03-08 13:21:45 -04:00
|
|
|
AP_Proximity_Temp_Boundary temp_boundary;
|
2019-12-13 11:29:30 -04:00
|
|
|
|
2019-07-10 19:15:58 -03:00
|
|
|
};
|
2021-03-25 04:32:09 -03:00
|
|
|
|
2023-04-05 09:25:54 -03:00
|
|
|
#endif // AP_PROXIMITY_AIRSIMSITL_ENABLED
|
|
|
|
|