Skip to content

Commit

Permalink
Add initial update checks in task test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Feb 26, 2025
1 parent 804226d commit 5d91fc7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/TSID/tests/AngularMomentumTaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ TEST_CASE("Angular momentum task")
REQUIRE(task.setKinDyn(kinDyn));
REQUIRE(task.initialize(parameterHandler));
REQUIRE(task.setVariablesHandler(variablesHandler));

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(desiredAngularMomentum, //
desiredAngularMomentumRateOfChange));
REQUIRE(task.update());
Expand Down
2 changes: 2 additions & 0 deletions src/TSID/tests/CoMTaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ TEST_CASE("CoM Task")
const auto desiredVelocity = manif::R3d::Tangent::Random();
const auto desiredAcceleration = manif::R3d::Tangent::Random();

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(desiredPosition.coeffs(),
desiredVelocity.coeffs(),
desiredAcceleration.coeffs()));
Expand Down
2 changes: 2 additions & 0 deletions src/TSID/tests/JointTrackingTaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ TEST_CASE("Joint Regularization task")
REQUIRE(task.initialize(parameterHandler));
REQUIRE(task.setVariablesHandler(variablesHandler));

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(Eigen::VectorXd::Zero(model.getNrOfDOFs()),
Eigen::VectorXd::Zero(model.getNrOfDOFs()),
feedforwardDesiredJointAcc));
Expand Down
2 changes: 2 additions & 0 deletions src/TSID/tests/R3TaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ TEST_CASE("SE3 Task")
const auto desiredVelocity = manif::R3d::Tangent::Random();
const auto desiredAcceleration = manif::R3d::Tangent::Random();

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(desiredPosition.coeffs(),
desiredVelocity.coeffs(),
desiredAcceleration.coeffs()));
Expand Down
2 changes: 2 additions & 0 deletions src/TSID/tests/SE3TaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ TEST_CASE("SE3 Task")
const auto desiredVelocity = manif::SE3d::Tangent::Random();
const auto desiredAcceleration = manif::SE3d::Tangent::Random();

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(desiredPose, desiredVelocity, desiredAcceleration));

REQUIRE(task.update());
Expand Down
2 changes: 2 additions & 0 deletions src/TSID/tests/SO3TaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ TEST_CASE("SO3 Task")
const auto desiredVelocity = manif::SO3d::Tangent::Random();
const auto desiredAcceleration = manif::SO3d::Tangent::Random();

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(desiredOrientation, desiredVelocity, desiredAcceleration));

REQUIRE(task.update());
Expand Down
5 changes: 5 additions & 0 deletions src/TSID/tests/VariableRegularizationTaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ TEST_CASE("Variable Regularization task")

Eigen::VectorXd regularize(elementNames.size());
regularize.setRandom();

REQUIRE_FALSE(task.update());

REQUIRE(task.setSetPoint(regularize));

REQUIRE(task.update());

Eigen::Ref<const Eigen::MatrixXd> A = task.getA();

// check the matrix A
Expand Down

0 comments on commit 5d91fc7

Please sign in to comment.