mc_att_control: move rate control to RateControl class

This makes the controller more modular, more readable and hence
better maintainable.
This commit is contained in:
Matthias Grob
2019-10-15 07:46:47 +02:00
parent 97e1edc835
commit 9f639d1f3b
8 changed files with 426 additions and 135 deletions
@@ -56,15 +56,6 @@ public:
AttitudeControl() = default;
~AttitudeControl() = default;
/**
* Run one control loop cycle calculation with either new
* @param q estimation of the current vehicle attitude unit quaternion
* @param qd desired vehicle attitude setpoint
* @param yawspeed_feedforward [rad/s] yaw feed forward angular rate in world frame
* @return [rad/s] body frame 3D angular rate setpoint vector to be executed by the rate controller
*/
matrix::Vector3f update(matrix::Quatf q, matrix::Quatf qd, float yawspeed_feedforward);
/**
* Set proportional attitude control gain
* @param proportional_gain 3D vector containing gains for roll, pitch, yaw
@@ -77,6 +68,15 @@ public:
*/
void setRateLimit(const matrix::Vector3f &rate_limit) { _rate_limit = rate_limit; }
/**
* Run one control loop cycle calculation
* @param q estimation of the current vehicle attitude unit quaternion
* @param qd desired vehicle attitude setpoint
* @param yawspeed_feedforward [rad/s] yaw feed forward angular rate in world frame
* @return [rad/s] body frame 3D angular rate setpoint vector to be executed by the rate controller
*/
matrix::Vector3f update(matrix::Quatf q, matrix::Quatf qd, float yawspeed_feedforward);
private:
matrix::Vector3f _proportional_gain;
matrix::Vector3f _rate_limit;