Repository navigation
Commit a319c45
committed
Fix SpatialForce/SpatialMomentum SE(3) transform to use the coadjoint
A spatial force/wrench is dual to spatial motion, so under an SE(3) transform it
must map by the coadjoint Ad^-T (inverse-transpose of the adjoint), not the
adjoint transpose Ad^T. Because the SE(3) adjoint is non-orthogonal whenever the
translation is nonzero, Ad^T != Ad^-T, so SpatialForce/SpatialMomentum were
transformed incorrectly for any pose with translation (correct only for a pure
rotation, where Ad is orthogonal).
For example T = SE3(1, 0, 0) acting on a unit z-force and a y-angular-velocity
breaks the invariance of instantaneous power (f . v), which must be
frame-independent: the current code gives 0 in one frame and 2 in the other.
Use np.linalg.inv(Ad).T in SpatialForce.__rmul__ and in the force/momentum
branch of the general SpatialVector.__rmul__. Motion (velocity/acceleration),
which correctly uses Ad, is unchanged.
Add a regression test to the previously-empty test_products stub asserting the
power invariance and the explicit transformed wrench/momentum.
Fixes #169.1 parent fff7009 commit a319c45
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
| |||
487 | 490 | | |
488 | 491 | | |
489 | 492 | | |
490 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
491 | 496 | | |
492 | 497 | | |
493 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
231 | 254 | | |
232 | 255 | | |
233 | 256 | | |
| |||
0 commit comments