25 #ifndef SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_FUNCTIONS_QUADRATIC_STATE_COST_H_ 26 #define SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_FUNCTIONS_QUADRATIC_STATE_COST_H_ 66 bool single_dt,
const Eigen::VectorXd& x0,
StagePreprocessor::Ptr stage_preprocessor,
const std::vector<double>& dts,
76 bool checkParameters(
int state_dim,
int control_dim, std::stringstream* issues)
const override;
78 #ifdef MESSAGE_SUPPORT 79 virtual bool fromMessage(
const messages::QuadraticStateCost& message, std::stringstream* issues);
80 virtual void toMessage(messages::QuadraticStateCost& message)
const;
82 bool fromMessage(
const messages::StageCost& message, std::stringstream* issues)
override 84 return fromMessage(message.quadratic_state_cost(), issues);
86 void toMessage(messages::StageCost& message)
const override { toMessage(*message.mutable_quadratic_state_cost()); }
106 #endif // SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_FUNCTIONS_QUADRATIC_STATE_COST_H_ bool setWeightQ(const Eigen::Ref< const Eigen::MatrixXd > &Q)
bool hasNonIntegralTerms(int k) const override
QuadraticStateCost(const Eigen::Ref< const Eigen::MatrixXd > &Q, bool integral_form, bool lsq_form=false)
void setIntegralForm(bool integral_form)
Generic interface class for discretization grids.
Eigen::DiagonalMatrix< double, -1 > _Q_diag
bool checkParameters(int state_dim, int control_dim, std::stringstream *issues) const override
bool isLsqFormNonIntegralStateTerm(int k) const override
int getNonIntegralStateTermDimension(int k) const override
Eigen::DiagonalMatrix< double, -1 > _Q_diag_sqrt
int getIntegralStateControlTermDimension(int k) const override
void computeIntegralStateControlTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, const Eigen::Ref< const Eigen::VectorXd > &u_k, Eigen::Ref< Eigen::VectorXd > cost) const override
#define FACTORY_REGISTER_STAGE_COST(type)
void computeNonIntegralStateTerm(int k, const Eigen::Ref< const Eigen::VectorXd > &x_k, Eigen::Ref< Eigen::VectorXd > cost) const override
bool update(int n, double t, ReferenceTrajectoryInterface &xref, ReferenceTrajectoryInterface &uref, ReferenceTrajectoryInterface *sref, bool single_dt, const Eigen::VectorXd &x0, StagePreprocessor::Ptr stage_preprocessor, const std::vector< double > &dts, const DiscretizationGridInterface *) override
StageCost::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
A matrix or vector expression mapping an existing expression.
void setLsqForm(bool lsq_form)
virtual bool isZero() const
Interface class for reference trajectories.
const ReferenceTrajectoryInterface * _x_ref
std::shared_ptr< StagePreprocessor > Ptr
std::shared_ptr< StageCost > Ptr
bool hasIntegralTerms(int k) const override
bool _diagonal_mode_intentionally