You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Acceleration Calculation of the RNE in modified DH #266
I read the ne.c code, It also show that, after calculate the sum of a_i, cross(wd,pstar), cross(w,cross(w,pstar)) (in line 173-177), the sum is then mult a ROT to transform the reference axis
import numpy.testing as nt
import numpy as np
import roboticstoolbox as rp
import spatialmath as sm
import unittest
import math
panda = rp.models.DH.Panda()
print(panda.mdh)
dq = np.array([1,1,1,1,1,1,1])
ddq = np.array([1,2,3,4,5,6,7])
t0 = panda.rne(panda.qr, dq, ddq)
tp0 = panda.rne_python(panda.qz, dq, ddq, debug=True)
print('t0:',t0)
print('tp0:',tp0)
but get two difference result.
since the Panda Robot'm is unset, default is 0, so, I change the Link.py:143 to dynchange += dynpar(self, "m", m, 1.0) so, each Link is 1 kg
so, I think the rne and rne_python may have some bug in it.
Even I update the vd_ in Line 1468, the result also not same.
After read the rne_python code, I think the Line1539 maybe have some problem.
nn_ = (
R @ nn
+ _cross(pstar, R @ f)
+ _cross(pstar, Fm[:, j])
+ Nm[:, j]
)
nn should be the sum of 4 part of vector, the third part which should be the link.r x Fm , not pstar x Fm , since the Fm is in the center of mess, not at the endpoint.
Quick question, it's been ages since I looked at this code, the vd fix is for an inconsistency between the C version, the Python version. That's not good! What reference or text are you using for truth?
Firstly, I'd like to apologise for taking close to five years to get back to you, but essentially my day job and life got in the way. Over the last few months I've been able to devote a lot more time to this toolbox — fixing bugs, reworking dubious design choices, and developing tests and solid CI processes to prevent future drift.
On this specific one: you were right — the missing parentheses in that vd_ line were a real bug. I checked the current source directly: it now reads Rt @ (_cross(wd, pstar) + _cross(w, _cross(w, pstar)) + vd), matching your analysis. I also verified it numerically on the UR5 (an MDH model): RNE - (M·qdd + C·qd + g) is now ~1e-15 (machine epsilon) where it previously diverged.
Thank you for the precise diagnosis — this was a real, confirmed fix.
Activity
hanm2019 commentedon Sep 13, 2021
I read the ne.c code, It also show that, after calculate the sum of
a_i, cross(wd,pstar), cross(w,cross(w,pstar))(in line 173-177), the sum is then mult a ROT to transform the reference axishanm2019 commentedon Sep 13, 2021
I write a test:
but get two difference result.
since the Panda Robot'm is unset, default is 0, so, I change the Link.py:143 to
dynchange += dynpar(self, "m", m, 1.0)so, each Link is 1 kgthe testcase get two result:
so, I think the rne and rne_python may have some bug in it.
Even I update the vd_ in Line 1468, the result also not same.
After read the rne_python code, I think the Line1539 maybe have some problem.
nn should be the sum of 4 part of vector, the third part which should be the
link.r x Fm, notpstar x Fm, since the Fm is in the center of mess, not at the endpoint.petercorke commentedon Nov 1, 2021
Quick question, it's been ages since I looked at this code, the
vdfix is for an inconsistency between the C version, the Python version. That's not good! What reference or text are you using for truth?petercorke commentedon Aug 25, 2026
Firstly, I'd like to apologise for taking close to five years to get back to you, but essentially my day job and life got in the way. Over the last few months I've been able to devote a lot more time to this toolbox — fixing bugs, reworking dubious design choices, and developing tests and solid CI processes to prevent future drift.
On this specific one: you were right — the missing parentheses in that
vd_line were a real bug. I checked the current source directly: it now readsRt @ (_cross(wd, pstar) + _cross(w, _cross(w, pstar)) + vd), matching your analysis. I also verified it numerically on the UR5 (an MDH model):RNE - (M·qdd + C·qd + g)is now ~1e-15 (machine epsilon) where it previously diverged.Thank you for the precise diagnosis — this was a real, confirmed fix.