31 #ifndef MINIMUMVELOCITYCOSTBOLZA_HPP_
32 #define MINIMUMVELOCITYCOSTBOLZA_HPP_
34 #include <Eigen/Dense>
37 namespace DirectTrajectoryOptimization {
43 template<
class DIMENSIONS>
48 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50 typedef typename DIMENSIONS::state_vector_t state_vector_t;
51 typedef typename DIMENSIONS::control_vector_t control_vector_t;
52 typedef typename DIMENSIONS::control_matrix_t control_matrix_t;
53 typedef typename DIMENSIONS::state_matrix_t state_matrix_t;
68 double phi(
const state_vector_t & x,
const control_vector_t & u);
69 state_vector_t phi_x(
const state_vector_t &x,
const control_vector_t & u);
70 control_vector_t phi_u(
const state_vector_t &x,
const control_vector_t & u);
72 double terminalCost(
const state_vector_t &x_f);
73 state_vector_t terminalCostDerivative(
const state_vector_t &x_f);
74 state_matrix_t R_matrix;
78 template <
class DIMENSIONS>
79 double MinimumVelocityCostBolza<DIMENSIONS>::phi(
const state_vector_t &x,
const control_vector_t & u) {
81 double val = (x.transpose()*R_matrix*x)(0);
85 template <
class DIMENSIONS>
86 typename DIMENSIONS::state_vector_t MinimumVelocityCostBolza<DIMENSIONS>::phi_x(
const state_vector_t &x,
87 const control_vector_t & u) {
89 state_vector_t val = 2*R_matrix*x;
94 template <
class DIMENSIONS>
95 typename DIMENSIONS::control_vector_t MinimumVelocityCostBolza<DIMENSIONS>::phi_u(
const state_vector_t &x,
96 const control_vector_t & u) {
98 return(control_vector_t::Zero());
101 template <
class DIMENSIONS>
102 double MinimumVelocityCostBolza<DIMENSIONS>::terminalCost(
const state_vector_t &x_f) {
107 template <
class DIMENSIONS>
108 typename DIMENSIONS::state_vector_t MinimumVelocityCostBolza<DIMENSIONS>::terminalCostDerivative(
const state_vector_t &x_f) {
110 return(state_vector_t::Zero());
Base class to derive cost function of the type J = sum_k( phi_k(x_k,u_k,k) ) + H(X_K) ...
Bolza type cost function minimizing the total energy e = uTRu.
Definition: MinimumVelocityCostBolza.hpp:44
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
MinimumVelocityCostBolza(const state_matrix_t &R=state_matrix_t::Identity())
Constructor.
Definition: MinimumVelocityCostBolza.hpp:59