Commit 467702c7 authored by jcarpent's avatar jcarpent
Browse files

[C++] Update checker to new naming convention

parent 14b6d3be
......@@ -226,7 +226,7 @@ namespace se3
// The second test is overconstraining.
inline bool ABAChecker::checkModel_impl( const Model& model ) const
{
for(JointIndex j=1;int(j)<model.njoint;j++)
for(JointIndex j=1;int(j)<model.njoints;j++)
if( (model.inertias[j].mass () < 1e-5)
|| (model.inertias[j].inertia().data()[0] < 1e-5)
|| (model.inertias[j].inertia().data()[3] < 1e-5)
......
......@@ -50,7 +50,7 @@ namespace se3
// Check the validity of the kinematic tree defined by parents.
inline bool ParentChecker::checkModel_impl( const Model& model ) const
{
for( JointIndex j=1;(int)j<model.njoint;++j )
for( JointIndex j=1;(int)j<model.njoints;++j )
if( model.parents[j]>=j ) return false;
return true;
......@@ -64,23 +64,23 @@ namespace se3
// TODO impulse_c
// They are not check neither
CHECK_DATA( (int)data.joints.size() == model.njoint );
CHECK_DATA( (int)data.a.size() == model.njoint );
CHECK_DATA( (int)data.a_gf.size() == model.njoint );
CHECK_DATA( (int)data.v.size() == model.njoint );
CHECK_DATA( (int)data.f.size() == model.njoint );
CHECK_DATA( (int)data.oMi.size() == model.njoint );
CHECK_DATA( (int)data.liMi.size() == model.njoint );
CHECK_DATA( (int)data.Ycrb.size() == model.njoint );
CHECK_DATA( (int)data.Yaba.size() == model.njoint );
CHECK_DATA( (int)data.Fcrb.size() == model.njoint );
CHECK_DATA( (int)data.joints.size() == model.njoints );
CHECK_DATA( (int)data.a.size() == model.njoints );
CHECK_DATA( (int)data.a_gf.size() == model.njoints );
CHECK_DATA( (int)data.v.size() == model.njoints );
CHECK_DATA( (int)data.f.size() == model.njoints );
CHECK_DATA( (int)data.oMi.size() == model.njoints );
CHECK_DATA( (int)data.liMi.size() == model.njoints );
CHECK_DATA( (int)data.Ycrb.size() == model.njoints );
CHECK_DATA( (int)data.Yaba.size() == model.njoints );
CHECK_DATA( (int)data.Fcrb.size() == model.njoints );
BOOST_FOREACH(const Data::Matrix6x & F,data.Fcrb) CHECK_DATA( F.cols() == model.nv );
CHECK_DATA( (int)data.iMf.size() == model.njoint );
CHECK_DATA( (int)data.iMf.size() == model.njoint );
CHECK_DATA( (int)data.com.size() == model.njoint );
CHECK_DATA( (int)data.vcom.size() == model.njoint );
CHECK_DATA( (int)data.acom.size() == model.njoint );
CHECK_DATA( (int)data.mass.size() == model.njoint );
CHECK_DATA( (int)data.iMf.size() == model.njoints );
CHECK_DATA( (int)data.iMf.size() == model.njoints );
CHECK_DATA( (int)data.com.size() == model.njoints );
CHECK_DATA( (int)data.vcom.size() == model.njoints );
CHECK_DATA( (int)data.acom.size() == model.njoints );
CHECK_DATA( (int)data.mass.size() == model.njoints );
CHECK_DATA( data.tau.size() == model.nv );
CHECK_DATA( data.nle.size() == model.nv );
......@@ -99,17 +99,17 @@ namespace se3
CHECK_DATA( data.dq_after.size() == model.nv );
//CHECK_DATA( data.impulse_c.size()== model.nv );
CHECK_DATA( (int)data.oMf.size() == model.nFrames );
CHECK_DATA( (int)data.oMf.size() == model.nframes );
CHECK_DATA( (int)data.lastChild.size() == model.njoint );
CHECK_DATA( (int)data.nvSubtree.size() == model.njoint );
CHECK_DATA( (int)data.lastChild.size() == model.njoints );
CHECK_DATA( (int)data.nvSubtree.size() == model.njoints );
CHECK_DATA( (int)data.parents_fromRow.size() == model.nv );
CHECK_DATA( (int)data.nvSubtree_fromRow.size() == model.nv );
for( JointIndex j=1;int(j)<model.njoint;++j )
for( JointIndex j=1;int(j)<model.njoints;++j )
{
JointIndex c = data.lastChild[j];
CHECK_DATA((int)c<model.njoint);
CHECK_DATA((int)c<model.njoints);
int nv=model.joints[j].nv();
for( JointIndex d=j+1;d<=c;++d ) // explore all descendant
{
......@@ -118,7 +118,7 @@ namespace se3
}
CHECK_DATA(nv==data.nvSubtree[j]);
for( JointIndex d=c+1;(int)d<model.njoint;++d)
for( JointIndex d=c+1;(int)d<model.njoints;++d)
CHECK_DATA( (model.parents[d]<j)||(model.parents[d]>c) );
int row = model.joints[j].idx_v();
......
......@@ -240,7 +240,7 @@ namespace se3
{
inline bool isDescendant(const Model& model, const JointIndex j, const JointIndex root)
{
if(int(j)>=model.njoint) return false;
if(int(j)>=model.njoints) return false;
if(j==0) return root==0;
return (j==root) || isDescendant(model,model.parents[j],root);
}
......@@ -252,11 +252,11 @@ namespace se3
// immediately after i in the "parents" map, i.e. forall joint i, the interval i+1..n-1
// can be separated in two intervals [i+1..k] and [k+1..n-1], where any [i+1..k] is a descendant
// of i and none of [k+1..n-1] is a descendant of i.
for( JointIndex i=1; int(i)<model.njoint-1; ++i ) // no need to check joints 0 and N-1
for( JointIndex i=1; int(i)<model.njoints-1; ++i ) // no need to check joints 0 and N-1
{
JointIndex k=i+1;
while(internal::isDescendant(model,k,i)) ++k;
for( ; int(k)<model.njoint; ++k )
for( ; int(k)<model.njoints; ++k )
if( internal::isDescendant(model,k,i) ) return false;
}
return true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment