Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated imu base estimation. #917

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

G-Cervettini
Copy link
Contributor

@G-Cervettini G-Cervettini commented Dec 16, 2024

This PR involves the first stable release of the BaseEstimatorFromFootIMU.
As agreed with @GiulioRomualdi this PR replaces #792 to solve its conflicts.

@G-Cervettini G-Cervettini changed the title Updated imu base estimation. Replaces: https://github.com/ami-iit/bipedal-locomotion-framework/pull/792 Updated imu base estimation. Dec 16, 2024
@@ -12,7 +12,7 @@
#include <BipedalLocomotion/ParametersHandler/IParametersHandler.h>
#include <BipedalLocomotion/System/Advanceable.h>
#include <iDynTree/KinDynComputations.h>
#include <iDynTree/Model.h>
#include <iDynTree/Model/Model.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should revert this change, as this way of including iDynTree headers has been deprecated since version 10.0.0

Comment on lines +47 to +54
bool isLeftStance; /**< true if the left foot is in contact with the ground */
bool isRightStance; /**< true if the right foot is in contact with the ground */
Eigen::VectorXd jointPositions; /**< vector of the robot joint positions */
Eigen::VectorXd jointVelocities; /**< vector of the robot joint velocities */
manif::SE3d desiredFootPose; /**< desired orientation and position of the foot
as per footstep planner output */
manif::SO3d measuredRotation; /**< actual orientation of the foot measured by
on-board IMU */
manif::SE3d offsetStanceFootPose; /**< Optional offset orientation and position of the foot.
E.g. as per footstep planner output */
manif::SO3d measuredRotation_L; /**< actual orientation of the left foot measured by
on-board IMU */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a single notation. Either:

  • isStance_L and measuredRotation_L

or

  • isLeftStance and measuredLeftRotation

Comment on lines +14 to +19
Eigen::Vector3d toXYZ(const Eigen::Matrix3d& r)
{
Eigen::Vector3d output;
double& thetaZ = output[0]; // Roll
double& thetaX = output[0]; // Roll
double& thetaY = output[1]; // Pitch
double& thetaX = output[2]; // Yaw
double& thetaZ = output[2]; // Yaw
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How comes that you changed the order of the angles and the computations remain the same? Was it bugged before?

m_cornersInLocalFrame.emplace_back(-m_footWidth / 2, -m_footLength / 2, 0);
m_cornersInLocalFrame.emplace_back(+m_footWidth / 2, -m_footLength / 2, 0);
// Frame associated to the base of the robot (whose pose is estimated)
bool ok = populateParameter(baseEstimatorPtr->getGroup("MODEL_INFO"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider storing the output of baseEstimatorPtr->getGroup("MODEL_INFO") since you are using it multiple times below

Comment on lines +254 to +258
// Eigen::Matrix3d stepRot = m_state.footPose_R.rotation().inverse() * m_state.footPose_L.rotation();
// Eigen::Vector3d stepRotRPY = toXYZ(stepRot);
// manif::SO3d stepRotManif = manif::SO3d(stepRotRPY(0), stepRotRPY(1), stepRotRPY(2));
// manif::SE3d T_walkRot(m_noTras, stepRotManif);
// manif::SE3d temp = T_walkTras * T_walkRot * m_T_walk * m_T_yawDrift;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover? There is also some other commented code below

}
}

m_stanceLinkIndex = m_model.getFrameLink(stanceFootFrameIndex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if both isLeftStance and isRightStance are false? Can it happen? Maybe it is worth printing an error in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants