From f263e5fa547749737e2f9d45712cdc715a9f329f Mon Sep 17 00:00:00 2001
From: jcarpent <jcarpent@laas.fr>
Date: Tue, 8 Nov 2016 16:44:56 +0100
Subject: [PATCH] [Joint] Set default value for indexes in JointModelBase

---
 src/multibody/joint/joint-base.hpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/multibody/joint/joint-base.hpp b/src/multibody/joint/joint-base.hpp
index 6561fe2bf..4ce01748c 100644
--- a/src/multibody/joint/joint-base.hpp
+++ b/src/multibody/joint/joint-base.hpp
@@ -22,6 +22,7 @@
 #include "pinocchio/multibody/fwd.hpp"
 
 #include <Eigen/Core>
+#include <limits>
 
 namespace se3
 {
@@ -426,12 +427,14 @@ namespace se3
     /// Default constructor: protected.
     /// 
     /// Prevent the construction of stand-alone JointModelBase.
-    inline JointModelBase() {} // TODO: default value should be set to -1
+    inline JointModelBase() : i_id(std::numeric_limits<JointIndex>::max()), i_q(-1), i_v(-1) {}
+    
     /// Copy constructor: protected.
     ///
     /// Copy of stand-alone JointModelBase are prevented, but can be used from inhereting
     /// objects. Copy is done by calling copy operator.
     inline JointModelBase( const JointModelBase& clone) { *this = clone; }
+    
     /// Copy operator: protected.
     ///
     /// Copy of stand-alone JointModelBase are prevented, but can be used from inhereting
-- 
GitLab