UM-ARM-Lab / pytorch_kinematics

Robot kinematics implemented in pytorch
MIT License
394 stars 34 forks source link

Fixes to MJCF parser + more tests #12

Closed PeterMitrano closed 1 year ago

PeterMitrano commented 1 year ago

The old MJCF parser used compose, but since compose is also used in chain.py, there the complexity of FK was factorial in the length of the tree/chain. To be completely honest, I never fully understood why, but this PR makes it 10x faster for long chains (9 joints). All the tests still pass, except for the humanoid one because I un-implemented it. It could be re-implemented if someone was interested.

I changed a bunch of places to use float64 because with float32 it was actually off by 1e-4 and so the tests failed. Not sure what I did that made this change, but I think just using float64 is fine.

This PR also makes chain work with batched inputs, addressing #7

PeterMitrano commented 1 year ago

@powertj If you have any projects that use this can you test this PR doesn't break anything for you?