2016-11-10 07:41:17 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
#include <AC_PrecLand/AC_PrecLand_Backend.h>
|
|
|
|
#include <AP_IRLock/AP_IRLock_SITL.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AC_PrecLand_SITL_Gazebo - implements precision landing using target
|
|
|
|
* vectors provided Gazebo via a network socket
|
|
|
|
*/
|
|
|
|
|
|
|
|
class AC_PrecLand_SITL_Gazebo : public AC_PrecLand_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
AC_PrecLand_SITL_Gazebo(const AC_PrecLand& frontend, AC_PrecLand::precland_state& state);
|
|
|
|
|
|
|
|
// perform any required initialisation of backend
|
2017-02-03 03:01:03 -04:00
|
|
|
void init() override;
|
2016-11-10 07:41:17 -04:00
|
|
|
|
|
|
|
// retrieve updates from sensor
|
2017-02-03 03:01:03 -04:00
|
|
|
void update() override;
|
2016-11-10 07:41:17 -04:00
|
|
|
|
|
|
|
// provides a unit vector towards the target in body frame
|
|
|
|
// returns same as have_los_meas()
|
2017-02-03 03:01:03 -04:00
|
|
|
bool get_los_body(Vector3f& ret) override;
|
2016-11-10 07:41:17 -04:00
|
|
|
|
|
|
|
// returns system time in milliseconds of last los measurement
|
2017-02-03 03:01:03 -04:00
|
|
|
uint32_t los_meas_time_ms() override;
|
2016-11-10 07:41:17 -04:00
|
|
|
|
|
|
|
// return true if there is a valid los measurement available
|
2017-02-03 03:01:03 -04:00
|
|
|
bool have_los_meas() override;
|
2016-11-10 07:41:17 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
AP_IRLock_SITL irlock;
|
|
|
|
|
|
|
|
Vector3f _los_meas_body; // unit vector in body frame pointing towards target
|
|
|
|
bool _have_los_meas; // true if there is a valid measurement from the camera
|
|
|
|
uint32_t _los_meas_time_ms; // system time in milliseconds when los was measured
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|