Skip to content

Removed accelerometer bias#24

Open
kristof wants to merge 1 commit into
apirrone:mainfrom
kristof:fix/accelerometer-bias
Open

Removed accelerometer bias#24
kristof wants to merge 1 commit into
apirrone:mainfrom
kristof:fix/accelerometer-bias

Conversation

@kristof
Copy link
Copy Markdown

@kristof kristof commented Dec 4, 2025

Removed accelerometer[0] += 1.3 from mujoco_infer.py to match what your policy was actually trained with.

Short Summary

JAX Bug (joystick.py):

accelerometer.at[0].set(accelerometer[0] + 1.3)  # Returns new array, but result is discarded

JAX arrays are immutable.at[].set() creates and returns a new array. Without assigning it back (accelerometer = ...), the original array is unchanged. The +1.3 offset was never applied during training.

NumPy Code (mujoco_infer.py):

accelerometer[0] += 1.3  # Works — NumPy arrays are mutable

NumPy arrays are mutable — in-place modification works. The +1.3 offset IS applied during inference.

Result: Policy trained with accelerometer[0] = X, but inference sees accelerometer[0] = X + 1.3. This observation mismatch can degrade policy performance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant