Skip to content
Snippets Groups Projects
Commit a9ca20dc authored by Maximilien Naveau's avatar Maximilien Naveau
Browse files

start fixing the gaus approx and the documentation

parent 9541dfa8
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
*~
*.orig
*.ipynb_checkpoints
build/*
build*/*
*.aux
*.log
*.pdf
......
......@@ -41,10 +41,10 @@ class ActionModelAbstract {
StateAbstract& get_state() const;
protected:
unsigned int nu_;
unsigned int nr_;
StateAbstract& state_;
Eigen::VectorXd unone_;
unsigned int nu_; //!< Control dimension
unsigned int nr_; //!< Dimension of the cost residual
StateAbstract& state_; //!< Model of the state
Eigen::VectorXd unone_; //!< Neutral state
#ifdef PYTHON_BINDINGS
......@@ -90,6 +90,7 @@ struct ActionDataAbstract {
template <typename Model>
explicit ActionDataAbstract(Model* const model)
: cost(0.),
costResidual(model->get_nr()),
xnext(model->get_state().get_nx()),
r(model->get_nr()),
Fx(model->get_state().get_ndx(), model->get_state().get_ndx()),
......@@ -122,6 +123,7 @@ struct ActionDataAbstract {
const Eigen::MatrixXd& get_Fu() const { return Fu; }
double cost;
Eigen::VectorXd costResidual;
Eigen::VectorXd xnext;
Eigen::VectorXd r;
Eigen::MatrixXd Fx;
......
......@@ -22,6 +22,14 @@ class ActionModelNumDiff : public ActionModelAbstract {
void calc(const boost::shared_ptr<ActionDataAbstract>& data, const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u);
/**
* @brief calcDiff computes the
*
* @param data
* @param x
* @param u
* @param recalc
*/
void calcDiff(const boost::shared_ptr<ActionDataAbstract>& data, const Eigen::Ref<const Eigen::VectorXd>& x,
const Eigen::Ref<const Eigen::VectorXd>& u, const bool& recalc = true);
boost::shared_ptr<ActionDataAbstract> createData();
......@@ -83,7 +91,7 @@ struct ActionDataNumDiff : public ActionDataAbstract {
}
}
Eigen::MatrixXd Rx;
Eigen::MatrixXd Rx; //!< Cost Jacobian:
Eigen::MatrixXd Ru;
Eigen::VectorXd dx;
Eigen::VectorXd du;
......
......@@ -84,6 +84,13 @@ void ActionModelNumDiff::calcDiff(const boost::shared_ptr<ActionDataAbstract>& d
data->Lxu = data_nd->Rx.transpose() * data_nd->Ru;
data->Luu = data_nd->Ru.transpose() * data_nd->Ru;
}
else
{
data->Lxx.fill(0.0);
data->Lxu.fill(0.0);
data->Luu.fill(0.0);
}
}
ActionModelAbstract& ActionModelNumDiff::get_model() const { return model_; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment