From 16ac42719664fd0681c0a1de52862ffb60e05ace Mon Sep 17 00:00:00 2001
From: Carlos Mastalli <carlos.mastalli@laas.fr>
Date: Sat, 7 Sep 2019 12:27:50 +0200
Subject: [PATCH] [bindings] Exposed gaps in DDP solver

---
 bindings/python/crocoddyl/core/solver-base.hpp | 4 ++--
 bindings/python/crocoddyl/core/solvers/ddp.hpp | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bindings/python/crocoddyl/core/solver-base.hpp b/bindings/python/crocoddyl/core/solver-base.hpp
index 9c27a937..0b4f3239 100644
--- a/bindings/python/crocoddyl/core/solver-base.hpp
+++ b/bindings/python/crocoddyl/core/solver-base.hpp
@@ -21,14 +21,14 @@ namespace bp = boost::python;
 
 class SolverAbstract_wrap : public SolverAbstract, public bp::wrapper<SolverAbstract> {
  public:
-  using SolverAbstract::is_feasible_;
   using SolverAbstract::cost_;
+  using SolverAbstract::is_feasible_;
   using SolverAbstract::iter_;
   using SolverAbstract::problem_;
+  using SolverAbstract::steplength_;
   using SolverAbstract::th_acceptstep_;
   using SolverAbstract::th_stop_;
   using SolverAbstract::ureg_;
-  using SolverAbstract::steplength_;
   using SolverAbstract::us_;
   using SolverAbstract::xreg_;
   using SolverAbstract::xs_;
diff --git a/bindings/python/crocoddyl/core/solvers/ddp.hpp b/bindings/python/crocoddyl/core/solvers/ddp.hpp
index 8e18ecd5..70778bc5 100644
--- a/bindings/python/crocoddyl/core/solvers/ddp.hpp
+++ b/bindings/python/crocoddyl/core/solvers/ddp.hpp
@@ -96,7 +96,9 @@ void exposeSolverDDP() {
       .add_property("Qx", make_function(&SolverDDP::get_Qx, bp::return_value_policy<bp::copy_const_reference>()), "Qx")
       .add_property("Qu", make_function(&SolverDDP::get_Qu, bp::return_value_policy<bp::copy_const_reference>()), "Qu")
       .add_property("K", make_function(&SolverDDP::get_K, bp::return_value_policy<bp::copy_const_reference>()), "K")
-      .add_property("k", make_function(&SolverDDP::get_k, bp::return_value_policy<bp::copy_const_reference>()), "k");
+      .add_property("k", make_function(&SolverDDP::get_k, bp::return_value_policy<bp::copy_const_reference>()), "k")
+      .add_property("gaps", make_function(&SolverDDP::get_gaps, bp::return_value_policy<bp::copy_const_reference>()),
+                    "gaps");
 }
 
 }  // namespace python
-- 
GitLab