Skip to content

Commit

Permalink
Print warnings on solver/actuator failures
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jul 17, 2018
1 parent 3bb6d70 commit e76d3bf
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions libraries/YarpPlugins/BasicCartesianControl/RateThreadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,16 @@ void roboticslab::BasicCartesianControl::handleGcmp()

std::vector<double> t(numRobotJoints);

iCartesianSolver->invDyn(currentQ, t);
if (!iCartesianSolver->invDyn(currentQ, t))
{
CD_WARNING("invDyn failed, not updating control this iteration.\n");
return;
}

iTorqueControl->setRefTorques(t.data());
if (!iTorqueControl->setRefTorques(t.data()))
{
CD_WARNING("setRefTorques failed, not updating control this iteration.\n");
}
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -246,9 +253,16 @@ void roboticslab::BasicCartesianControl::handleForc()

std::vector<double> t(numRobotJoints);

iCartesianSolver->invDyn(currentQ, qdot, qdotdot, fexts, t);
if (!iCartesianSolver->invDyn(currentQ, qdot, qdotdot, fexts, t))
{
CD_WARNING("invDyn failed, not updating control this iteration.\n");
return;
}

iTorqueControl->setRefTorques(t.data());
if (!iTorqueControl->setRefTorques(t.data()))
{
CD_WARNING("setRefTorques failed, not updating control this iteration.\n");
}
}

// -----------------------------------------------------------------------------

0 comments on commit e76d3bf

Please sign in to comment.