Skip to content

Commit

Permalink
ControlBoardDriver: Add check that min position limit is lower than m…
Browse files Browse the repository at this point in the history
…ax position limit
  • Loading branch information
traversaro authored Aug 21, 2024
1 parent d296652 commit 2fdcd3c
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 2fdcd3c

Please sign in to comment.