From 69ee0f8efe5b95ca1cd0066be145061e87c9fab3 Mon Sep 17 00:00:00 2001
From: mnaveau <maximilien.naveau@laas.fr>
Date: Tue, 18 Mar 2014 10:12:49 +0100
Subject: [PATCH] adding debuging features to the kajita2003 test 	it
 creates files that can be used by openhrp to replay the solution of the test
 on the robot in kinematics simulation mode

---
 tests/TestKajita2003.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tests/TestKajita2003.cpp b/tests/TestKajita2003.cpp
index 24862a9f..d21b5c4d 100644
--- a/tests/TestKajita2003.cpp
+++ b/tests/TestKajita2003.cpp
@@ -41,6 +41,19 @@ enum Profiles_t {
   PROFIL_PB_FLORENT_SEQ2                // 4
 };
 
+double filterprecision(double adb)
+{
+  if (fabs(adb)<1e-7)
+    return 0.0;
+
+  if (fabs(adb)>1e7)
+    return 1e7 ;
+
+  double ladb2 = adb * 1e7;
+  double lintadb2 = trunc(ladb2);
+  return lintadb2/1e7;
+}
+
 class TestKajita2003: public TestObject
 {
 
@@ -167,7 +180,7 @@ protected:
       aof.open(aFileName.c_str(),ofstream::app);
       aof.precision(8);
       aof.setf(ios::scientific, ios::floatfield);
-      for(unsigned int j = 0 ; j < m_numberOfSample ; j++){
+      for(unsigned int j = 0 ; j < 20 ; j++){
         aof << filterprecision( iteration * 0.5 ) << " "  ; // 1
         aof << filterprecision( 0.0 ) << " "  ; // 1
         aof << filterprecision( 0.0 ) << " "  ; // 1
-- 
GitLab