graceful_controller.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2021-2022 Michael Ferguson
3  * Copyright 2015 Fetch Robotics Inc
4  * Author: Michael Ferguson
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef GRACEFUL_CONTROLLER_HPP
21 #define GRACEFUL_CONTROLLER_HPP
22 
23 #include <memory>
24 #include <vector>
25 
27 {
28 
30 {
31 public:
41  GracefulController(double k1,
42  double k2,
43  double min_abs_velocity,
44  double max_abs_velocity,
45  double max_decel,
46  double max_abs_angular_velocity,
47  double beta,
48  double lambda);
49 
62  bool approach(const double x, const double y, const double theta,
63  double& vel_x, double& vel_th, bool backward_motion=false);
64 
71  void setVelocityLimits(const double min_abs_velocity,
72  const double max_abs_velocity,
73  const double max_abs_angular_velocity);
74 
75 private:
76  /*
77  * Parameters for approach controller
78  */
79  double k1_; // ratio in change of theta to rate of change in r
80  double k2_; // speed at which we converge to slow system
83  double max_decel_;
85  double beta_; // how fast velocity drops as k increases
86  double lambda_; // controls speed scaling based on curvature. A higher value of lambda results in more sharply peaked curves
87  double dist_; // used to create the tracking line
88 };
89 
90 using GracefulControllerPtr = std::shared_ptr<GracefulController>;
91 
92 } // namespace graceful_controller
93 
94 #endif // GRACEFUL_CONTROLLER_HPP
void setVelocityLimits(const double min_abs_velocity, const double max_abs_velocity, const double max_abs_angular_velocity)
Update the velocity limits.
std::shared_ptr< GracefulController > GracefulControllerPtr
GracefulController(double k1, double k2, double min_abs_velocity, double max_abs_velocity, double max_decel, double max_abs_angular_velocity, double beta, double lambda)
Constructor of the controller.
bool approach(const double x, const double y, const double theta, double &vel_x, double &vel_th, bool backward_motion=false)
Implements something loosely based on "A Smooth Control Law for Graceful Motion of Differential Wheel...


graceful_controller
Author(s): Michael Ferguson
autogenerated on Thu Mar 9 2023 03:19:24