5 #include <nmpc_ddp/DDPProblem.h>
14 template<
int StateDim,
int InputDim,
int IneqDim>
15 class FmpcProblem :
public nmpc_ddp::DDPProblem<StateDim, InputDim>
19 using StateDimVector =
typename nmpc_ddp::DDPProblem<StateDim, InputDim>::StateDimVector;
22 using InputDimVector =
typename nmpc_ddp::DDPProblem<StateDim, InputDim>::InputDimVector;
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 FmpcProblem(
double dt) : nmpc_ddp::DDPProblem<StateDim, InputDim>(dt)
54 static_assert(IneqDim >= 0 || IneqDim == Eigen::Dynamic,
55 "[FMPC] Template param IneqDim should be non-negative or Eigen::Dynamic.");
64 if constexpr(IneqDim == Eigen::Dynamic)
66 throw std::runtime_error(
"Since ineq dimension is dynamic, time must be passed to ineqDim().");
78 if constexpr(IneqDim == Eigen::Dynamic)
80 throw std::runtime_error(
"ineqDim(t) must be overridden if ineq dimension is dynamic.");
106 Eigen::Ref<IneqStateDimMatrix> ineq_const_deriv_x,
107 Eigen::Ref<IneqInputDimMatrix> ineq_const_deriv_u)
const = 0;
109 using nmpc_ddp::DDPProblem<StateDim, InputDim>::calcStateEqDeriv;
122 inline virtual void calcStateEqDeriv(
double,
125 Eigen::Ref<StateStateDimMatrix>,
126 Eigen::Ref<StateInputDimMatrix>,
127 std::vector<StateStateDimMatrix> &,
128 std::vector<InputInputDimMatrix> &,
129 std::vector<StateInputDimMatrix> &
132 throw std::runtime_error(
"[FMPC] Second-order derivatives of state equation is not used.");