31 #ifndef MINIMUMENERGYCOSTBOLZA_HPP_
32 #define MINIMUMENERGYCOSTBOLZA_HPP_
36 namespace DirectTrajectoryOptimization {
42 template<
class DIMENSIONS>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49 typedef typename DIMENSIONS::state_vector_t state_vector_t;
50 typedef typename DIMENSIONS::control_vector_t control_vector_t;
51 typedef typename DIMENSIONS::control_matrix_t control_matrix_t;
64 double phi(
const state_vector_t & x,
const control_vector_t & u);
65 state_vector_t phi_x(
const state_vector_t &x,
const control_vector_t & u);
66 control_vector_t phi_u(
const state_vector_t &x,
const control_vector_t & u);
68 double terminalCost(
const state_vector_t &x_f);
69 state_vector_t terminalCostDerivative(
const state_vector_t &x_f);
70 control_matrix_t R_matrix;
74 template <
class DIMENSIONS>
75 double MinimumEnergyCostBolza<DIMENSIONS>::phi(
const state_vector_t &x,
const control_vector_t & u) {
77 double val = (u.transpose()*R_matrix*u)(0);
81 template <
class DIMENSIONS>
82 typename DIMENSIONS::state_vector_t MinimumEnergyCostBolza<DIMENSIONS>::phi_x(
const state_vector_t &x,
83 const control_vector_t & u) {
85 return(state_vector_t::Zero());
88 template <
class DIMENSIONS>
89 typename DIMENSIONS::control_vector_t MinimumEnergyCostBolza<DIMENSIONS>::phi_u(
const state_vector_t &x,
90 const control_vector_t & u) {
91 control_vector_t val = 2*R_matrix*u;
95 template <
class DIMENSIONS>
96 double MinimumEnergyCostBolza<DIMENSIONS>::terminalCost(
const state_vector_t &x_f) {
101 template <
class DIMENSIONS>
102 typename DIMENSIONS::state_vector_t MinimumEnergyCostBolza<DIMENSIONS>::terminalCostDerivative(
const state_vector_t &x_f) {
104 return(state_vector_t::Zero());
MinimumEnergyCostBolza(const control_matrix_t &R=control_matrix_t::Identity())
Constructor.
Definition: MinimumEnergyCostBolza.hpp:57
Base class to derive cost function of the type J = sum_k( phi_k(x_k,u_k,k) ) + H(X_K) ...
Base class to derive cost function of the type J = sum_k( phi_k(x_k,u_k,k) ) + H(X_K) ...
Definition: CostFunctionBolza.hpp:44
Bolza type cost function minimizing the total energy e = uTRu.
Definition: MinimumEnergyCostBolza.hpp:43