Skip to content

Commit 68dc872

Browse files
author
earlaud
committed
Fix joint limit test on tau
1 parent 4d1f730 commit 68dc872

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/inverse_dynamics.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)