Path: blob/master/libraries/AC_CustomControl/AC_CustomControl_Backend.h
9436 views
#pragma once12#include "AC_CustomControl_config.h"34#if AP_CUSTOMCONTROL_ENABLED56#include "AC_CustomControl.h"78class AC_CustomControl_Backend9{10public:11AC_CustomControl_Backend(AC_CustomControl& frontend, AP_AHRS_View*& ahrs, AC_AttitudeControl*& att_control, AP_MotorsMulticopter*& motors, float dt) :12_ahrs(ahrs),13_att_control(att_control),14_motors(motors),15_frontend(frontend)16{}1718// empty destructor to suppress compiler warning19virtual ~AC_CustomControl_Backend() {}2021// update controller, return roll, pitch, yaw controller output22virtual Vector3f update() = 0;2324// reset controller to avoid build up or abrupt response upon switch, ex: integrator, filter25virtual void reset() = 0;2627// set the PID notch sample rates28virtual void set_notch_sample_rate(float sample_rate) {};2930protected:31// References to external libraries32AP_AHRS_View*& _ahrs;33AC_AttitudeControl*& _att_control;34AP_MotorsMulticopter*& _motors;35AC_CustomControl& _frontend;36};3738#endif // AP_CUSTOMCONTROL_ENABLED394041