2017-02-10 01:26:12 -04:00
|
|
|
/// @file AP_MotorsTailsitter.h
|
|
|
|
/// @brief Motor control class for tailsitters
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_Math/AP_Math.h>
|
|
|
|
#include <SRV_Channel/SRV_Channel.h>
|
|
|
|
#include "AP_MotorsMulticopter.h"
|
|
|
|
|
|
|
|
/// @class AP_MotorsTailsitter
|
|
|
|
class AP_MotorsTailsitter : public AP_MotorsMulticopter {
|
|
|
|
public:
|
|
|
|
|
|
|
|
/// Constructor
|
2017-04-10 01:51:00 -03:00
|
|
|
AP_MotorsTailsitter(uint16_t loop_rate, uint16_t speed_hz = AP_MOTORS_SPEED_DEFAULT);
|
2017-02-10 01:26:12 -04:00
|
|
|
|
|
|
|
// init
|
|
|
|
void init(motor_frame_class frame_class, motor_frame_type frame_type);
|
|
|
|
|
|
|
|
// set frame class (i.e. quad, hexa, heli) and type (i.e. x, plus)
|
|
|
|
void set_frame_class_and_type(motor_frame_class frame_class, motor_frame_type frame_type) {}
|
|
|
|
void set_update_rate( uint16_t speed_hz ) {}
|
|
|
|
|
2018-04-27 13:22:07 -03:00
|
|
|
virtual void output_test_seq(uint8_t motor_seq, int16_t pwm) override {}
|
2017-02-10 01:26:12 -04:00
|
|
|
|
|
|
|
// output_to_motors - sends output to named servos
|
|
|
|
void output_to_motors();
|
|
|
|
|
|
|
|
// return 0 motor mask
|
2018-08-24 02:38:28 -03:00
|
|
|
uint16_t get_motor_mask() override { return 0; }
|
2017-02-10 01:26:12 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// calculate motor outputs
|
|
|
|
void output_armed_stabilizing();
|
|
|
|
|
|
|
|
// calculated outputs
|
|
|
|
float _aileron; // -1..1
|
|
|
|
float _elevator; // -1..1
|
|
|
|
float _rudder; // -1..1
|
|
|
|
float _throttle; // 0..1
|
|
|
|
};
|