Skip to content

Commit

Permalink
Merge pull request #684 from robotology/traversaro-patch-1
Browse files Browse the repository at this point in the history
ControlBoardDriver: Add check that min is lower than max in position limits
  • Loading branch information
traversaro authored Aug 21, 2024
2 parents d296652 + 2fdcd3c commit b15a049
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/controlboard/src/ControlBoardDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,17 @@ bool GazeboYarpControlBoardDriver::setMinMaxPos()
yCWarning(GAZEBOCONTROLBOARD) << "Missing LIMITS section";
}

// Check if the limits have sense
for (size_t i = 0; i < m_numberOfJoints; ++i)
{
if(m_jointPosLimits[i].min > m_jointPosLimits[i].max)
{
yCError(GAZEBOCONTROLBOARD) << "Joint " << m_jointNames[i] << " has inconsistent min " << m_jointPosLimits[i].min
<< " and max " << m_jointPosLimits[i].max << " position limits (min should be lower than max)." ;
return false;
}
}

return true;
}

Expand Down

0 comments on commit b15a049

Please sign in to comment.