Skip to content

Commit

Permalink
Test the setTaskWeight and the getTaskWeight method in IK and TSID
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Dec 2, 2021
1 parent 96dd232 commit 7147ac0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/IK/tests/QPInverseKinematicsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ InverseKinematicsAndTasks createIK(std::shared_ptr<IParametersHandler> handler,
lowPriority,
weightRegularization));



Eigen::VectorXd newWeight = 10 * weightRegularization;
REQUIRE(out.ik->setTaskWeight("regularization_task", newWeight));

Eigen::VectorXd weight(newWeight.size());
REQUIRE(out.ik->getTaskWeight("regularization_task", weight));
REQUIRE(weight.isApprox(newWeight));

REQUIRE(out.ik->setTaskWeight("regularization_task", weightRegularization));

REQUIRE(out.ik->finalize(variables));

return out;
Expand Down
9 changes: 9 additions & 0 deletions src/TSID/tests/QPFixedBaseTSIDTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ TSIDAndTasks createTSID(std::shared_ptr<IParametersHandler> handler,
lowPriority,
weightRegularization));

Eigen::VectorXd newWeight = 10 * weightRegularization;
REQUIRE(out.tsid->setTaskWeight("regularization_task", newWeight));

Eigen::VectorXd weight(newWeight.size());
REQUIRE(out.tsid->getTaskWeight("regularization_task", weight));
REQUIRE(weight.isApprox(newWeight));
REQUIRE(out.tsid->setTaskWeight("regularization_task", weightRegularization));


REQUIRE(out.tsid->finalize(variables));

return out;
Expand Down

0 comments on commit 7147ac0

Please sign in to comment.