Skip to content

Commit

Permalink
Attempt to fix BaseEstimatorFromFootIMU test
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Jan 13, 2025
1 parent a9df589 commit 9a354c8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@ TEST_CASE("BaseEstimatorFromFootIMU")
baseVelocity.setZero();
Eigen::Vector3d gravity;
gravity << 0, 0, -BipedalLocomotion::Math::StandardAccelerationOfGravitation;
manif::SE3d I = manif::SE3d::Identity();
manif::SE3d basePose = manif::SE3d::Identity();
Eigen::Matrix3d alignedRoot << -1.0, 0.0, 0.0,
0.0, -1.0, 0.0,
0.0, 0.0, 1.0;
Eigen::Quaterniond alignedRootQuaternion(alignedRoot);
basePose.quat(alignedRootQuaternion);

REQUIRE(kinDyn->setRobotState(I.transform(), encoders, baseVelocity, encoder_speeds, gravity));
REQUIRE(kinDyn->setRobotState(basePose.transform(), encoders, baseVelocity, encoder_speeds, gravity));

BaseEstimatorFromFootIMUInput input;
input.jointPositions = encoders;
Expand All @@ -105,5 +110,5 @@ TEST_CASE("BaseEstimatorFromFootIMU")
REQUIRE(estimator.isOutputValid());

constexpr double tolerance = 1e-3;
REQUIRE(estimator.getOutput().basePose.coeffs().isApprox(I.coeffs(), tolerance));
REQUIRE(estimator.getOutput().basePose.coeffs().isApprox(basePose.coeffs(), tolerance));
}

0 comments on commit 9a354c8

Please sign in to comment.