2015-01-08 16:11:26 -04:00
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
|
|
|
/*
|
|
|
|
MAVLink enabled mount backend class
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __AP_MOUNT_MAVLINK_H__
|
|
|
|
#define __AP_MOUNT_MAVLINK_H__
|
|
|
|
|
2015-08-11 03:28:44 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
|
|
|
#include <AP_AHRS/AP_AHRS.h>
|
2015-01-30 02:39:31 -04:00
|
|
|
|
|
|
|
#if AP_AHRS_NAVEKF_AVAILABLE
|
2015-08-11 03:28:44 -03:00
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_GPS/AP_GPS.h>
|
|
|
|
#include <GCS_MAVLink/GCS_MAVLink.h>
|
|
|
|
#include <RC_Channel/RC_Channel.h>
|
|
|
|
#include "AP_Mount_Backend.h"
|
|
|
|
#include "AP_Gimbal.h"
|
2015-01-08 16:11:26 -04:00
|
|
|
|
|
|
|
class AP_Mount_MAVLink : public AP_Mount_Backend
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Constructor
|
2015-02-01 05:32:25 -04:00
|
|
|
AP_Mount_MAVLink(AP_Mount &frontend, AP_Mount::mount_state &state, uint8_t instance);
|
2015-01-08 16:11:26 -04:00
|
|
|
|
|
|
|
// init - performs any required initialisation for this instance
|
2015-01-19 09:39:13 -04:00
|
|
|
virtual void init(const AP_SerialManager& serial_manager);
|
2015-01-08 16:11:26 -04:00
|
|
|
|
|
|
|
// update mount position - should be called periodically
|
|
|
|
virtual void update();
|
|
|
|
|
|
|
|
// has_pan_control - returns true if this mount can control it's pan (required for multicopters)
|
|
|
|
virtual bool has_pan_control() const;
|
|
|
|
|
|
|
|
// set_mode - sets mount's mode
|
|
|
|
virtual void set_mode(enum MAV_MOUNT_MODE mode);
|
|
|
|
|
|
|
|
// status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message
|
|
|
|
virtual void status_msg(mavlink_channel_t chan);
|
|
|
|
|
2015-01-29 05:01:55 -04:00
|
|
|
// handle a GIMBAL_REPORT message
|
|
|
|
virtual void handle_gimbal_report(mavlink_channel_t chan, mavlink_message_t *msg);
|
|
|
|
|
|
|
|
// send a GIMBAL_REPORT message to the GCS
|
|
|
|
virtual void send_gimbal_report(mavlink_channel_t chan);
|
|
|
|
|
2015-01-08 16:11:26 -04:00
|
|
|
private:
|
|
|
|
// internal variables
|
2015-01-19 09:39:13 -04:00
|
|
|
bool _initialised; // true once the driver has been initialised
|
2015-03-20 17:19:34 -03:00
|
|
|
|
|
|
|
AP_Gimbal _gimbal;
|
2015-01-08 16:11:26 -04:00
|
|
|
};
|
2015-02-16 01:48:55 -04:00
|
|
|
|
2015-01-30 02:39:31 -04:00
|
|
|
#endif // AP_AHRS_NAVEKF_AVAILABLE
|
2015-01-08 16:11:26 -04:00
|
|
|
|
|
|
|
#endif // __AP_MOUNT_MAVLINK_H__
|