quadratic_cost_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 QUADRATIC_COST_SE2_H_
24 #define QUADRATIC_COST_SE2_H_
25 
28 
29 #include <cmath>
30 #include <memory>
31 
32 namespace mpc_local_planner {
33 
53 class QuadraticFormCostSE2 : public corbo::QuadraticFormCost
54 {
55  public:
56  using Ptr = std::shared_ptr<QuadraticFormCostSE2>;
57 
60 
71  bool lsq_form = false)
72  : corbo::QuadraticFormCost(Q, R, integral_form, lsq_form)
73  {
74  }
75 
76  // implements interface method
77  corbo::StageCost::Ptr getInstance() const override { return std::make_shared<QuadraticFormCostSE2>(); }
78 
79  // implements interface method
81 
82  // implements interface method
84  Eigen::Ref<Eigen::VectorXd> cost) const override;
85 };
86 
106 class QuadraticStateCostSE2 : public corbo::QuadraticStateCost
107 {
108  public:
109  using Ptr = std::shared_ptr<QuadraticStateCostSE2>;
110 
113 
122  QuadraticStateCostSE2(const Eigen::Ref<const Eigen::MatrixXd>& Q, bool integral_form = false, bool lsq_form = false)
123  : corbo::QuadraticStateCost(Q, integral_form, lsq_form)
124  {
125  }
126 
127  // implements interface method
128  corbo::StageCost::Ptr getInstance() const override { return std::make_shared<QuadraticStateCostSE2>(); }
129 
130  // implements interface method
132 
133  // implements interface method
135  Eigen::Ref<Eigen::VectorXd> cost) const override;
136 };
137 
138 } // namespace mpc_local_planner
139 
140 #endif // QUADRATIC_COST_SE2_H_
corbo::QuadraticFormCost
corbo::QuadraticStateCost
corbo
corbo::QuadraticFormCost::QuadraticFormCost
QuadraticFormCost()
mpc_local_planner
Definition: controller.h:44
corbo::StageCost::Ptr
std::shared_ptr< StageCost > Ptr
mpc_local_planner::QuadraticFormCostSE2::getInstance
corbo::StageCost::Ptr getInstance() const override
Definition: quadratic_cost_se2.h:117
mpc_local_planner::QuadraticFormCostSE2::computeIntegralStateControlTerm
void computeIntegralStateControlTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, const Eigen::Ref< const Eigen::VectorXd > &u_k, Eigen::Ref< Eigen::VectorXd > cost) const override
Definition: quadratic_cost_se2.cpp:74
mpc_local_planner::QuadraticStateCostSE2::computeNonIntegralStateTerm
void computeNonIntegralStateTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, Eigen::Ref< Eigen::VectorXd > cost) const override
Definition: quadratic_cost_se2.cpp:106
mpc_local_planner::QuadraticFormCostSE2::computeNonIntegralStateTerm
void computeNonIntegralStateTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, Eigen::Ref< Eigen::VectorXd > cost) const override
Definition: quadratic_cost_se2.cpp:51
corbo::QuadraticStateCost::QuadraticStateCost
QuadraticStateCost()
mpc_local_planner::QuadraticStateCostSE2::computeIntegralStateControlTerm
void computeIntegralStateControlTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, const Eigen::Ref< const Eigen::VectorXd > &u_k, Eigen::Ref< Eigen::VectorXd > cost) const override
Definition: quadratic_cost_se2.cpp:129
mpc_local_planner::QuadraticStateCostSE2::QuadraticStateCostSE2
QuadraticStateCostSE2()
Default constructor.
Definition: quadratic_cost_se2.h:132
mpc_local_planner::QuadraticStateCostSE2::getInstance
corbo::StageCost::Ptr getInstance() const override
Definition: quadratic_cost_se2.h:148
mpc_local_planner::QuadraticFormCostSE2::Ptr
std::shared_ptr< QuadraticFormCostSE2 > Ptr
Definition: quadratic_cost_se2.h:96
quadratic_state_cost.h
mpc_local_planner::QuadraticStateCostSE2::Ptr
std::shared_ptr< QuadraticStateCostSE2 > Ptr
Definition: quadratic_cost_se2.h:129
quadratic_cost.h
Eigen::Ref
mpc_local_planner::QuadraticFormCostSE2::QuadraticFormCostSE2
QuadraticFormCostSE2()
Default constructor.
Definition: quadratic_cost_se2.h:99


mpc_local_planner
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:35:06