deal with fixed joints correctly. #5269. Patch by k-okada

This commit is contained in:
Wim Meeussen 2011-12-01 14:23:06 -08:00
parent 1cff691739
commit 1fd9899077
1 changed files with 6 additions and 0 deletions

View File

@ -978,6 +978,9 @@ namespace urdf{
if( pjoint->type == Joint::REVOLUTE || pjoint->type ==Joint::PRISMATIC) {
pjoint->limits->lower = fscale*(double)(resolveFloat(kinematics_axis_info->getLimits()->getMin(),kinematics_axis_info));
pjoint->limits->upper = fscale*(double)(resolveFloat(kinematics_axis_info->getLimits()->getMax(),kinematics_axis_info));
if ( pjoint->limits->lower == 0 && pjoint->limits->upper == 0 ) {
pjoint->type = Joint::FIXED;
}
}
}
}
@ -1002,6 +1005,9 @@ namespace urdf{
double fscale = (pjoint->type == Joint::REVOLUTE)?(M_PI/180.0f):_GetUnitScale(pdomaxis);
pjoint->limits->lower = (double)pdomaxis->getLimits()->getMin()->getValue()*fscale;
pjoint->limits->upper = (double)pdomaxis->getLimits()->getMax()->getValue()*fscale;
if ( pjoint->limits->lower == 0 && pjoint->limits->upper == 0 ) {
pjoint->type = Joint::FIXED;
}
}
}