sulib 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sulib-1.0.0/.github/workflows/ci.yml +57 -0
- sulib-1.0.0/.github/workflows/release.yml +52 -0
- sulib-1.0.0/.gitignore +8 -0
- sulib-1.0.0/LICENSE +21 -0
- sulib-1.0.0/PKG-INFO +126 -0
- sulib-1.0.0/README.md +116 -0
- sulib-1.0.0/data/demos/contour_following/data_demo_a_1.dat +2787 -0
- sulib-1.0.0/data/demos/peg_on_hole_alignment/data_demo_a_1.dat +2489 -0
- sulib-1.0.0/data/demos/pouring/Trial1_coffee_kettle_ref_CoM.csv +652 -0
- sulib-1.0.0/data/demos/pouring/Trial1_coffee_kettle_ref_top.csv +618 -0
- sulib-1.0.0/data/demos/pouring/Trial2_coffee_kettle_ref_CoM.csv +734 -0
- sulib-1.0.0/data/demos/pouring/Trial2_coffee_kettle_ref_top.csv +708 -0
- sulib-1.0.0/data/demos/pouring/Trial3_coffee_kettle_ref_CoM.csv +746 -0
- sulib-1.0.0/data/demos/pouring/Trial3_coffee_kettle_ref_top.csv +630 -0
- sulib-1.0.0/data/demos/pouring_objects/bottle.log +32 -0
- sulib-1.0.0/data/demos/pouring_objects/bottle.obj +1468 -0
- sulib-1.0.0/data/demos/pouring_objects/bottle.par +0 -0
- sulib-1.0.0/data/demos/pouring_objects/bottle.stl +0 -0
- sulib-1.0.0/data/demos/pouring_objects/cup.log +32 -0
- sulib-1.0.0/data/demos/pouring_objects/cup.obj +202 -0
- sulib-1.0.0/data/demos/pouring_objects/cup.par +0 -0
- sulib-1.0.0/data/demos/pouring_objects/cup.stl +0 -0
- sulib-1.0.0/data/demos/pouring_objects/kettle.log +32 -0
- sulib-1.0.0/data/demos/pouring_objects/kettle.obj +2729 -0
- sulib-1.0.0/data/demos/pouring_objects/kettle.par +0 -0
- sulib-1.0.0/data/demos/pouring_objects/kettle.stl +0 -0
- sulib-1.0.0/data/demos/pouring_objects/table.log +32 -0
- sulib-1.0.0/data/demos/pouring_objects/table.obj +40 -0
- sulib-1.0.0/data/demos/pouring_objects/table.par +0 -0
- sulib-1.0.0/data/demos/pouring_objects/table.stl +0 -0
- sulib-1.0.0/figures/.gitkeep +0 -0
- sulib-1.0.0/notebooks/notebook.ipynb +247 -0
- sulib-1.0.0/pyproject.toml +26 -0
- sulib-1.0.0/requirements.txt +4 -0
- sulib-1.0.0/scripts/example_SU_calculation_force.py +83 -0
- sulib-1.0.0/scripts/example_SU_calculation_motion.py +121 -0
- sulib-1.0.0/src/sulib/__init__.py +1 -0
- sulib-1.0.0/src/sulib/_data_handling.py +368 -0
- sulib-1.0.0/src/sulib/_plotting.py +435 -0
- sulib-1.0.0/src/sulib/_preprocessing.py +98 -0
- sulib-1.0.0/src/sulib/_robotics.py +248 -0
- sulib-1.0.0/src/sulib/su_decomp.py +281 -0
- sulib-1.0.0/tests/test_su_decomp.py +70 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version:
|
|
14
|
+
- "3.10"
|
|
15
|
+
- "3.11"
|
|
16
|
+
- "3.12"
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v7
|
|
21
|
+
|
|
22
|
+
- name: Setup Python
|
|
23
|
+
uses: actions/setup-python@v7
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install -r requirements.txt
|
|
31
|
+
pip install pytest-cov ruff
|
|
32
|
+
pip install -e .
|
|
33
|
+
pip install nbconvert jupyter
|
|
34
|
+
|
|
35
|
+
- name: Lint
|
|
36
|
+
run: ruff check .
|
|
37
|
+
|
|
38
|
+
- name: Run tests with coverage
|
|
39
|
+
run: |
|
|
40
|
+
pytest --cov=sulib --cov-report=xml
|
|
41
|
+
|
|
42
|
+
- name: Run all scripts
|
|
43
|
+
run: |
|
|
44
|
+
for f in scripts/*.py; do
|
|
45
|
+
echo "Running $f"
|
|
46
|
+
python "$f"
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
- name: Run all notebooks
|
|
50
|
+
run: |
|
|
51
|
+
for nb in notebooks/*.ipynb; do
|
|
52
|
+
echo "Running $nb"
|
|
53
|
+
jupyter nbconvert \
|
|
54
|
+
--to notebook \
|
|
55
|
+
--execute "$nb" \
|
|
56
|
+
--output /tmp/out.ipynb
|
|
57
|
+
done
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build distribution
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v7
|
|
15
|
+
|
|
16
|
+
- name: Setup Python
|
|
17
|
+
uses: actions/setup-python@v7
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.x"
|
|
20
|
+
|
|
21
|
+
- name: Install build
|
|
22
|
+
run: python -m pip install --upgrade build
|
|
23
|
+
|
|
24
|
+
- name: Build package
|
|
25
|
+
run: python -m build
|
|
26
|
+
|
|
27
|
+
- name: Upload distribution
|
|
28
|
+
uses: actions/upload-artifact@v7
|
|
29
|
+
with:
|
|
30
|
+
name: python-package
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
publish:
|
|
34
|
+
name: Publish to PyPI
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
|
|
38
|
+
environment:
|
|
39
|
+
name: pypi
|
|
40
|
+
|
|
41
|
+
permissions:
|
|
42
|
+
id-token: write
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- name: Download distribution
|
|
46
|
+
uses: actions/download-artifact@v7
|
|
47
|
+
with:
|
|
48
|
+
name: python-package
|
|
49
|
+
path: dist/
|
|
50
|
+
|
|
51
|
+
- name: Publish to PyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
sulib-1.0.0/.gitignore
ADDED
sulib-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arno Verduyn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sulib-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sulib
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python code for SU-decomposition
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: numpy
|
|
8
|
+
Requires-Dist: scipy
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
[](https://github.com/arnoverduyn/SU_decomposition/actions/workflows/ci.yml)
|
|
12
|
+
|
|
13
|
+
# SU Decomposition
|
|
14
|
+
|
|
15
|
+
This repository contains a Python implementation of the **SU-decomposition**, which can be used to compute a coordinate-invariant local representation for rigid-body **motion and force trajectories**. This representation is referred to as the **Dual-Upper-Triangular Invariant Representation (DUTIR)**.
|
|
16
|
+
|
|
17
|
+
The implementation is intended for trajectory analysis, identification, and generalization across coordinate systems. It provides tools for preprocessing trajectory data, computing screw trajectories, applying the SU-decomposition, and visualizing the resulting representations.
|
|
18
|
+
|
|
19
|
+
A detailed description of the method is provided in the corresponding paper:
|
|
20
|
+
|
|
21
|
+
> **A Coordinate-Invariant Local Representation of Motion and Force Trajectories for Identification and Generalization Across Coordinate Systems**
|
|
22
|
+
|
|
23
|
+
A preprint is available on [arXiv](https://arxiv.org/abs/2604.10241).
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
The project requires **Python 3.10 or newer**.
|
|
28
|
+
|
|
29
|
+
Clone the repository and install the required dependencies:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/arnoverduyn/SU_decomposition.git
|
|
33
|
+
cd SU_decomposition
|
|
34
|
+
pip install -r requirements.txt
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The core implementation is located in `src/sulib`.
|
|
38
|
+
|
|
39
|
+
## Repository structure
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
SU_decomposition/
|
|
43
|
+
├── data/
|
|
44
|
+
│ └── demos/
|
|
45
|
+
│ ├── contour_following/
|
|
46
|
+
│ ├── peg_on_hole_alignment/
|
|
47
|
+
│ ├── pouring/
|
|
48
|
+
│ └── pouring_objects/
|
|
49
|
+
│
|
|
50
|
+
├── figures/
|
|
51
|
+
│
|
|
52
|
+
├── notebooks/
|
|
53
|
+
│
|
|
54
|
+
├── scripts/
|
|
55
|
+
│ ├── example_SU_calculation_force.py
|
|
56
|
+
│ └── example_SU_calculation_motion.py
|
|
57
|
+
│
|
|
58
|
+
├── src/
|
|
59
|
+
│ └── sulib/
|
|
60
|
+
│ ├── _data_handling.py
|
|
61
|
+
│ ├── _plotting.py
|
|
62
|
+
│ ├── _preprocessing.py
|
|
63
|
+
│ ├── _robotics.py
|
|
64
|
+
│ └── su_decomp.py
|
|
65
|
+
│
|
|
66
|
+
├── tests/
|
|
67
|
+
│ └── test_su_decomp.py
|
|
68
|
+
│
|
|
69
|
+
├── pyproject.toml
|
|
70
|
+
├── requirements.txt
|
|
71
|
+
├── LICENSE
|
|
72
|
+
└── README.md
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Package modules (public)
|
|
76
|
+
|
|
77
|
+
* `sulib.su_decomp` — core SU-decomposition and DUTIR computation.
|
|
78
|
+
|
|
79
|
+
### Package modules (internal)
|
|
80
|
+
|
|
81
|
+
* `sulib._robotics` — robotics-related operations for rigid-body trajectories.
|
|
82
|
+
* `sulib._preprocessing` — trajectory preprocessing utilities.
|
|
83
|
+
* `sulib._data_handling` — loading and handling trajectory data.
|
|
84
|
+
* `sulib._plotting` — visualization utilities.
|
|
85
|
+
|
|
86
|
+
## SU-decomposition
|
|
87
|
+
|
|
88
|
+
The function `sulib.su_decomp.compute_dutir_from_screw_traj()` takes screw trajectories as input. For motion, these screw trajectories correspond to **twist trajectories**. For force/torque data, they correspond to **wrench trajectories**.
|
|
89
|
+
|
|
90
|
+
For motion data provided as a pose trajectory, `sulib.su_decomp.compute_dutir_from_pose_traj()` first computes the corresponding twist trajectory and then computes the DUTIR from this twist trajectory.
|
|
91
|
+
|
|
92
|
+
Conceptually:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
Rigid-body pose trajectory
|
|
96
|
+
│
|
|
97
|
+
▼
|
|
98
|
+
Twist trajectory Wrench trajectory
|
|
99
|
+
│ │
|
|
100
|
+
▼ ▼
|
|
101
|
+
SU-decomposition SU-decomposition
|
|
102
|
+
│ │
|
|
103
|
+
▼ ▼
|
|
104
|
+
DUTIR of rigid-body motion DUTIR of force/torque data
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
More generally, the SU-decomposition can be applied directly to either a twist or wrench trajectory:
|
|
108
|
+
|
|
109
|
+
## Examples
|
|
110
|
+
|
|
111
|
+
The `notebooks/` directory contains numerical examples and demonstrations.
|
|
112
|
+
|
|
113
|
+
Additional example scripts are provided in `scripts/`:
|
|
114
|
+
|
|
115
|
+
## Reference
|
|
116
|
+
|
|
117
|
+
If you use this implementation in academic work, please cite the associated paper:
|
|
118
|
+
|
|
119
|
+
> **A Coordinate-Invariant Local Representation of Motion and Force Trajectories for Identification and Generalization Across Coordinate Systems**
|
|
120
|
+
|
|
121
|
+
Preprint: [arXiv:2604.10241](https://arxiv.org/abs/2604.10241)
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
This project is distributed under the license specified in [`LICENSE`](LICENSE).
|
|
126
|
+
|
sulib-1.0.0/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
[](https://github.com/arnoverduyn/SU_decomposition/actions/workflows/ci.yml)
|
|
2
|
+
|
|
3
|
+
# SU Decomposition
|
|
4
|
+
|
|
5
|
+
This repository contains a Python implementation of the **SU-decomposition**, which can be used to compute a coordinate-invariant local representation for rigid-body **motion and force trajectories**. This representation is referred to as the **Dual-Upper-Triangular Invariant Representation (DUTIR)**.
|
|
6
|
+
|
|
7
|
+
The implementation is intended for trajectory analysis, identification, and generalization across coordinate systems. It provides tools for preprocessing trajectory data, computing screw trajectories, applying the SU-decomposition, and visualizing the resulting representations.
|
|
8
|
+
|
|
9
|
+
A detailed description of the method is provided in the corresponding paper:
|
|
10
|
+
|
|
11
|
+
> **A Coordinate-Invariant Local Representation of Motion and Force Trajectories for Identification and Generalization Across Coordinate Systems**
|
|
12
|
+
|
|
13
|
+
A preprint is available on [arXiv](https://arxiv.org/abs/2604.10241).
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
The project requires **Python 3.10 or newer**.
|
|
18
|
+
|
|
19
|
+
Clone the repository and install the required dependencies:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/arnoverduyn/SU_decomposition.git
|
|
23
|
+
cd SU_decomposition
|
|
24
|
+
pip install -r requirements.txt
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The core implementation is located in `src/sulib`.
|
|
28
|
+
|
|
29
|
+
## Repository structure
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
SU_decomposition/
|
|
33
|
+
├── data/
|
|
34
|
+
│ └── demos/
|
|
35
|
+
│ ├── contour_following/
|
|
36
|
+
│ ├── peg_on_hole_alignment/
|
|
37
|
+
│ ├── pouring/
|
|
38
|
+
│ └── pouring_objects/
|
|
39
|
+
│
|
|
40
|
+
├── figures/
|
|
41
|
+
│
|
|
42
|
+
├── notebooks/
|
|
43
|
+
│
|
|
44
|
+
├── scripts/
|
|
45
|
+
│ ├── example_SU_calculation_force.py
|
|
46
|
+
│ └── example_SU_calculation_motion.py
|
|
47
|
+
│
|
|
48
|
+
├── src/
|
|
49
|
+
│ └── sulib/
|
|
50
|
+
│ ├── _data_handling.py
|
|
51
|
+
│ ├── _plotting.py
|
|
52
|
+
│ ├── _preprocessing.py
|
|
53
|
+
│ ├── _robotics.py
|
|
54
|
+
│ └── su_decomp.py
|
|
55
|
+
│
|
|
56
|
+
├── tests/
|
|
57
|
+
│ └── test_su_decomp.py
|
|
58
|
+
│
|
|
59
|
+
├── pyproject.toml
|
|
60
|
+
├── requirements.txt
|
|
61
|
+
├── LICENSE
|
|
62
|
+
└── README.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Package modules (public)
|
|
66
|
+
|
|
67
|
+
* `sulib.su_decomp` — core SU-decomposition and DUTIR computation.
|
|
68
|
+
|
|
69
|
+
### Package modules (internal)
|
|
70
|
+
|
|
71
|
+
* `sulib._robotics` — robotics-related operations for rigid-body trajectories.
|
|
72
|
+
* `sulib._preprocessing` — trajectory preprocessing utilities.
|
|
73
|
+
* `sulib._data_handling` — loading and handling trajectory data.
|
|
74
|
+
* `sulib._plotting` — visualization utilities.
|
|
75
|
+
|
|
76
|
+
## SU-decomposition
|
|
77
|
+
|
|
78
|
+
The function `sulib.su_decomp.compute_dutir_from_screw_traj()` takes screw trajectories as input. For motion, these screw trajectories correspond to **twist trajectories**. For force/torque data, they correspond to **wrench trajectories**.
|
|
79
|
+
|
|
80
|
+
For motion data provided as a pose trajectory, `sulib.su_decomp.compute_dutir_from_pose_traj()` first computes the corresponding twist trajectory and then computes the DUTIR from this twist trajectory.
|
|
81
|
+
|
|
82
|
+
Conceptually:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Rigid-body pose trajectory
|
|
86
|
+
│
|
|
87
|
+
▼
|
|
88
|
+
Twist trajectory Wrench trajectory
|
|
89
|
+
│ │
|
|
90
|
+
▼ ▼
|
|
91
|
+
SU-decomposition SU-decomposition
|
|
92
|
+
│ │
|
|
93
|
+
▼ ▼
|
|
94
|
+
DUTIR of rigid-body motion DUTIR of force/torque data
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
More generally, the SU-decomposition can be applied directly to either a twist or wrench trajectory:
|
|
98
|
+
|
|
99
|
+
## Examples
|
|
100
|
+
|
|
101
|
+
The `notebooks/` directory contains numerical examples and demonstrations.
|
|
102
|
+
|
|
103
|
+
Additional example scripts are provided in `scripts/`:
|
|
104
|
+
|
|
105
|
+
## Reference
|
|
106
|
+
|
|
107
|
+
If you use this implementation in academic work, please cite the associated paper:
|
|
108
|
+
|
|
109
|
+
> **A Coordinate-Invariant Local Representation of Motion and Force Trajectories for Identification and Generalization Across Coordinate Systems**
|
|
110
|
+
|
|
111
|
+
Preprint: [arXiv:2604.10241](https://arxiv.org/abs/2604.10241)
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
This project is distributed under the license specified in [`LICENSE`](LICENSE).
|
|
116
|
+
|