Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = [

dependencies = [
"numpy",
"spatialmath-python>=1.1.16",
"spatialmath-python>=1.1.18",
"spatialgeometry>=1.4.0",
"pgraph-python",
"scipy",
Expand Down
10 changes: 9 additions & 1 deletion src/roboticstoolbox/robot/Robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,15 @@ def rne(
i for i, group in enumerate(link_groups) if parent_idx in group
][0]

f[group_idx] = f[group_idx] + Xup[j] * f[j]
# Xup[j] is the child<-parent motion transform (v_child =
# Xup[j] * v_parent); propagating a force the other way,
# child->parent, needs the transform in the other
# direction too. spatialmath's SE3 * SpatialForce applies
# the coadjoint of its left operand (since
# spatialmath-python 1.1.18, rai-opensource/
# spatialmath-python#207), so the un-inverted transform
# (Xup[j].inv(), i.e. parent<-child) is what's needed here.
f[group_idx] = f[group_idx] + Xup[j].inv() * f[j]

# The current Q has the length equal to the number of links within the robot
# rather than the number of joints. We need to remove the static links
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ERobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def test_symdyn(self):

self.assertEqual(
str(Q[0]),
"a1**2*m2*qd0**2*sin(q1)*cos(q1) + a1*qd0*(-a1*m2*qd0*cos(q1) - m2*r2*(qd0 + qd1))*sin(q1) - a1*(m2*(a1*qd0*qd1*cos(q1) - a1*qdd0*sin(q1) - g*sin(q0)*cos(q1) - g*sin(q1)*cos(q0)) + (qd0 + qd1)*(-a1*m2*qd0*cos(q1) - m2*r2*(qd0 + qd1)))*sin(q1) - a1*(-a1*m2*qd0*(-qd0 - qd1)*sin(q1) - m2*r2*(qdd0 + qdd1) + m2*(-a1*qd0*qd1*sin(q1) - a1*qdd0*cos(q1) + g*sin(q0)*sin(q1) - g*cos(q0)*cos(q1)))*cos(q1) + g*m1*r1*cos(q0) + m1*qdd0*r1**2 + m2*r2**2*(qdd0 + qdd1) - m2*r2*(-a1*qd0*qd1*sin(q1) - a1*qdd0*cos(q1) + g*sin(q0)*sin(q1) - g*cos(q0)*cos(q1))",
"a1**2*m2*qd0**2*sin(q1)*cos(q1) + a1*qd0*(-a1*m2*qd0*cos(q1) - m2*r2*(qd0 + qd1))*sin(q1) + g*m1*r1*cos(q0) + m1*qdd0*r1**2 + m2*r2**2*(qdd0 + qdd1) - m2*r2*(-a1*qd0*qd1*sin(q1) - a1*qdd0*cos(q1) + g*sin(q0)*sin(q1) - g*cos(q0)*cos(q1)) - (a1*sin(q1)**2 + a1*cos(q1)**2)*(m2*(a1*qd0*qd1*cos(q1) - a1*qdd0*sin(q1) - g*sin(q0)*cos(q1) - g*sin(q1)*cos(q0)) + (qd0 + qd1)*(-a1*m2*qd0*cos(q1) - m2*r2*(qd0 + qd1)))*sin(q1) - (a1*sin(q1)**2 + a1*cos(q1)**2)*(-a1*m2*qd0*(-qd0 - qd1)*sin(q1) - m2*r2*(qdd0 + qdd1) + m2*(-a1*qd0*qd1*sin(q1) - a1*qdd0*cos(q1) + g*sin(q0)*sin(q1) - g*cos(q0)*cos(q1)))*cos(q1)",
)
self.assertEqual(
str(Q[1]),
Expand Down
Loading