From 4a5ed533fa16b5c9500e733f03da3ea402c9cb91 Mon Sep 17 00:00:00 2001
From: olivier-stasse <olivier.stasse@aist.go.jp>
Date: Fri, 11 Mar 2011 05:07:22 +0900
Subject: [PATCH] Revert "obsolete class and documentation"

This reverts commit 04698daf1f68b0f63d37883db525f25db842b659.
---
 src/Mathematics/intermediate-qp-matrices.hh | 10 +++
 src/PreviewControl/SupportFSM.cpp           |  1 +
 src/privatepgtypes.cpp                      | 67 ++++++++++-----------
 src/privatepgtypes.h                        | 22 +------
 4 files changed, 45 insertions(+), 55 deletions(-)

diff --git a/src/Mathematics/intermediate-qp-matrices.hh b/src/Mathematics/intermediate-qp-matrices.hh
index 115202cf..ebf0851e 100644
--- a/src/Mathematics/intermediate-qp-matrices.hh
+++ b/src/Mathematics/intermediate-qp-matrices.hh
@@ -105,6 +105,9 @@ namespace PatternGeneratorJRL
       /// \brief Current support state
       support_state_t SupportState;
 
+      /// \brief Current support foot position
+      supportfoot_t SupportFoot;
+
       /// \}
     };
     typedef state_variant_s state_variant_t;
@@ -174,6 +177,13 @@ namespace PatternGeneratorJRL
     inline void Reference( const reference_t & Ref )
     { m_StateMatrices.Ref = Ref; };
 
+    /// \brief Accessors to the support foot position
+    inline supportfoot_t const & SupportFoot() const
+    { return m_StateMatrices.SupportFoot; };
+    inline void SupportFoot( const supportfoot_t & SupportFoot )
+    { m_StateMatrices.SupportFoot = SupportFoot; };
+    /// \}
+
     /// \brief Accessors to the current support state
     inline support_state_t const & SupportState() const
     { return m_StateMatrices.SupportState; };
diff --git a/src/PreviewControl/SupportFSM.cpp b/src/PreviewControl/SupportFSM.cpp
index d6d793fa..67007ee0 100644
--- a/src/PreviewControl/SupportFSM.cpp
+++ b/src/PreviewControl/SupportFSM.cpp
@@ -93,6 +93,7 @@ void SupportFSM::setSupportState(const double &Time, const int &pi,
 	  Support.StateChanged = true;
 	  Support.TimeLimit = Time+pi*m_T + m_SSPeriod;
 	  Support.StepNumber++;
+	  Support.SSSS = 1;
 	  if (ReferenceGiven == false)
 	    Support.StepsLeft = Support.StepsLeft-1;
 	}
diff --git a/src/privatepgtypes.cpp b/src/privatepgtypes.cpp
index 5541b527..46ced799 100644
--- a/src/privatepgtypes.cpp
+++ b/src/privatepgtypes.cpp
@@ -29,32 +29,28 @@ namespace PatternGeneratorJRL
 
   struct support_state_s & support_state_t::operator =(const support_state_s & aSS)
   {
-    Phase  = aSS.Phase;
-    Foot  = aSS.Foot;
-    StepsLeft  = aSS.StepsLeft;
-    TimeLimit = aSS.TimeLimit;
-    StepNumber  = aSS.StepNumber;
-    StateChanged = aSS.StateChanged;
-    StartTime = aSS.StartTime;
-    x = aSS.x;
-    y = aSS.y;
-    yaw = aSS.yaw;
-
+    for(unsigned int i=0;i<3;i++)
+      {
+        Phase  = aSS.Phase;
+        Foot  = aSS.Foot;
+        StepsLeft  = aSS.StepsLeft;
+        TimeLimit = aSS.TimeLimit;
+        StepNumber  = aSS.StepNumber;
+      };
     return *this;
   }
 
   void support_state_t::reset()
   {
-    Phase  = 0;
-    Foot  = 0;
-    StepsLeft  = 0;
-    TimeLimit = 0.0;
-    StepNumber  = 0;
-    StateChanged = false;
-    StartTime = 0.0;
-    x = 0.0;
-    y = 0.0;
-    yaw = 0.0;
+    for(int i=0;i<3;i++)
+      {
+        Phase  = 0;
+        Foot  = 0;
+        StepsLeft  = 0;
+        TimeLimit = 0.0;
+        StepNumber  = 0;
+        SSSS = StateChanged = false;
+      }
   }
 
   support_state_s::support_state_s()
@@ -136,14 +132,15 @@ namespace PatternGeneratorJRL
   convex_hull_t::rotate( double angle )
   {
 
-    double c_a = cos(angle);
-    double s_a = sin(angle);
+      double c_a = cos(angle);
+      double s_a = sin(angle);
+
+      for( unsigned int j=0;j<X.size();j++ )
+        {
+          X[j] = ( X[j]*c_a - Y[j]*s_a );
+          Y[j] = ( X[j]*s_a + Y[j]*c_a );
+        }
 
-    for( int j=0;j<X.size();j++ )
-      {
-	X[j] = ( X[j]*c_a - Y[j]*s_a );
-	Y[j] = ( X[j]*s_a + Y[j]*c_a );
-      }
   }
 
   convex_hull_s::convex_hull_s( int size )
@@ -173,13 +170,13 @@ namespace PatternGeneratorJRL
 
   void
   convex_hull_t::set(const double * arrayX, const double * arrayY)
-  {
-    for(int i=0;i<X.size();i++)
-      {
-	X[i] = arrayX[i];
-	Y[i] = arrayY[i];
-      }
-  }
+    {
+      for(unsigned int i=0;i<X.size();i++)
+        {
+          X[i] = arrayX[i];
+          Y[i] = arrayY[i];
+        }
+    }
 
   void
   linear_inequality_t::clear()
diff --git a/src/privatepgtypes.h b/src/privatepgtypes.h
index d2dff824..8f6715dc 100644
--- a/src/privatepgtypes.h
+++ b/src/privatepgtypes.h
@@ -39,27 +39,9 @@ namespace PatternGeneratorJRL
   /// \brief Support state of the robot at a certain point in time
   struct support_state_s
   {
-    const static int DS=0;
-    const static int SS=1;
-    const static int LEFT=2;
-    const static int RIGHT=-2;
-
-    /// \brief Support phase
-    int Phase;
-    /// \brief Support foot
-    int Foot;
-    /// \brief Number steps left before double support
-    int StepsLeft;
-    /// \brief Number of step previewed
-    int StepNumber;
-    /// \brief (true) -> New single support state
-    bool StateChanged;
-    /// \brief Time until StateChanged == true
+    int Phase, Foot, StepsLeft, StepNumber;
+    bool SSSS, StateChanged;
     double TimeLimit;
-    /// \brief start time
-    double StartTime;
-    /// \brief Position and orientation on a plane
-    double x,y,yaw;
 
     struct support_state_s & operator = (const support_state_s &aSS);
 
-- 
GitLab