2016-02-17 21:25:09 -04:00
|
|
|
#pragma once
|
2015-02-16 00:37:13 -04:00
|
|
|
|
2023-03-22 05:45:41 -03:00
|
|
|
#include "AC_PrecLand_config.h"
|
|
|
|
|
|
|
|
#if AC_PRECLAND_IRLOCK_ENABLED
|
|
|
|
|
2015-08-28 05:11:52 -03:00
|
|
|
#include <AC_PrecLand/AC_PrecLand_Backend.h>
|
2023-03-22 05:45:41 -03:00
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
|
2016-09-14 20:31:16 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
2018-08-03 07:52:48 -03:00
|
|
|
#include <AP_IRLock/AP_IRLock_SITL.h>
|
|
|
|
#else
|
|
|
|
#include <AP_IRLock/AP_IRLock.h>
|
2016-09-14 20:31:16 -03:00
|
|
|
#endif
|
|
|
|
|
2015-02-16 00:37:13 -04:00
|
|
|
/*
|
|
|
|
* AC_PrecLand_IRLock - implements precision landing using target vectors provided
|
2024-02-22 10:08:29 -04:00
|
|
|
* by an IRLock
|
2015-02-16 00:37:13 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
class AC_PrecLand_IRLock : public AC_PrecLand_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
AC_PrecLand_IRLock(const AC_PrecLand& frontend, AC_PrecLand::precland_state& state);
|
2017-02-03 03:01:03 -04:00
|
|
|
|
2016-07-05 16:37:17 -03:00
|
|
|
// perform any required initialisation of backend
|
2017-02-03 03:01:03 -04:00
|
|
|
void init() override;
|
2015-02-16 00:37:13 -04:00
|
|
|
|
2016-07-05 16:37:17 -03:00
|
|
|
// retrieve updates from sensor
|
2017-02-03 03:01:03 -04:00
|
|
|
void update() override;
|
2016-07-05 16:37:17 -03:00
|
|
|
|
2015-02-16 00:37:13 -04:00
|
|
|
private:
|
2018-08-03 07:52:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
|
|
|
AP_IRLock_SITL irlock;
|
|
|
|
#else
|
2016-11-26 01:22:32 -04:00
|
|
|
AP_IRLock_I2C irlock;
|
2018-08-03 07:52:48 -03:00
|
|
|
#endif
|
2015-02-16 00:37:13 -04:00
|
|
|
};
|
2023-03-22 05:45:41 -03:00
|
|
|
|
|
|
|
#endif // AC_PRECLAND_IRLOCK_ENABLED
|