@@ -31,16 +31,16 @@ void check_joint_limits(
3131 const Eigen::VectorXd & v,
3232 const Eigen::VectorXd & tau)
3333{
34- for (int i = 0 ; i < model_handler.getModel ().nv - 6 ; i++)
34+ const pinocchio::Model & model = model_handler.getModel ();
35+ for (int i = 0 ; i < model.nv - 6 ; i++)
3536 {
36- BOOST_CHECK_LE (q[7 + i], model_handler.getModel ().upperPositionLimit [7 + i]);
37- BOOST_CHECK_GE (q[7 + i], model_handler.getModel ().lowerPositionLimit [7 + i]);
38- BOOST_CHECK_LE (v[6 + i], model_handler.getModel ().upperVelocityLimit [6 + i]);
39- BOOST_CHECK_GE (
40- v[6 + i],
41- -model_handler.getModel ().upperVelocityLimit [6 + i]); // Do not use lower velocity bound as TSID cannot handle it
42- BOOST_CHECK_LE (tau[6 + i], model_handler.getModel ().upperEffortLimit [6 + i]);
43- BOOST_CHECK_GE (tau[6 + i], model_handler.getModel ().lowerEffortLimit [6 + i]);
37+ BOOST_CHECK_LE (q[7 + i], model.upperPositionLimit [7 + i]);
38+ BOOST_CHECK_GE (q[7 + i], model.lowerPositionLimit [7 + i]);
39+ BOOST_CHECK_LE (v[6 + i], model.upperVelocityLimit [6 + i]);
40+ // Do not use lower velocity bound as TSID cannot handle it
41+ BOOST_CHECK_GE (v[6 + i], -model.upperVelocityLimit [6 + i]);
42+ BOOST_CHECK_LE (tau[i], model.upperEffortLimit [6 + i]);
43+ BOOST_CHECK_GE (tau[i], model.lowerEffortLimit [6 + i]);
4444 }
4545}
4646
0 commit comments