Repository navigation
Commit 7be780b
authored
Broadcast scalar integration steps over twist sequences (#248)
`Twist3.exp` documents applying one integration step to every twist in a
sequence, but currently raises `ValueError: length mismatch`. The `SE3`
conversion also rejects that case. The corresponding `Twist2` methods
fail too, including matched per-twist steps in `SE2`.
Handle the shared scalar step in all four methods, and match individual
steps in `Twist2.SE2`. Check degree-mode warnings per twist so that path
works for sequences as well. Singleton expansion and mismatched-length
rejection are retained.
```python
from spatialmath import Twist3
motion = Twist3([Twist3.Rx(0.2), Twist3.Ry(-0.3)])
print(len(motion.exp(0.5))) # 2; currently raises ValueError
print(len(motion.SE3())) # 2; currently raises ValueError
```
Validation: 20 focused cases compare the results to independent SciPy
matrix exponentials (17 fail before). A 717-row camera-reconstruction
fixture exercises 96 motion increments in 2D and 3D: all 21 formerly
aborting sequence workflows complete, and transformed points agree with
the independent reference within `4e-14`. Ordinary single-twist output
hashes are unchanged. Full suite: 367 passed, 3 existing skips; project
pre-commit hooks pass. Linux/Python 3.12.1 parent 41e0a4d commit 7be780b
2 files changed
Lines changed: 61 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| |||
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| 1075 | + | |
| 1076 | + | |
1075 | 1077 | | |
1076 | 1078 | | |
1077 | 1079 | | |
| |||
1530 | 1532 | | |
1531 | 1533 | | |
1532 | 1534 | | |
1533 | | - | |
| 1535 | + | |
1534 | 1536 | | |
1535 | 1537 | | |
1536 | 1538 | | |
1537 | 1539 | | |
1538 | 1540 | | |
1539 | | - | |
1540 | | - | |
| 1541 | + | |
| 1542 | + | |
1541 | 1543 | | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
1542 | 1548 | | |
1543 | 1549 | | |
1544 | 1550 | | |
| |||
1605 | 1611 | | |
1606 | 1612 | | |
1607 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
1608 | 1616 | | |
1609 | 1617 | | |
1610 | 1618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments