2015-02-16 00:37:13 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2016-02-17 21:25:09 -04:00
|
|
|
#pragma once
|
2015-02-16 00:37:13 -04:00
|
|
|
|
2015-08-28 05:11:52 -03:00
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
#include <AC_PrecLand/AC_PrecLand_Backend.h>
|
|
|
|
#include <AP_IRLock/AP_IRLock.h>
|
2015-02-16 00:37:13 -04:00
|
|
|
|
2015-09-01 21:10:04 -03:00
|
|
|
// this only builds for PX4 so far
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
|
|
|
|
2015-02-16 00:37:13 -04:00
|
|
|
/*
|
|
|
|
* AC_PrecLand_IRLock - implements precision landing using target vectors provided
|
|
|
|
* by a companion computer (i.e. Odroid) communicating via MAVLink
|
|
|
|
*/
|
|
|
|
|
|
|
|
class AC_PrecLand_IRLock : public AC_PrecLand_Backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
AC_PrecLand_IRLock(const AC_PrecLand& frontend, AC_PrecLand::precland_state& state);
|
|
|
|
|
|
|
|
// init - perform any required initialisation of backend controller
|
|
|
|
void init();
|
|
|
|
|
|
|
|
// update - give chance to driver to get updates from sensor
|
|
|
|
// returns true if new data available
|
|
|
|
bool update();
|
2015-10-23 12:18:35 -03:00
|
|
|
// IRLock is hard-mounted to the frame of the vehicle, so it will always be in body-frame
|
|
|
|
MAV_FRAME get_frame_of_reference() { return MAV_FRAME_BODY_NED; }
|
2015-02-16 00:37:13 -04:00
|
|
|
|
|
|
|
// get_angle_to_target - returns body frame angles (in radians) to target
|
|
|
|
// returns true if angles are available, false if not (i.e. no target)
|
|
|
|
// x_angle_rad : body-frame roll direction, positive = target is to right (looking down)
|
|
|
|
// y_angle_rad : body-frame pitch direction, postiive = target is forward (looking down)
|
2015-09-11 08:01:44 -03:00
|
|
|
bool get_angle_to_target(float &x_angle_rad, float &y_angle_rad);
|
2015-02-16 00:37:13 -04:00
|
|
|
|
2015-09-11 08:00:18 -03:00
|
|
|
// handle_msg - parses a mavlink message from the companion computer
|
|
|
|
void handle_msg(mavlink_message_t* msg) { /* do nothing */ }
|
|
|
|
|
2015-02-16 00:37:13 -04:00
|
|
|
private:
|
|
|
|
AP_IRLock_PX4 irlock;
|
|
|
|
|
|
|
|
};
|
2015-09-01 21:10:04 -03:00
|
|
|
#endif
|