UM-ARM-Lab / pytorch_kinematics

Robot kinematics implemented in pytorch
MIT License
443 stars 42 forks source link

fix mistake in prismatic joint calculation #45

Closed fangnan99 closed 1 month ago

fangnan99 commented 1 month ago

There is a mistake in the parallel Jacobian calculation for prismatic joints.

(Was mentioned in https://github.com/UM-ARM-Lab/pytorch_kinematics/issues/3 but not fixed)

In jacobian.py, f.joint.axis.repeat(N, 1) result in shape (N,3) and cannot multiply with the (N,3,3) rotation matrix. Instead it should repeat(N,1,1) to get shape (N,1,3) to multiply with (N,3,3).

In frame.py, the expression theta * self.joint.axis is not permitted since the tensors have shapes (N,) and (3,). unsqueeze on theta solves it.