8000 fixed rotation update for velocity mode · yobzhuu/robotics-toolbox-python@3b035de · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b035de

Browse files
committed
fixed rotation update for velocity mode
1 parent 6872e31 commit 3b035de

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

roboticstoolbox/backends/Swift/Swift.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,14 @@ def _step_shapes(self, dt):
418418

419419
T = shape.base
420420
t = T.t.astype('float64')
421-
r = T.rpy('rad').astype('float64')
422-
423421
t += shape.v[:3] * dt
424-
r += shape.v[3:] * dt
425422

426-
shape.base = sm.SE3(t) * sm.SE3.RPY(r)
423+
R = sm.SO3(T.R)
424+
Rdelta = sm.SO3.EulerVec(shape.v[3:] * dt)
425+
R = Rdelta * R
426+
R = R.norm() # renormalize to avoid numerical issues
427+
428+
shape.base = sm.SE3.SO3(R, t=t)
427429

428430
def _draw_all(self):
429431

0 commit comments

Comments
 (0)
0