-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: master
Are you sure you want to change the base?
Updated imu base estimation. #917
Conversation
@@ -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> |
There was a problem hiding this comment.
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
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 */ |
There was a problem hiding this comment.
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
andmeasuredRotation_L
or
isLeftStance
andmeasuredLeftRotation
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 |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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
// 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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
This PR involves the first stable release of the
BaseEstimatorFromFootIMU
.As agreed with @GiulioRomualdi this PR replaces #792 to solve its conflicts.