Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ROTORS_CONTROL_LEE_POSITION_CONTROLLER_H
00022 #define ROTORS_CONTROL_LEE_POSITION_CONTROLLER_H
00023
00024 #include <mav_msgs/conversions.h>
00025 #include <mav_msgs/eigen_mav_msgs.h>
00026
00027 #include "rotors_control/common.h"
00028 #include "rotors_control/parameters.h"
00029
00030 namespace rotors_control {
00031
00032
00033 static const Eigen::Vector3d kDefaultPositionGain = Eigen::Vector3d(6, 6, 6);
00034 static const Eigen::Vector3d kDefaultVelocityGain = Eigen::Vector3d(4.7, 4.7, 4.7);
00035 static const Eigen::Vector3d kDefaultAttitudeGain = Eigen::Vector3d(3, 3, 0.035);
00036 static const Eigen::Vector3d kDefaultAngularRateGain = Eigen::Vector3d(0.52, 0.52, 0.025);
00037
00038 class LeePositionControllerParameters {
00039 public:
00040 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00041 LeePositionControllerParameters()
00042 : position_gain_(kDefaultPositionGain),
00043 velocity_gain_(kDefaultVelocityGain),
00044 attitude_gain_(kDefaultAttitudeGain),
00045 angular_rate_gain_(kDefaultAngularRateGain) {
00046 calculateAllocationMatrix(rotor_configuration_, &allocation_matrix_);
00047 }
00048
00049 Eigen::Matrix4Xd allocation_matrix_;
00050 Eigen::Vector3d position_gain_;
00051 Eigen::Vector3d velocity_gain_;
00052 Eigen::Vector3d attitude_gain_;
00053 Eigen::Vector3d angular_rate_gain_;
00054 RotorConfiguration rotor_configuration_;
00055 };
00056
00057 class LeePositionController {
00058 public:
00059 LeePositionController();
00060 ~LeePositionController();
00061 void InitializeParameters();
00062 void CalculateRotorVelocities(Eigen::VectorXd* rotor_velocities) const;
00063
00064 void SetOdometry(const EigenOdometry& odometry);
00065 void SetTrajectoryPoint(
00066 const mav_msgs::EigenTrajectoryPoint& command_trajectory);
00067
00068 LeePositionControllerParameters controller_parameters_;
00069 VehicleParameters vehicle_parameters_;
00070
00071 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00072 private:
00073 bool initialized_params_;
00074 bool controller_active_;
00075
00076 Eigen::Vector3d normalized_attitude_gain_;
00077 Eigen::Vector3d normalized_angular_rate_gain_;
00078 Eigen::MatrixX4d angular_acc_to_rotor_velocities_;
00079
00080 mav_msgs::EigenTrajectoryPoint command_trajectory_;
00081 EigenOdometry odometry_;
00082
00083 void ComputeDesiredAngularAcc(const Eigen::Vector3d& acceleration,
00084 Eigen::Vector3d* angular_acceleration) const;
00085 void ComputeDesiredAcceleration(Eigen::Vector3d* acceleration) const;
00086 };
00087 }
00088
00089 #endif // ROTORS_CONTROL_LEE_POSITION_CONTROLLER_H
rotors_control
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Thu Apr 18 2019 02:43:38