robotics-toolbox-python
robotics-toolbox-python copied to clipboard
interia entries swapped in rbt.dynamics()
Describe the bug The definition of the inertia vector in a DH joint etc. is I = [L_xx, L_yy, L_zz, L_xy, L_yz, L_xz] but when printing the robot dynamics the last two elements are swapped, i.e., [L_xx, L_yy, L_zz, L_xy, L_xz, L_yz] which I found very confusing - but this behavior might be intentional
Version information Installed via Anaconda (version 0.11.0)
To Reproduce
import roboticstoolbox as rtb
import numpy
puma = rtb.models.DH.Puma560()
puma.links[0].I = numpy.array([[0., 3., 5.],
[3., 1., 4.],
[5., 4., 2.]])
puma.dynamics()
┌──────┬───────┬─────────────────────────┬────────────────────────────────────────┬──────────┬───────────┬───────────────────┬───────┐ │ j │ m │ r │ I │ Jm │ B │ Tc │ G │ ├──────┼───────┼─────────────────────────┼────────────────────────────────────────┼──────────┼───────────┼───────────────────┼───────┤ │link1 │ 0 │ 0, 0, 0 │ 0, 1, 2, 3, 5, 4 │ 0.0002 │ 0.00148 │ 0.395, -0.435 │ -62.6 │ │link2 │ 17.4 │ -0.364, 0.006, 0.228 │ 0.13, 0.524, 0.539, 0, 0, 0 │ 0.0002 │ 0.000817 │ 0.126, -0.071 │ 108 │ │link3 │ 4.8 │ -0.0203, -0.0141, 0.07 │ 0.066, 0.086, 0.0125, 0, 0, 0 │ 0.0002 │ 0.00138 │ 0.132, -0.105 │ -53.7 │ │link4 │ 0.82 │ 0, 0.019, 0 │ 0.0018, 0.0013, 0.0018, 0, 0, 0 │ 3.3e-05 │ 7.12e-05 │ 0.0112, -0.0169 │ 76 │ │link5 │ 0.34 │ 0, 0, 0 │ 0.0003, 0.0004, 0.0003, 0, 0, 0 │ 3.3e-05 │ 8.26e-05 │ 0.00926, -0.0145 │ 71.9 │ │link6 │ 0.09 │ 0, 0, 0.032 │ 0.00015, 0.00015, 4e-05, 0, 0, 0 │ 3.3e-05 │ 3.67e-05 │ 0.00396, -0.0105 │ 76.7 │ └──────┴───────┴─────────────────────────┴────────────────────────────────────────┴──────────┴───────────┴───────────────────┴───────┘
Expected behavior I of link1 should be
0, 1, 2, 3, 4, 5
to be consistent with how inertia gets defined as vectors in DH joints etc.
Screenshots n/a
Environment (please complete the following information):
- Windows
- Python 3.8
Additional context I think I've found where it goes wrong link
is
format(dyn, fmt, np.r_[[I[k] for k in [0, 4, 8, 1, 2, 5]]])
but should be
format(dyn, fmt, np.r_[[I[k] for k in [0, 4, 8, 1, 5, 2]]])
and there is another instance of this wrong order here