Fix stand controllers tracking wrong pose due to float32 time quantization#14
Merged
Merged
Conversation
…ation The Go2/G1 stand controllers derived their interpolation phase from a "time" observation that stored wall-clock time.time() in a float32 tensor. At the current epoch (~1.78e9) float32 resolves only ~128 s steps, so the elapsed time (obs["time"] - start_time) collapsed to 0.0 for up to ~128 s. This pinned phase = tanh(0) = 0, making STAND_UP hold the stand-down pose (and STAND_DOWN hold the stand-up pose) instead of ramping between them. Compute elapsed time directly from time.time() (float64) in Go2StandUpController, Go2StandDownController and G1LowLevelController, matching the approach already used by the RL and gain-tuning controllers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes stand-controller interpolation timing by computing elapsed time from time.time() directly instead of subtracting start_time from a float32 time observation, avoiding wall-clock quantization that froze pose transitions.
Changes:
- Updates Go2 stand-up and stand-down phase calculation to use float64 wall-clock elapsed time.
- Updates G1 low-level controller stage timing to use direct elapsed wall-clock time.
- Removes now-unused
obs_manager.compute(state)calls from the affected timing paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The Go2/G1 stand controllers derived their interpolation phase from a "time" observation that stored wall-clock time.time() in a float32 tensor. At the current epoch (~1.78e9) float32 resolves only ~128 s steps, so the elapsed time (obs["time"] - start_time) collapsed to 0.0 for up to ~128 s. This pinned phase = tanh(0) = 0, making STAND_UP hold the stand-down pose (and STAND_DOWN hold the stand-up pose) instead of ramping between them.
Compute elapsed time directly from time.time() (float64) in Go2StandUpController, Go2StandDownController and G1LowLevelController, matching the approach already used by the RL and gain-tuning controllers.