finite_differences_variable_grid_se2.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020, Christoph Rösmann, All rights reserved.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  *
20  * Authors: Christoph Rösmann
21  *********************************************************************/
22 
23 #ifndef FINITE_DIFFERENCES_VARIABLE_GRID_H_
24 #define FINITE_DIFFERENCES_VARIABLE_GRID_H_
25 
27 
28 #include <memory>
29 
30 namespace mpc_local_planner {
31 
48 {
49  public:
50  using Ptr = std::shared_ptr<FiniteDifferencesVariableGridSE2>;
51  using UPtr = std::unique_ptr<FiniteDifferencesVariableGridSE2>;
52 
54 
56  virtual ~FiniteDifferencesVariableGridSE2() = default;
57 
59  corbo::DiscretizationGridInterface::Ptr getInstance() const override { return std::make_shared<FiniteDifferencesVariableGridSE2>(); }
60 
63 
65  void setDtBounds(double dt_lb, double dt_ub);
67  void setNmin(int n_min) { _n_min = n_min; }
71  void setGridAdaptTimeBasedSingleStep(int n_max, double dt_hyst_ratio = 0.1, bool adapt_first_iter = false);
73  void setGridAdaptTimeBasedAggressiveEstimate(int n_max, double dt_hyst_ratio = 0.1, bool adapt_first_iter = false);
75  void setGridAdaptSimpleShrinkingHorizon(bool adapt_first_iter = false);
76 
77  protected:
78  bool isDtFixedIntended() const override { return false; }
79 
80  bool adaptGrid(bool new_run, NlpFunctions& nlp_fun) override;
84 
85  bool isMovingHorizonWarmStartActive() const override { return false; }
86  bool isGridAdaptActive() const override { return true; }
87 
88  // auto resize stuff
90  int _n_max = 1000;
91  double _dt_hyst_ratio = 0.1;
92  int _n_min = 2;
93  bool _adapt_first_iter = false;
94 };
95 
96 } // namespace mpc_local_planner
97 
98 #endif // FINITE_DIFFERENCES_VARIABLE_GRID_H_
std::unique_ptr< DiscretizationGridInterface > UPtr
void setGridAdaptTimeBasedAggressiveEstimate(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
Set grid adaptation strategy to &#39;aggressive&#39;.
static corbo::Factory< corbo::DiscretizationGridInterface > & getFactory()
Get access to the associated factory.
void setGridAdaptSimpleShrinkingHorizon(bool adapt_first_iter=false)
Set grid adaptation strategy to &#39;shrinking horizon&#39;.
void setGridAdaptTimeBasedSingleStep(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
Set grid adaptation strategy to &#39;single step&#39;.
static Factory & instance()
void setNmin(int n_min)
Set minium grid size for grid adaptation.
bool adaptGrid(bool new_run, NlpFunctions &nlp_fun) override
std::shared_ptr< DiscretizationGridInterface > Ptr
corbo::DiscretizationGridInterface::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
void setDtBounds(double dt_lb, double dt_ub)
Set lower and upper bounds for the temporal resolution.
Finite differences grid with variable resolution for SE2.


mpc_local_planner
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:53:18