Fixed corner cases for ProjectToSO3(), and added a reference in README.

This commit is contained in:
HuanWeng 2023-01-31 00:01:02 -06:00
parent c849e4bfca
commit 36f0f1b471
3 changed files with 4 additions and 3 deletions

View File

@ -23,6 +23,7 @@ Some unofficial versions in other languages are being developed:
Some libraries built on ours:
* [KinematicsFromDescriptionTool](https://github.com/Interbotix/kinematics_from_description), which calculates the kinematics input parameters from a robot's URDF or robot_description parameter using ROS and Python3.
* [mr_urdf_loader](https://github.com/tjdalsckd/mr_urdf_loader), which generates `M`, `Slist`, `Blist`, `Mlist` and `Glist` parameters for kinematics and dynamics. It also provides UR5 simulation using `PyBullet`.
* [tf_rbdl](https://github.com/junhyeokahn/tf_rbdl#tf_rbdl), which refactors the Python version using the package `tensorflow`.
Any contribution is welcomed but the maintenance team for this library here doesn't vouch for the reliability of those projects.

View File

@ -23,6 +23,6 @@ function R = ProjectToSO3(mat)
R = U * V';
if det(R) < 0
% In this case the result may be far from mat.
R = [R(:, 1: 2); -R(:, 3)];
R = [R(:, 1: 2), -R(:, 3)];
end
end

View File

@ -426,7 +426,7 @@ def ProjectToSO3(mat):
R = np.dot(U, Vh)
if np.linalg.det(R) < 0:
# In this case the result may be far from mat.
R[:, s[2, 2]] = -R[:, s[2, 2]]
R[:, 2] = -R[:, 2]
return R
def ProjectToSE3(mat):