Reduce BVH export joint jitter by preserving local rotations#43
Open
ola31 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Kiwoong Park <abrahamola80@gmail.com>
Signed-off-by: Kiwoong Park <abrahamola80@gmail.com>
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 PR updates BVH export to preserve Kimodo's local joint rotations more directly.
Previously,
motion_to_bvhexported rotations through an intermediate path:The new exporter writes BVH text directly from local rotation matrices:
This also removes the now-unused
bvhioruntime dependency.Motivation
While testing exported SOMA BVH files in the
soma-retargeterviewer, some motions showed visiblejoint jitter even though the same motions appeared smooth in Kimodo Visor before export.
The issue was most noticeable around upper-body joints in motions such as
boxing,boxcarry, andsquat. The exported BVH appeared to contain small frame-to-frame rotation artifacts that werenot present in the original Kimodo motion.
Root Cause
The likely cause was the previous intermediate conversion path. Although Kimodo stores local
joint rotations as rotation matrices, the previous exporter converted them through quaternions
and
bvhio/PyGLM/SpatialTransformbefore writing BVH Euler channels. The resultingEuler channels did not always faithfully preserve the original local rotation matrices, leading
to small frame-to-frame rotation differences that appeared as jitter in the
soma-retargeterviewer.
Before / After Comparison
Each video shows the previous BVH export on the left and the new BVH export on the right.
boxing
bvh_boxing_prev_vs_new.mp4
boxcarry
bvh_boxcarry_prev_vs_new.mp4
squat
bvh_squat_prev_vs_new.mp4
The Kimodo examples used for comparison are attached below.
📦 kimodo_example_boxing.zip
(https://github.com/user-attachments/files/29540502/kimodo_example_boxing.zip)
📦 kimodo_example_boxcarry.zip
(https://github.com/user-attachments/files/29540507/kimodo_example_boxcarry.zip)
📦 kimodo_example_squat.zip
(https://github.com/user-attachments/files/29540509/kimodo_example_squat.zip)
Validation
boxing,boxcarry,squat) load and play correctlyin the
soma-retargeterviewer with the new BVH exporter.resulting BVH motions load and play correctly in the
soma-retargeterviewer:01_single_text_prompt02_multi_text_prompt03_full_body_keyframes04_ee_constraint05_root_path06_root_waypoints07_mixed_constraints08_stylized_text