pid_controller.h
Go to the documentation of this file.
00001 
00009 /*
00010  * Copyright 2015 Nuno Marques.
00011  *
00012  * This file is part of the mavros package and subject to the license terms
00013  * in the top-level LICENSE file of the mavros repository.
00014  * https://github.com/mavlink/mavros/tree/master/LICENSE.md
00015  */
00016 
00017 #pragma once
00018 
00019 #include <array>
00020 #include <control_toolbox/pid.h>
00021 #include <eigen_conversions/eigen_msg.h>
00022 
00023 namespace pidcontroller {
00024 class PIDController
00025 {
00026 public:
00027         PIDController();
00028         ~PIDController() {};
00029 
00030         /* *-* PID Setup *-* */
00034         void setup_linvel_pid(double p_gain, double i_gain, double d_gain, double i_max, double i_min, const ros::NodeHandle &node);
00035 
00039         void setup_yawrate_pid(double p_gain, double i_gain, double d_gain, double i_max, double i_min, const ros::NodeHandle &node);
00040 
00041         /* *-* Effort computation *-* */
00045         Eigen::Vector3d compute_linvel_effort(Eigen::Vector3d goal, Eigen::Vector3d current, ros::Time last_time);
00046 
00050         double compute_yawrate_effort(double goal, double current, ros::Time last_time);
00051 
00052 private:
00053         // Control toolbox PID controllers
00054         control_toolbox::Pid pid_linvel_x;
00055         control_toolbox::Pid pid_linvel_y;
00056         control_toolbox::Pid pid_linvel_z;
00057         control_toolbox::Pid pid_yaw_rate;
00058 
00059 };
00060 };      // namespace pidcontroller


test_mavros
Author(s): Nuno Marques , Vladimir Ermakov
autogenerated on Sat Jun 8 2019 19:55:31