Skip to content

Commit

Permalink
Implement Conversions::toiDynTreeRot function (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi authored Apr 30, 2024
1 parent 783b8ae commit e341b70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project are documented in this file.
- Add the possibility to get only position or position/velocity from the spline (https://github.com/ami-iit/bipedal-locomotion-framework/pull/834)
- Add the possibility to set the number of threads used by onnxruntime in `MANN` (https://github.com/ami-iit/bipedal-locomotion-framework/pull/836)
- Implement `ButterworthLowPassFilter` class (https://github.com/ami-iit/bipedal-locomotion-framework/pull/838)
- Implement `Conversions::toiDynTreeRot` function (https://github.com/ami-iit/bipedal-locomotion-framework/pull/842)

### Changed
- 🤖 [ergoCubSN001] Add logging of the wrist and fix the name of the waist imu (https://github.com/ami-iit/bipedal-locomotion-framework/pull/810)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ inline iDynTree::Transform toiDynTreePose(const manif::SE3d& se3)
return iDynTree::Transform(iDynTree::make_matrix_view(se3.transform()));
}

/**
* @brief Convert a manif SO3 object into and iDynTree::Rotation
*
* @param so3 a manif SO3 object
* @return rotation as iDynTree::Rotation
*/
inline iDynTree::Rotation toiDynTreeRot(const manif::SO3d& so3)
{
return iDynTree::Rotation(iDynTree::make_matrix_view(so3.rotation()));
}

} // namespace Conversions
} // namespace BipedalLocomotion

Expand Down
4 changes: 4 additions & 0 deletions src/Conversions/tests/ManifConversionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ TEST_CASE("Manif Conversions")

manif::SE3d pose2 = BipedalLocomotion::Conversions::toManifPose(R, pos);
REQUIRE(pose2.transform().isApprox(iDynTree::toEigen(iDynH.asHomogeneousTransform())));

manif::SO3d rot = quat;
iDynTree::Rotation idynRot = BipedalLocomotion::Conversions::toiDynTreeRot(rot);
REQUIRE(iDynTree::toEigen(idynRot).isApprox(R, tolerance));
}

0 comments on commit e341b70

Please sign in to comment.