1#ifndef ROBOTOC_STO_COST_FUNCTION_HPP_
2#define ROBOTOC_STO_COST_FUNCTION_HPP_
6#include <unordered_map>
27 = std::shared_ptr<STOCostFunctionComponentBase>;
65 bool exist(const std::
string& name) const;
80 void erase(const std::
string& name);
109 Eigen::VectorXd& lt) const;
120 Eigen::VectorXd& lt, Eigen::MatrixXd& Qtt) const;
124 std::unordered_map<std::
string,
size_t> cost_names_;
Stack of the cost function of the switching time optimization (STO) problem. Composed by cost functio...
Definition: sto_cost_function.hpp:24
STOCostFunction(const STOCostFunction &)=default
Default copy constructor.
void clear()
Clear cost function by removing all components.
double evalCost(const TimeDiscretization &time_discretization) const
Computes the cost on the switching times.
STOCostFunction()
Default constructor.
double linearizeCost(const TimeDiscretization &time_discretization, Eigen::VectorXd <) const
Computes the cost and its derivative on the switching times.
double quadratizeCost(const TimeDiscretization &time_discretization, Eigen::VectorXd <, Eigen::MatrixXd &Qtt) const
Computes the cost and its derivative on the switching times.
STOCostFunctionComponentBasePtr get(const std::string &name) const
Gets a STO cost function component. If a component of the specified name does not exist,...
std::shared_ptr< STOCostFunctionComponentBase > STOCostFunctionComponentBasePtr
Definition: sto_cost_function.hpp:27
void add(const std::string &name, const STOCostFunctionComponentBasePtr &cost)
Adds a STO cost function component. If a component of the same name exists, throws an exeption.
STOCostFunction(STOCostFunction &&) noexcept=default
Default move constructor.
void erase(const std::string &name)
Erases a STO cost function component. If a component of the specified name does not exist,...
STOCostFunction & operator=(const STOCostFunction &)=default
Default copy operator.
~STOCostFunction()=default
Default destructor.
bool exist(const std::string &name) const
Checks if thsi has a STO cost function component of the specified name.
Time discretization of the optimal control problem.
Definition: time_discretization.hpp:20
Definition: constraint_component_base.hpp:17