nmpc_ddp
|
DDP problem. More...
#include <DDPProblem.h>
Public Types | |
using | StateDimVector = Eigen::Matrix< double, StateDim, 1 > |
Type of vector of state dimension. More... | |
using | InputDimVector = Eigen::Matrix< double, InputDim, 1 > |
Type of vector of input dimension. More... | |
using | StateStateDimMatrix = Eigen::Matrix< double, StateDim, StateDim > |
Type of matrix of state x state dimension. More... | |
using | InputInputDimMatrix = Eigen::Matrix< double, InputDim, InputDim > |
Type of matrix of input x input dimension. More... | |
using | StateInputDimMatrix = Eigen::Matrix< double, StateDim, InputDim > |
Type of matrix of state x input dimension. More... | |
using | InputStateDimMatrix = Eigen::Matrix< double, InputDim, StateDim > |
Type of matrix of input x state dimension. More... | |
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | DDPProblem (double dt) |
Constructor. More... | |
virtual int | inputDim () const |
Gets the input dimension. More... | |
virtual int | inputDim (double) const |
Gets the input dimension. More... | |
double | dt () const |
Gets the discretization timestep [sec]. More... | |
virtual StateDimVector | stateEq (double t, const StateDimVector &x, const InputDimVector &u) const =0 |
Calculate discrete state equation. More... | |
virtual double | runningCost (double t, const StateDimVector &x, const InputDimVector &u) const =0 |
Calculate running cost. More... | |
virtual double | terminalCost (double t, const StateDimVector &x) const =0 |
Calculate terminal cost. More... | |
virtual void | calcStateEqDeriv (double t, const StateDimVector &x, const InputDimVector &u, Eigen::Ref< StateStateDimMatrix > state_eq_deriv_x, Eigen::Ref< StateInputDimMatrix > state_eq_deriv_u) const =0 |
Calculate first-order derivatives of discrete state equation. More... | |
virtual void | calcStateEqDeriv (double t, const StateDimVector &x, const InputDimVector &u, Eigen::Ref< StateStateDimMatrix > state_eq_deriv_x, Eigen::Ref< StateInputDimMatrix > state_eq_deriv_u, std::vector< StateStateDimMatrix > &state_eq_deriv_xx, std::vector< InputInputDimMatrix > &state_eq_deriv_uu, std::vector< StateInputDimMatrix > &state_eq_deriv_xu) const =0 |
Calculate first-order and second-order derivatives of discrete state equation. More... | |
virtual void | calcRunningCostDeriv (double t, const StateDimVector &x, const InputDimVector &u, Eigen::Ref< StateDimVector > running_cost_deriv_x, Eigen::Ref< InputDimVector > running_cost_deriv_u) const =0 |
Calculate first-order derivatives of running cost. More... | |
virtual void | calcRunningCostDeriv (double t, const StateDimVector &x, const InputDimVector &u, Eigen::Ref< StateDimVector > running_cost_deriv_x, Eigen::Ref< InputDimVector > running_cost_deriv_u, Eigen::Ref< StateStateDimMatrix > running_cost_deriv_xx, Eigen::Ref< InputInputDimMatrix > running_cost_deriv_uu, Eigen::Ref< StateInputDimMatrix > running_cost_deriv_xu) const =0 |
Calculate first-order and second-order derivatives of running cost. More... | |
virtual void | calcTerminalCostDeriv (double t, const StateDimVector &x, Eigen::Ref< StateDimVector > terminal_cost_deriv_x) const =0 |
Calculate first-order derivatives of terminal cost. More... | |
virtual void | calcTerminalCostDeriv (double t, const StateDimVector &x, Eigen::Ref< StateDimVector > terminal_cost_deriv_x, Eigen::Ref< StateStateDimMatrix > terminal_cost_deriv_xx) const =0 |
Calculate first-order and second-order derivatives of terminal cost. More... | |
Static Public Member Functions | |
static constexpr int | stateDim () |
Gets the state dimension. More... | |
Protected Attributes | |
const double | dt_ = 0 |
Discretization timestep [sec]. More... | |
DDP problem.
StateDim | state dimension (fixed only) |
InputDim | input dimension (fixed or dynamic (i.e., Eigen::Dynamic)) |
Definition at line 16 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::InputDimVector = Eigen::Matrix<double, InputDim, 1> |
Type of vector of input dimension.
Definition at line 23 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::InputInputDimMatrix = Eigen::Matrix<double, InputDim, InputDim> |
Type of matrix of input x input dimension.
Definition at line 29 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::InputStateDimMatrix = Eigen::Matrix<double, InputDim, StateDim> |
Type of matrix of input x state dimension.
Definition at line 35 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::StateDimVector = Eigen::Matrix<double, StateDim, 1> |
Type of vector of state dimension.
Definition at line 20 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::StateInputDimMatrix = Eigen::Matrix<double, StateDim, InputDim> |
Type of matrix of state x input dimension.
Definition at line 32 of file DDPProblem.h.
using nmpc_ddp::DDPProblem< StateDim, InputDim >::StateStateDimMatrix = Eigen::Matrix<double, StateDim, StateDim> |
Type of matrix of state x state dimension.
Definition at line 26 of file DDPProblem.h.
|
inline |
|
pure virtual |
Calculate first-order derivatives of running cost.
t | time [sec] |
x | state |
u | input |
running_cost_deriv_x | first-order derivative of running cost w.r.t. state |
running_cost_deriv_u | first-order derivative of running cost w.r.t. input |
|
pure virtual |
Calculate first-order and second-order derivatives of running cost.
t | time [sec] |
x | state |
u | input |
running_cost_deriv_x | first-order derivative of running cost w.r.t. state |
running_cost_deriv_u | first-order derivative of running cost w.r.t. input |
running_cost_deriv_xx | second-order derivative of running cost w.r.t. state |
running_cost_deriv_uu | second-order derivative of running cost w.r.t. input |
running_cost_deriv_xu | second-order derivative of running cost w.r.t. state and input |
|
pure virtual |
Calculate first-order derivatives of discrete state equation.
t | time [sec] |
x | state |
u | input |
state_eq_deriv_x | first-order derivative of state equation w.r.t. state |
state_eq_deriv_u | first-order derivative of state equation w.r.t. input |
|
pure virtual |
Calculate first-order and second-order derivatives of discrete state equation.
t | time [sec] |
x | state |
u | input |
state_eq_deriv_x | first-order derivative of state equation w.r.t. state |
state_eq_deriv_u | first-order derivative of state equation w.r.t. input |
state_eq_deriv_xx | second-order derivative of state equation w.r.t. state |
state_eq_deriv_uu | second-order derivative of state equation w.r.t. input |
state_eq_deriv_xu | second-order derivative of state equation w.r.t. state and input |
|
pure virtual |
Calculate first-order derivatives of terminal cost.
t | time [sec] |
x | state |
terminal_cost_deriv_x | first-order derivative of terminal cost w.r.t. state |
|
pure virtual |
Calculate first-order and second-order derivatives of terminal cost.
t | time [sec] |
x | state |
terminal_cost_deriv_x | first-order derivative of terminal cost w.r.t. state |
terminal_cost_deriv_xx | second-order derivative of terminal cost w.r.t. state |
|
inline |
Gets the discretization timestep [sec].
Definition at line 88 of file DDPProblem.h.
|
inlinevirtual |
Gets the input dimension.
Definition at line 61 of file DDPProblem.h.
|
inlinevirtual |
Gets the input dimension.
t | time |
Definition at line 74 of file DDPProblem.h.
|
pure virtual |
Calculate running cost.
t | time [sec] |
x | current state (x[k]) |
u | current input (u[k]) |
|
inlinestaticconstexpr |
Gets the state dimension.
Definition at line 52 of file DDPProblem.h.
|
pure virtual |
Calculate discrete state equation.
t | time [sec] |
x | current state (x[k]) |
u | current input (u[k]) |
|
pure virtual |
Calculate terminal cost.
t | time [sec] |
x | current state (x[k]) |
|
protected |
Discretization timestep [sec].
Definition at line 202 of file DDPProblem.h.