2022-04-20 00:42:03 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/// @file AC_CommandModel.h
|
|
|
|
/// @brief ArduCopter Command Model Library
|
|
|
|
|
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
Command model parameters
|
|
|
|
*/
|
|
|
|
|
|
|
|
class AC_CommandModel {
|
|
|
|
public:
|
2022-06-15 00:10:11 -03:00
|
|
|
AC_CommandModel(float initial_rate, float initial_expo, float initial_tc);
|
2022-04-20 00:42:03 -03:00
|
|
|
|
2022-05-21 23:50:38 -03:00
|
|
|
// Accessors for parameters
|
2022-06-22 00:30:23 -03:00
|
|
|
float get_rate_tc() const { return rate_tc; }
|
|
|
|
float get_rate() const { return rate; }
|
|
|
|
float get_expo() const { return expo; }
|
2022-04-20 00:42:03 -03:00
|
|
|
|
2022-05-21 23:50:38 -03:00
|
|
|
// Set the max rate
|
2022-07-05 00:08:55 -03:00
|
|
|
void set_rate(float input) { rate.set(input); }
|
2022-04-20 00:42:03 -03:00
|
|
|
|
|
|
|
// var_info for holding Parameter information
|
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
|
|
|
|
protected:
|
2022-05-21 23:50:38 -03:00
|
|
|
AP_Float rate_tc; // rate time constant
|
|
|
|
AP_Float rate; // maximum rate
|
|
|
|
AP_Float expo; // expo shaping
|
2022-04-20 00:42:03 -03:00
|
|
|
|
2023-01-03 13:22:22 -04:00
|
|
|
private:
|
|
|
|
const float default_rate_tc;
|
|
|
|
const float default_rate;
|
|
|
|
const float default_expo;
|
2022-04-20 00:42:03 -03:00
|
|
|
};
|
|
|
|
|