petercorke/robotics-toolbox-python

Python Rne is the same matlab version

yanlong658 opened this issue · 0 comments

Check here first

Common issues

Describe the bug
Hi, I find the python_rne in not the same the matlab version.

The following cod is the segment.

if self.mdh:
if j == (n - 1):
R = np.eye(3, dtype=dtype)
pstar = np.zeros((3,), dtype=dtype)
else:
R = Rm[j + 1]
pstar = pstarm[:, j + 1]

  f_ = R @ f + Fm[:, j]
  nn_ = (
      R @ nn
      + _cross(pstar, R @ f)
      + _cross(pstar, Fm[:, j])   =>bug is here.
      + Nm[:, j]
  )
  f = f_
  nn = nn_

I think the correct version is the following.

The fllowing cod is the segment.

if self.mdh:
if j == (n - 1):
R = np.eye(3, dtype=dtype)
pstar = np.zeros((3,), dtype=dtype)
else:
R = Rm[j + 1]
pstar = pstarm[:, j + 1]

  f_ = R @ f + Fm[:, j]
  nn_ = (
      R @ nn
      + _cross(pstar, R @ f)
      + _cross("COM position", Fm[:, j])  => fixed.
      + Nm[:, j]
  )
  f = f_
  nn = nn_

Thanks.