Skip to content

Follow native SLERP in DeepMimic relative angular velocities - #4814

Open
Afloat16 wants to merge 1 commit into
bulletphysics:masterfrom
Afloat16:fix-deepmimic-relative-slerp-velocity-20261008
Open

Afloat16 wants to merge 1 commit into
bulletphysics:masterfrom
Afloat16:fix-deepmimic-relative-slerp-velocity-20261008

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 8, 2026

Copy link
Copy Markdown

DeepMimic's relative angular velocity can follow a different quaternion arc from its interpolated pose. Yaw −2 → +2 radians over 0.1 seconds produces +40 radians/second in ComputeAngVelRel, while native getQuaternionSlerp follows the shortest arc at approximately −22.83185 radians/second.

Let native SLERP select the endpoint hemisphere, then use independently normalized endpoints to obtain its geometric midpoint. Derive the half-arc angle with atan2, rotate the bounded angular displacement into the start body frame, and divide by the duration in Python. Apply the same fix to the copied Humanoid and Quadruped helpers. World-frame angular velocity, scalar joints and public signatures are unchanged.

Validation on Python 3.11.13, NumPy 2.3.5 and the official unchanged PyBullet 3.2.7 native binding:

  • Unchanged production helpers: 69 regression failures, 6 passed and 296 passing subtests. Final: 7 test functions and 364 subtests pass with warnings-as-errors. The same final test file is used in both runs.
  • Covers analytic body-frame rotations, native SLERP derivatives, q/−q signs, π boundaries, independent endpoint scales, ordinary and zero rotations, Humanoid.Slerp integration, real DIRECT spherical-joint steps, and the independently supplied near-half-turn rounding case. Duration controls cover zero errors, negative values, scalar dtypes and finite values from 1e−100 to 1e100.
  • The five original native PyBullet unit tests and four independent DIRECT controls pass. Additional probes pass 2,560 regular hemisphere/sign cases, 36 identity/tiny-angle/half-turn diagnostics, 28 dtype/range cases, 14 independent-scale cases and 4,800 near-half-turn/sign derivative cases.
  • Repository YAPF, changed-file bytecode compilation and git diff checks pass. Ruff is clean for the new tests and Quadruped helper. The Humanoid module retains the same six pre-existing undefined-name diagnostics in unused NormalizeVector code.

The C++ extension was not changed or rebuilt. Whole C++/OpenCL/GUI and Gym/TensorFlow training suites were not run; no training or performance result is claimed. Production norm calls retain two-argument math.hypot compatibility, but native testing here covers Python 3.11 only.

@Afloat16
Afloat16 marked this pull request as ready for review October 14, 2026 13:33
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