fix(g1_env): restore gravity compensation feedforward#118
Open
MiaoDX wants to merge 1 commit into
Open
Conversation
Author
|
@ZhengyiLuo PTAL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This refreshes the gravity-compensation fix from the earlier closed PR #20, but with a clearer reproduction path and explicit regression coverage.
The root issue is that
G1Env.queue_action()always sendsbody_tau = 0, even whenenable_gravity_compensationis enabled. In practice this makes the flag ineffective in the active G1 control-loop path.On our side this showed up most clearly in the grasp pipeline: when running the normal G1 controller + planner flow with gravity compensation enabled, pressing
Hto return home would let the upper body sag/drop first and only then recover toward the home pose. Restoring gravity feedforward brings that path back to normal.Changes
decoupled_wbc/control/envs/g1/g1_env.pybody_tauinstead of always sending zerosgravity_compensation_joints['arms']Nonethrough the config path and silently changing the compensation scopequeue_action()produces nonzero torques when gravity compensation is enabledqueue_action()keeps zero torques when gravity compensation is disabled['arms']Why this is safe
enable_gravity_compensationTesting
Locally verified with:
Context
PR #20 already identified the missing gravity-torque application, but that branch was later discarded and is now conflicting. This PR supersedes that change with refreshed context, a slightly stronger config fix, and explicit regression tests.