-
Notifications
You must be signed in to change notification settings - Fork 39
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
KinematicInertialObserver and EncoderObserver Discrepancy with Noisy Encoder Data #461
Comments
I did not develop this estimator but what I know (without checking the code again) about this estimator is that it relies on a "pendulum-like" model which allows, given an anchor point, to rebuild the position from the orientation of the root link. This means that the encoders alone cannot provide this velocity but you need also to use the orientation and the angular velocity of the base, and this is why this part is computed with finite differences. I agree that we could exploit different sources to rebuild that velocity, especially given that gyrometer's signals are often available and may give a cleaner estimation of angular velocities, but in general the orientation estimator is kind of an integral of this signal (in the high frequencies), so it should not cause too much noise to derivate it again. Do you have a specific example / robot where you see an issue? We might also propose alternative estimators such as "tilt estimator" that could provide good performances in your use case. |
Thanks for your response. My main concern is about the linear velocity of the floating base, which is currently calculated using finite differences. I'm not as concerned with the angular velocity. For context, consider a biped robot where we aim to stabilize the DCM. We need to compute the first derivative of the CoM, similar to how Dr. Caron approached it in LIPM_Walking_Controller. First, we calculate the CoM position, then obtain its first derivative. In a dual-loop control system for the low-level controller, position feedback comes from a low-speed encoder (attached to the load side), which has some noise with 2-3 count variations. On the other hand, velocity feedback comes from a high-speed encoder (attached to the robot actuator), which is much smoother. Despite having relatively smooth joint velocity data, the issue arises because the linear velocity of the floating base is still calculated through finite differences. This causes the first derivative of the CoM to be noisy, requiring the use of an additional filter that introduces some delay. This discrepancy between position and velocity feedback is what I'm trying to address. Thanks again for your insights, and I look forward to any further suggestions or potential solutions. |
The floating-base velocity of a robot cannot be obtained directly from joint encoders alone because the base itself is not rigidly attached to any fixed reference. Instead, the estimation relies on an instantaneous anchor point that is assumed to be momentarily fixed in the world. This constraint allows us to infer the base’s motion, but it introduces a dependency on both the base’s orientation (from an IMU) and the anchor’s motion relative to the base (from encoders). Below, we derive the velocity expression step by step, showing how each term arises and why numerical differentiation is necessary. Equations derivation(I did not check again the code to confirm if the equations are exactly the same, this explanation is only to describe the principles) To estimate the position of the floating base, we rely on an instantaneous anchor point. This is a point on the robot that is in contact with the environment and assumed to be fixed in the world frame at a given instant. We define:
However, the specific point chosen as the anchor may change over time.
Because the anchor is part of the robot, its world position can be expressed as: This equation states that the world position of the anchor is obtained by taking the position of the floating base and adding the transformed position of the anchor from the base frame into the world frame. Since the anchor is assumed to be instantaneously fixed in the world, its position does not change: Differentiating the previous equation gives: Rearranging for Thus, the base’s velocity is: Breaking Down Each Term
where:
Final ExpressionWe can factor out the rotation matrix to obtain a compact form: Interpretation of the Terms
ConclusionEven with smooth joint velocities, the global linear velocity of the base,
The need to differentiate the reconstructed base position—and the fact that the instantaneous anchor point may change over time—introduces noise into the linear velocity estimate. This explains why, even if joint velocity data is smooth, the estimated floating-base velocity in the world frame can be noisier. Tilt estimatorI discussed with colleagues to release an external-user-friendly version of the Tilt estimator, that is already working but requires some cleanup and documentation. This observer includes a Lyapunov-stable estimation of the tilt and the velocity. This is explained in this paper https://arxiv.org/abs/2010.04401 |
Hello,
@gergondet @arntanguy @mehdi-benallegue
The KinematicInertialObserver updates the
posW()
andvelW()
of the realRobot, while the EncoderObserver updates theq
andalpha
of the realRobot. Within the EncoderObserver, there are three modes for updating alpha:When we select
VelUpdate::EncoderVelocities
, the realRobot'salpha
is set based on the measured joint velocities. However, whenVelUpdate::EncoderFiniteDifferences
is chosen, thealpha
updates based on finite differences of the encoder data.From my understanding, the KinematicInertialObserver always updates the
velW()
based on the numerical differential ofposW()
, which in turn is updated using encoder values. This implies that, even when usingVelUpdate::EncoderVelocities
in theEncoderObserver
, thevelW()
of the realRobot is still being updated via the finite difference of encoder data.Given that noisy encoder data and filtered joint velocity (from the encoder) may be present, this results in the
alpha
of the realRobot being relatively smooth, while thevelW()
becomes noisy. This discrepancy could lead to issues in the real system.I would greatly appreciate any insights or features in mc_rtc that could help resolve this discrepancy.
Thank you!
The text was updated successfully, but these errors were encountered: