From 8be5af8692b824bf61b426b4bc882de32fff9ac9 Mon Sep 17 00:00:00 2001
From: Valenza Florian <fvalenza@laas.fr>
Date: Thu, 17 Dec 2015 15:24:25 +0100
Subject: [PATCH] [C++][Unittest] Debug unittest : now use correct
 configurations vectors size

---
 benchmark/timings.cpp | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/benchmark/timings.cpp b/benchmark/timings.cpp
index c8ed2e0f0..49eff9da2 100644
--- a/benchmark/timings.cpp
+++ b/benchmark/timings.cpp
@@ -151,19 +151,33 @@ int main(int argc, const char ** argv)
   Data romeo_data(romeo_model);
   GeometryData romeo_data_geom(romeo_data, romeo_model_geom);
 
+  VectorXd q_romeo = VectorXd::Random(romeo_model.nq);
+  VectorXd qdot_romeo = VectorXd::Random(romeo_model.nv);
+  VectorXd qddot_romeo = VectorXd::Random(romeo_model.nv);
+
+  std::vector<VectorXd> qs_romeo     (NBT);
+  std::vector<VectorXd> qdots_romeo  (NBT);
+  std::vector<VectorXd> qddots_romeo (NBT);
+  for(size_t i=0;i<NBT;++i)
+  {
+    qs_romeo[i]     = Eigen::VectorXd::Random(romeo_model.nq);
+    qs_romeo[i].segment<4>(3) /= qs[i].segment<4>(3).norm();
+    qdots_romeo[i]  = Eigen::VectorXd::Random(romeo_model.nv);
+    qddots_romeo[i] = Eigen::VectorXd::Random(romeo_model.nv);
+  }
 
   timer.tic();
   SMOOTH(NBT)
   {
-    geometry(romeo_model,romeo_data,qs[_smooth]);
+    geometry(romeo_model,romeo_data,qs_romeo[_smooth]);
   }
   double geom_time = timer.toc(StackTicToc::US)/NBT;
 
   timer.tic();
   SMOOTH(NBT)
   {
-    se3::geometry(romeo_model, romeo_data, qs[_smooth]);
-    updateCollisionGeometry(romeo_model,romeo_data,romeo_model_geom,romeo_data_geom,qs[_smooth]);
+    se3::geometry(romeo_model, romeo_data, qs_romeo[_smooth]);
+    updateCollisionGeometry(romeo_model,romeo_data,romeo_model_geom,romeo_data_geom,qs_romeo[_smooth]);
   }
   std::cout << "Update Collision Geometry = \t";
   std::cout << timer.toc(StackTicToc::US)/NBT - geom_time
-- 
GitLab