@@ -215,9 +215,16 @@ void roboticslab::BasicCartesianControl::handleGcmp()
215
215
216
216
std::vector<double > t (numRobotJoints);
217
217
218
- iCartesianSolver->invDyn (currentQ, t);
218
+ if (!iCartesianSolver->invDyn (currentQ, t))
219
+ {
220
+ CD_WARNING (" invDyn failed, not updating control this iteration.\n " );
221
+ return ;
222
+ }
219
223
220
- iTorqueControl->setRefTorques (t.data ());
224
+ if (!iTorqueControl->setRefTorques (t.data ()))
225
+ {
226
+ CD_WARNING (" setRefTorques failed, not updating control this iteration.\n " );
227
+ }
221
228
}
222
229
223
230
// -----------------------------------------------------------------------------
@@ -246,9 +253,16 @@ void roboticslab::BasicCartesianControl::handleForc()
246
253
247
254
std::vector<double > t (numRobotJoints);
248
255
249
- iCartesianSolver->invDyn (currentQ, qdot, qdotdot, fexts, t);
256
+ if (!iCartesianSolver->invDyn (currentQ, qdot, qdotdot, fexts, t))
257
+ {
258
+ CD_WARNING (" invDyn failed, not updating control this iteration.\n " );
259
+ return ;
260
+ }
250
261
251
- iTorqueControl->setRefTorques (t.data ());
262
+ if (!iTorqueControl->setRefTorques (t.data ()))
263
+ {
264
+ CD_WARNING (" setRefTorques failed, not updating control this iteration.\n " );
265
+ }
252
266
}
253
267
254
268
// -----------------------------------------------------------------------------
0 commit comments