From 2e5bab171eac7cc2c3d0d7146eaa812a0013c1da Mon Sep 17 00:00:00 2001
From: Pierre Fernbach <pierre.fernbach@laas.fr>
Date: Fri, 9 Feb 2018 14:56:50 +0100
Subject: [PATCH] [contact-generation] remove deprecated method addState, you
 should use State.createState now

---
 idl/hpp/corbaserver/rbprm/rbprmbuilder.idl |  6 ------
 src/hpp/corbaserver/rbprm/rbprmfullbody.py |  7 -------
 src/rbprmbuilder.impl.cc                   | 17 -----------------
 src/rbprmbuilder.impl.hh                   |  1 -
 4 files changed, 31 deletions(-)

diff --git a/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl b/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl
index 804504d..01b6ae8 100755
--- a/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl
+++ b/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl
@@ -279,12 +279,6 @@ module hpp
     /// \param contactLimbs ids of the limb in contact for the state
     void setStartState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
 
-    /// Add a state to fullBody, defined by it's configuration and contacts
-    /// \param dofArray configuration of the robot
-    /// \param contactLimbs ids of the limb in contact for the state
-    short addState(in floatSeq dofArray, in Names_t contactLimbs) raises (Error);
-
-
     /// Compute effector contact points and normals for a given configuration
     /// in local coordinates
     /// \param dofArray configuration of the robot
diff --git a/src/hpp/corbaserver/rbprm/rbprmfullbody.py b/src/hpp/corbaserver/rbprm/rbprmfullbody.py
index b05bd52..72f54a6 100755
--- a/src/hpp/corbaserver/rbprm/rbprmfullbody.py
+++ b/src/hpp/corbaserver/rbprm/rbprmfullbody.py
@@ -291,13 +291,6 @@ class FullBody (object):
      def setStartState(self, configuration, contacts):
           return self.client.rbprm.rbprm.setStartState(configuration, contacts)
           
-     ## Add a state to fullBody, defined by it's configurations and contacts
-     #
-     # \param configuration the desired state configuration
-     # \param contacts the array of limbs in contact
-     def addState(self, configuration, contacts):
-         return self.client.rbprm.rbprm.addState(configuration, contacts)
-
      ## Create a state given a configuration and contacts
      #
      # \param configuration the desired start configuration
diff --git a/src/rbprmbuilder.impl.cc b/src/rbprmbuilder.impl.cc
index 32cd19e..80410c0 100755
--- a/src/rbprmbuilder.impl.cc
+++ b/src/rbprmbuilder.impl.cc
@@ -1260,23 +1260,6 @@ namespace hpp {
         }
     }
 
-    CORBA::Short RbprmBuilder::addState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error)
-    {
-        try
-        {
-            State state;
-            std::vector<std::string> names = stringConversion(contactLimbs);
-            SetPositionAndNormal(state,fullBody(), configuration, names);
-            lastStatesComputed_.push_back(state);
-            lastStatesComputedTime_.push_back(std::make_pair(0.,state));
-        }
-        catch(std::runtime_error& e)
-        {
-            throw Error(e.what());
-        }
-        return lastStatesComputed_.size()-1;
-    }
-
 
     double RbprmBuilder::getTimeAtState(unsigned short stateId)throw (hpp::Error){
       try
diff --git a/src/rbprmbuilder.impl.hh b/src/rbprmbuilder.impl.hh
index d699a9a..836b073 100755
--- a/src/rbprmbuilder.impl.hh
+++ b/src/rbprmbuilder.impl.hh
@@ -248,7 +248,6 @@ namespace hpp {
 
         virtual void setStartState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
         virtual void setEndState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
-        virtual CORBA::Short addState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
         virtual hpp::floatSeq*  computeContactForConfig(const hpp::floatSeq& configuration, const char* limbNam) throw (hpp::Error);
         virtual hpp::floatSeqSeq* computeContactPoints(unsigned short cId) throw (hpp::Error);
         virtual hpp::floatSeqSeq* computeContactPointsAtState(unsigned short cId, unsigned short isIntermediate) throw (hpp::Error);
-- 
GitLab