From b4569bdf143c64330ac6decfc297202b53fae636 Mon Sep 17 00:00:00 2001
From: Pierre Fernbach <pierre.fernbach@laas.fr>
Date: Wed, 24 Jul 2019 15:22:34 +0200
Subject: [PATCH] Update declaration of problemParameter
 FullBody/frictionCoefficient

---
 src/rbprmbuilder.impl.cc | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/rbprmbuilder.impl.cc b/src/rbprmbuilder.impl.cc
index 1606f049..1eaa00e2 100644
--- a/src/rbprmbuilder.impl.cc
+++ b/src/rbprmbuilder.impl.cc
@@ -170,13 +170,9 @@ namespace hpp {
             fullBodyMap_.selected_ = name;
             if(problemSolver()){
                 if(problemSolver()->problem()){
-                    try {
-                      double mu = problemSolver()->problem()->getParameter ("friction").floatValue();
-                      fullBody()->setFriction(mu);
-                      hppDout(notice,"fullbody : mu define in python : "<<fullBody()->getFriction());
-                    } catch (const std::exception& e) {
-                      hppDout(notice,"fullbody : mu not defined, take : "<<fullBody()->getFriction()<<" as default.");
-                    }
+                    double mu = problemSolver()->problem()->getParameter ("FullBody/frictionCoefficient").floatValue();
+                    fullBody()->setFriction(mu);
+                    hppDout(notice,"fullbody : friction coefficient used  : "<<fullBody()->getFriction());
                 }else{
                     hppDout(warning,"No instance of problem while initializing fullBody");
                 }
@@ -3483,6 +3479,13 @@ namespace hpp {
             return new hpp::floatSeq();
     }
 
+    HPP_START_PARAMETER_DECLARATION(FullBody)
+      Problem::declareParameter(core::ParameterDescription (core::Parameter::FLOAT,
+            "FullBody/frictionCoefficient",
+            "The coefficient of friction used between the robot and the environment.",
+            core::Parameter(0.5)));
+      HPP_END_PARAMETER_DECLARATION(FullBody)
+
 
     } // namespace impl
   } // namespace rbprm
-- 
GitLab