Skip to content

Commit

Permalink
Merge pull request #368 from lrapetti/patch-2
Browse files Browse the repository at this point in the history
Fix setRefCurrent methods
  • Loading branch information
traversaro authored Jun 8, 2018
2 parents 347a5d9 + d5ed893 commit 3fa2c45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/controlboard/src/ControlBoardDriverCurrent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace yarp {
{
if (!checkIfTorqueIsValid(v * m_kPWM[j]))
return false;
if (v && j >= 0 && static_cast<size_t>(j) < m_numberOfJoints) {
if (j >= 0 && static_cast<size_t>(j) < m_numberOfJoints) {
m_jntReferenceTorques[j] = v * m_kPWM[j];
return true;
}
Expand All @@ -52,7 +52,7 @@ namespace yarp {
if (!joints || !t) return false;
bool ret = true;
for (int i = 0; i < n_joint && ret; i++) {
ret = setRefCurrent(joints[i], t[i]);
m_jntReferenceTorques[joints[i]] = t[i] * m_kPWM[joints[i]];
}
return ret;
}
Expand Down

0 comments on commit 3fa2c45

Please sign in to comment.