You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
71 lines
2.0 KiB
10 years ago
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||
|
|
||
|
/*
|
||
|
MAVLink enabled mount backend class
|
||
|
*/
|
||
|
|
||
9 years ago
|
#ifndef __AP_MOUNT_SOLOGIMBAL_H__
|
||
|
#define __AP_MOUNT_SOLOGIMBAL_H__
|
||
|
|
||
10 years ago
|
|
||
10 years ago
|
#include <AP_HAL/AP_HAL.h>
|
||
|
#include <AP_AHRS/AP_AHRS.h>
|
||
10 years ago
|
|
||
|
#if AP_AHRS_NAVEKF_AVAILABLE
|
||
10 years ago
|
#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"
|
||
9 years ago
|
#include "SoloGimbal.h"
|
||
|
|
||
10 years ago
|
|
||
9 years ago
|
class AP_Mount_SoloGimbal : public AP_Mount_Backend
|
||
10 years ago
|
{
|
||
|
|
||
|
public:
|
||
|
// Constructor
|
||
9 years ago
|
AP_Mount_SoloGimbal(AP_Mount &frontend, AP_Mount::mount_state &state, uint8_t instance);
|
||
10 years ago
|
|
||
|
// init - performs any required initialisation for this instance
|
||
10 years ago
|
virtual void init(const AP_SerialManager& serial_manager);
|
||
10 years ago
|
|
||
|
// 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);
|
||
|
|
||
10 years ago
|
// handle a GIMBAL_REPORT message
|
||
|
virtual void handle_gimbal_report(mavlink_channel_t chan, mavlink_message_t *msg);
|
||
9 years ago
|
virtual void handle_gimbal_torque_report(mavlink_channel_t chan, mavlink_message_t *msg);
|
||
|
virtual void handle_param_value(mavlink_message_t *msg);
|
||
10 years ago
|
|
||
|
// send a GIMBAL_REPORT message to the GCS
|
||
|
virtual void send_gimbal_report(mavlink_channel_t chan);
|
||
|
|
||
9 years ago
|
virtual void update_fast();
|
||
|
|
||
10 years ago
|
private:
|
||
|
// internal variables
|
||
10 years ago
|
bool _initialised; // true once the driver has been initialised
|
||
10 years ago
|
|
||
9 years ago
|
// Write a gimbal measurament and estimation data packet
|
||
|
void Log_Write_Gimbal(SoloGimbal &gimbal);
|
||
|
|
||
|
bool _params_saved;
|
||
|
|
||
|
SoloGimbal _gimbal;
|
||
10 years ago
|
};
|
||
10 years ago
|
|
||
10 years ago
|
#endif // AP_AHRS_NAVEKF_AVAILABLE
|
||
10 years ago
|
|
||
9 years ago
|
#endif // __AP_MOUNT_SOLOGIMBAL_H__
|