InterpolatePy 1.0.2__tar.gz → 1.1.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.
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.github/workflows/pre-commit.yml +1 -1
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.github/workflows/publish.yml +1 -1
- interpolatepy-1.1.0/.github/workflows/test.yml +49 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.pre-commit-config.yaml +3 -1
- interpolatepy-1.1.0/InterpolatePy.egg-info/PKG-INFO +279 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/InterpolatePy.egg-info/SOURCES.txt +2 -0
- interpolatepy-1.1.0/InterpolatePy.egg-info/requires.txt +23 -0
- interpolatepy-1.1.0/PKG-INFO +279 -0
- interpolatepy-1.1.0/README.md +220 -0
- interpolatepy-1.1.0/examples/lin_poly_parabolic_ex.py +123 -0
- interpolatepy-1.1.0/interpolatepy/lin_poly_parabolic.py +221 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/version.py +1 -1
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/pyproject.toml +56 -11
- interpolatepy-1.1.0/requirements-dev.txt +39 -0
- interpolatepy-1.0.2/.github/workflows/test.yml +0 -42
- interpolatepy-1.0.2/InterpolatePy.egg-info/PKG-INFO +0 -410
- interpolatepy-1.0.2/InterpolatePy.egg-info/requires.txt +0 -19
- interpolatepy-1.0.2/PKG-INFO +0 -410
- interpolatepy-1.0.2/README.md +0 -370
- interpolatepy-1.0.2/requirements-dev.txt +0 -19
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.editorconfig +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.gitattributes +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/.gitignore +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/InterpolatePy.egg-info/dependency_links.txt +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/InterpolatePy.egg-info/top_level.txt +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/LICENSE +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/b_spline_approx_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/b_spline_cubic_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/b_spline_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/b_spline_interpolate_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/b_spline_smooth_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/c_s_smoot_search_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/c_s_smoothing_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/c_s_with_acc1_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/c_s_with_acc2_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/cubic_spline_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/double_s_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/frenet_frame_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/linear_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/main.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/polynomials_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/simple_paths_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/examples/trapezoidal_ex.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/__init__.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/b_spline.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/b_spline_approx.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/b_spline_cubic.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/b_spline_interpolate.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/b_spline_smooth.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/c_s_smoot_search.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/c_s_smoothing.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/c_s_with_acc1.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/c_s_with_acc2.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/cubic_spline.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/double_s.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/frenet_frame.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/linear.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/polynomials.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/simple_paths.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/trapezoidal.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/interpolatepy/tridiagonal_inv.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/requirements.txt +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/setup.cfg +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/tests/__init__.py +0 -0
- {interpolatepy-1.0.2 → interpolatepy-1.1.0}/tests/inv_test.py +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
name: ci-test
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ main, master ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main, master ]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-linux:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python-version }}
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: |
|
|
24
|
+
python -m pip install --upgrade pip
|
|
25
|
+
pip install -r requirements-dev.txt
|
|
26
|
+
pip install -e .
|
|
27
|
+
- name: Testing
|
|
28
|
+
run: |
|
|
29
|
+
python -m pytest tests
|
|
30
|
+
|
|
31
|
+
build-macos:
|
|
32
|
+
runs-on: macos-latest
|
|
33
|
+
strategy:
|
|
34
|
+
matrix:
|
|
35
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
39
|
+
uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: ${{ matrix.python-version }}
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: |
|
|
44
|
+
python -m pip install --upgrade pip
|
|
45
|
+
pip install -r requirements-dev.txt
|
|
46
|
+
pip install -e .
|
|
47
|
+
- name: Testing
|
|
48
|
+
run: |
|
|
49
|
+
python -m pytest tests
|
|
@@ -21,7 +21,7 @@ repos:
|
|
|
21
21
|
- id: black
|
|
22
22
|
|
|
23
23
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
24
|
-
rev: 'v0.11.
|
|
24
|
+
rev: 'v0.11.10'
|
|
25
25
|
hooks:
|
|
26
26
|
- id: ruff
|
|
27
27
|
types_or: [python, pyi, jupyter]
|
|
@@ -32,3 +32,5 @@ repos:
|
|
|
32
32
|
hooks:
|
|
33
33
|
- id: mypy
|
|
34
34
|
args: [--ignore-missing-imports]
|
|
35
|
+
|
|
36
|
+
# pre-commit autoupdate
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: InterpolatePy
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A comprehensive Python library for generating smooth trajectories and curves with precise control over position, velocity, acceleration, and jerk profiles
|
|
5
|
+
Author-email: Giorgio Medico <giorgio.medico11@gmail.com>
|
|
6
|
+
Maintainer-email: Giorgio Medico <giorgio.medico11@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/GiorgioMedico/InterpolatePy
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/GiorgioMedico/InterpolatePy/issues
|
|
10
|
+
Keywords: interpolation,trajectory planning,motion profiles,robotics,b-splines,cubic splines,frenet frames,path generation,motion control
|
|
11
|
+
Platform: unix
|
|
12
|
+
Platform: linux
|
|
13
|
+
Platform: osx
|
|
14
|
+
Platform: cygwin
|
|
15
|
+
Platform: win32
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Intended Audience :: Education
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
25
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
26
|
+
Classifier: Operating System :: POSIX
|
|
27
|
+
Classifier: Operating System :: Unix
|
|
28
|
+
Classifier: Operating System :: MacOS
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
31
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
33
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
34
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
35
|
+
Requires-Python: >=3.10
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
License-File: LICENSE
|
|
38
|
+
Requires-Dist: numpy>=2.0.0
|
|
39
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
40
|
+
Requires-Dist: scipy>=1.15.2
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest>=7.3.1; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
|
|
45
|
+
Requires-Dist: codecov>=2.1.13; extra == "test"
|
|
46
|
+
Requires-Dist: pre-commit>=4.1.0; extra == "test"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: black>=23.11.0; extra == "dev"
|
|
49
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
50
|
+
Requires-Dist: mypy>=1.6.1; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit>=4.1.0; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff>=0.1.5; extra == "dev"
|
|
53
|
+
Requires-Dist: pyright>=1.1.335; extra == "dev"
|
|
54
|
+
Requires-Dist: build>=1.0.3; extra == "dev"
|
|
55
|
+
Requires-Dist: twine>=4.0.2; extra == "dev"
|
|
56
|
+
Provides-Extra: all
|
|
57
|
+
Requires-Dist: interpolatepy[dev,test]; extra == "all"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# InterpolatePy
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
[](https://pepy.tech/projects/interpolatepy)
|
|
64
|
+
[](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/pre-commit.yml)
|
|
65
|
+
[](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/test.yml)
|
|
66
|
+
[](https://opensource.org/licenses/MIT)
|
|
67
|
+
|
|
68
|
+
> **Smooth trajectories, precise motion — one library.**
|
|
69
|
+
> InterpolatePy brings together classic and modern interpolation techniques for robotics, animation, and scientific computing in a single, easy‑to‑use Python package.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ⭐️ Support the Project
|
|
74
|
+
|
|
75
|
+
If InterpolatePy saves you time or powers your research, please consider **starring** the repo – it helps others discover the project and motivates future development!
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
Have you built something cool on top of InterpolatePy? Open an issue or start a discussion – we’d love to showcase community projects.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Overview
|
|
82
|
+
|
|
83
|
+
InterpolatePy is a **comprehensive collection of trajectory‑generation algorithms** – from simple linear blends to high‑order B‑splines – with a consistent, NumPy‑friendly API. Designed for robotics, animation, path planning, and data smoothing, it lets you craft trajectories that respect position, velocity, acceleration **and** jerk constraints.
|
|
84
|
+
|
|
85
|
+
Key design goals:
|
|
86
|
+
|
|
87
|
+
* **Breadth** – one package for splines *and* motion profiles.
|
|
88
|
+
* **Visualization‑ready** – every spline exposes `plot()` helpers built on Matplotlib.
|
|
89
|
+
* **Pure Python ≥ 3.10** – no compiled extensions; installs quickly everywhere.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Roadmap
|
|
94
|
+
|
|
95
|
+
Upcoming features (✅ done, 🚧 planned):
|
|
96
|
+
|
|
97
|
+
| Status | Feature |
|
|
98
|
+
| ------ | ------------------------------------------------------------------------- |
|
|
99
|
+
| 🚧 | **Bezier curves** – arbitrary degree |
|
|
100
|
+
| 🚧 | **Quaternion interpolation**: LERP / SLERP / SQUAD & B‑spline‑quaternions |
|
|
101
|
+
| 🚧 | **Linear blends** with quintic/parabolic smoothing |
|
|
102
|
+
| 🚧 | **Spherical paths** & great‑circle splines |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Key Features
|
|
107
|
+
|
|
108
|
+
### 1 · Spline Interpolation
|
|
109
|
+
|
|
110
|
+
* **B‑Splines** – cubic, approximating, smoothing.
|
|
111
|
+
* **Cubic Splines** – with optional velocity/acceleration endpoint constraints.
|
|
112
|
+
* **Global B‑Spline Interpolation** – C², C³, C⁴ continuity (degree 3–5).
|
|
113
|
+
|
|
114
|
+
### 2 · Motion Profiles
|
|
115
|
+
|
|
116
|
+
* **Double‑S** (S‑curve) – bounded jerk.
|
|
117
|
+
* **Trapezoidal** – classic industrial profile.
|
|
118
|
+
* **Polynomial** – 3/5/7‑order with boundary conditions.
|
|
119
|
+
|
|
120
|
+
### 3 · Path Utilities
|
|
121
|
+
|
|
122
|
+
* **Linear & Circular paths** in 3‑D.
|
|
123
|
+
* **Frenet frames** helper for tool orientation along curves.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Installation
|
|
128
|
+
|
|
129
|
+
InterpolatePy lives on PyPI. Install the latest stable release with:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install InterpolatePy
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Development version (with test & dev extras):
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
git clone https://github.com/GiorgioMedico/InterpolatePy.git
|
|
139
|
+
cd InterpolatePy
|
|
140
|
+
pip install -e '.[all]'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Optional extras:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pip install InterpolatePy[test] # testing only
|
|
147
|
+
pip install InterpolatePy[dev] # linting & build tools
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Quick Start
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from interpolatepy.cubic_spline import CubicSpline
|
|
156
|
+
|
|
157
|
+
t = [0, 5, 10]
|
|
158
|
+
q = [0, 2, 0]
|
|
159
|
+
|
|
160
|
+
spline = CubicSpline(t, q, v0=0.0, vn=0.0)
|
|
161
|
+
print(spline.evaluate(7.5)) # position at t = 7.5 s
|
|
162
|
+
spline.plot() # visualize position/velocity/acceleration
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Usage Examples
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary>Cubic spline with velocity constraints</summary>
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from interpolatepy.cubic_spline import CubicSpline
|
|
174
|
+
|
|
175
|
+
t_points = [0.0, 5.0, 7.0, 10.0]
|
|
176
|
+
q_points = [1.0, 3.0, -1.0, 2.0]
|
|
177
|
+
|
|
178
|
+
s = CubicSpline(t_points, q_points, v0=1.0, vn=0.0)
|
|
179
|
+
position = s.evaluate(6.0)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
<summary>Double‑S trajectory</summary>
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from interpolatepy.double_s import DoubleSTrajectory, StateParams, TrajectoryBounds
|
|
189
|
+
|
|
190
|
+
state = StateParams(q_0=0, q_1=10, v_0=0, v_1=0)
|
|
191
|
+
bounds = TrajectoryBounds(v_bound=5, a_bound=10, j_bound=30)
|
|
192
|
+
traj = DoubleSTrajectory(state, bounds)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
</details>
|
|
196
|
+
|
|
197
|
+
For more, see the [examples folder](examples/) or the full API docs (coming soon).
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Requirements
|
|
202
|
+
|
|
203
|
+
* Python ≥ 3.10
|
|
204
|
+
* NumPy ≥ 2.0
|
|
205
|
+
* SciPy ≥ 1.15
|
|
206
|
+
* Matplotlib ≥ 3.10
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
InterpolatePy uses modern Python tooling for development:
|
|
213
|
+
|
|
214
|
+
* **Code Quality**: Black and isort for formatting, Ruff and mypy for linting and type checking
|
|
215
|
+
* **Testing**: pytest for unit tests and benchmarks
|
|
216
|
+
|
|
217
|
+
To set up the development environment:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
pip install -e '.[all]'
|
|
221
|
+
pre-commit install
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Running Tests
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
python -m pytest tests
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Contributing
|
|
231
|
+
|
|
232
|
+
We love pull requests — thanks for helping improve **InterpolatePy**!
|
|
233
|
+
|
|
234
|
+
1. **Fork** the repository and create a descriptive branch (`feat/my-feature`).
|
|
235
|
+
2. **Install** dev dependencies:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
pip install -e '.[all]'
|
|
239
|
+
pre-commit install
|
|
240
|
+
```
|
|
241
|
+
3. **Code** your change, following our style (Black, isort, Ruff, mypy).
|
|
242
|
+
4. **Test** with `pytest` and run `pre-commit run --all-files`.
|
|
243
|
+
5. **Open** a pull request and explain *why* & *how* your change helps.
|
|
244
|
+
|
|
245
|
+
For larger ideas, open an issue first so we can discuss direction and scope.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Acknowledgments
|
|
250
|
+
|
|
251
|
+
InterpolatePy implements algorithms and mathematical concepts primarily from the following authoritative textbooks:
|
|
252
|
+
|
|
253
|
+
* **Biagiotti, L., & Melchiorri, C.** (2008). *Trajectory Planning for Automatic Machines and Robots*. Springer.
|
|
254
|
+
* **Siciliano, B., Sciavicco, L., Villani, L., & Oriolo, G.** (2010). *Robotics: Modelling, Planning and Control*. Springer.
|
|
255
|
+
|
|
256
|
+
The library's implementation draws heavily from the theoretical frameworks, mathematical formulations, and algorithms presented in these works.
|
|
257
|
+
|
|
258
|
+
I express my gratitude to these authors for their significant contributions to the field of trajectory planning and robotics, which have made this library possible.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
InterpolatePy is released under the MIT License – do whatever you want, but please give credit.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Citation
|
|
269
|
+
|
|
270
|
+
If InterpolatePy contributes to your academic work, consider citing it:
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
@misc{InterpolatePy,
|
|
274
|
+
author = {Giorgio Medico},
|
|
275
|
+
title = {InterpolatePy: Trajectory and Spline Library},
|
|
276
|
+
year = {2025},
|
|
277
|
+
howpublished = {\url{https://github.com/GiorgioMedico/InterpolatePy}}
|
|
278
|
+
}
|
|
279
|
+
```
|
|
@@ -27,6 +27,7 @@ examples/c_s_with_acc2_ex.py
|
|
|
27
27
|
examples/cubic_spline_ex.py
|
|
28
28
|
examples/double_s_ex.py
|
|
29
29
|
examples/frenet_frame_ex.py
|
|
30
|
+
examples/lin_poly_parabolic_ex.py
|
|
30
31
|
examples/linear_ex.py
|
|
31
32
|
examples/main.py
|
|
32
33
|
examples/polynomials_ex.py
|
|
@@ -45,6 +46,7 @@ interpolatepy/c_s_with_acc2.py
|
|
|
45
46
|
interpolatepy/cubic_spline.py
|
|
46
47
|
interpolatepy/double_s.py
|
|
47
48
|
interpolatepy/frenet_frame.py
|
|
49
|
+
interpolatepy/lin_poly_parabolic.py
|
|
48
50
|
interpolatepy/linear.py
|
|
49
51
|
interpolatepy/polynomials.py
|
|
50
52
|
interpolatepy/simple_paths.py
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
numpy>=2.0.0
|
|
2
|
+
matplotlib>=3.10.1
|
|
3
|
+
scipy>=1.15.2
|
|
4
|
+
|
|
5
|
+
[all]
|
|
6
|
+
interpolatepy[dev,test]
|
|
7
|
+
|
|
8
|
+
[dev]
|
|
9
|
+
black>=23.11.0
|
|
10
|
+
isort>=5.12.0
|
|
11
|
+
mypy>=1.6.1
|
|
12
|
+
pre-commit>=4.1.0
|
|
13
|
+
ruff>=0.1.5
|
|
14
|
+
pyright>=1.1.335
|
|
15
|
+
build>=1.0.3
|
|
16
|
+
twine>=4.0.2
|
|
17
|
+
|
|
18
|
+
[test]
|
|
19
|
+
pytest>=7.3.1
|
|
20
|
+
pytest-cov>=4.1.0
|
|
21
|
+
pytest-benchmark>=4.0.0
|
|
22
|
+
codecov>=2.1.13
|
|
23
|
+
pre-commit>=4.1.0
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: InterpolatePy
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A comprehensive Python library for generating smooth trajectories and curves with precise control over position, velocity, acceleration, and jerk profiles
|
|
5
|
+
Author-email: Giorgio Medico <giorgio.medico11@gmail.com>
|
|
6
|
+
Maintainer-email: Giorgio Medico <giorgio.medico11@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/GiorgioMedico/InterpolatePy
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/GiorgioMedico/InterpolatePy/issues
|
|
10
|
+
Keywords: interpolation,trajectory planning,motion profiles,robotics,b-splines,cubic splines,frenet frames,path generation,motion control
|
|
11
|
+
Platform: unix
|
|
12
|
+
Platform: linux
|
|
13
|
+
Platform: osx
|
|
14
|
+
Platform: cygwin
|
|
15
|
+
Platform: win32
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Intended Audience :: Education
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
25
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
26
|
+
Classifier: Operating System :: POSIX
|
|
27
|
+
Classifier: Operating System :: Unix
|
|
28
|
+
Classifier: Operating System :: MacOS
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
31
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
33
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
34
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
35
|
+
Requires-Python: >=3.10
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
License-File: LICENSE
|
|
38
|
+
Requires-Dist: numpy>=2.0.0
|
|
39
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
40
|
+
Requires-Dist: scipy>=1.15.2
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest>=7.3.1; extra == "test"
|
|
43
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-benchmark>=4.0.0; extra == "test"
|
|
45
|
+
Requires-Dist: codecov>=2.1.13; extra == "test"
|
|
46
|
+
Requires-Dist: pre-commit>=4.1.0; extra == "test"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: black>=23.11.0; extra == "dev"
|
|
49
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
50
|
+
Requires-Dist: mypy>=1.6.1; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit>=4.1.0; extra == "dev"
|
|
52
|
+
Requires-Dist: ruff>=0.1.5; extra == "dev"
|
|
53
|
+
Requires-Dist: pyright>=1.1.335; extra == "dev"
|
|
54
|
+
Requires-Dist: build>=1.0.3; extra == "dev"
|
|
55
|
+
Requires-Dist: twine>=4.0.2; extra == "dev"
|
|
56
|
+
Provides-Extra: all
|
|
57
|
+
Requires-Dist: interpolatepy[dev,test]; extra == "all"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# InterpolatePy
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
[](https://pepy.tech/projects/interpolatepy)
|
|
64
|
+
[](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/pre-commit.yml)
|
|
65
|
+
[](https://github.com/GiorgioMedico/InterpolatePy/actions/workflows/test.yml)
|
|
66
|
+
[](https://opensource.org/licenses/MIT)
|
|
67
|
+
|
|
68
|
+
> **Smooth trajectories, precise motion — one library.**
|
|
69
|
+
> InterpolatePy brings together classic and modern interpolation techniques for robotics, animation, and scientific computing in a single, easy‑to‑use Python package.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ⭐️ Support the Project
|
|
74
|
+
|
|
75
|
+
If InterpolatePy saves you time or powers your research, please consider **starring** the repo – it helps others discover the project and motivates future development!
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
Have you built something cool on top of InterpolatePy? Open an issue or start a discussion – we’d love to showcase community projects.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Overview
|
|
82
|
+
|
|
83
|
+
InterpolatePy is a **comprehensive collection of trajectory‑generation algorithms** – from simple linear blends to high‑order B‑splines – with a consistent, NumPy‑friendly API. Designed for robotics, animation, path planning, and data smoothing, it lets you craft trajectories that respect position, velocity, acceleration **and** jerk constraints.
|
|
84
|
+
|
|
85
|
+
Key design goals:
|
|
86
|
+
|
|
87
|
+
* **Breadth** – one package for splines *and* motion profiles.
|
|
88
|
+
* **Visualization‑ready** – every spline exposes `plot()` helpers built on Matplotlib.
|
|
89
|
+
* **Pure Python ≥ 3.10** – no compiled extensions; installs quickly everywhere.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Roadmap
|
|
94
|
+
|
|
95
|
+
Upcoming features (✅ done, 🚧 planned):
|
|
96
|
+
|
|
97
|
+
| Status | Feature |
|
|
98
|
+
| ------ | ------------------------------------------------------------------------- |
|
|
99
|
+
| 🚧 | **Bezier curves** – arbitrary degree |
|
|
100
|
+
| 🚧 | **Quaternion interpolation**: LERP / SLERP / SQUAD & B‑spline‑quaternions |
|
|
101
|
+
| 🚧 | **Linear blends** with quintic/parabolic smoothing |
|
|
102
|
+
| 🚧 | **Spherical paths** & great‑circle splines |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Key Features
|
|
107
|
+
|
|
108
|
+
### 1 · Spline Interpolation
|
|
109
|
+
|
|
110
|
+
* **B‑Splines** – cubic, approximating, smoothing.
|
|
111
|
+
* **Cubic Splines** – with optional velocity/acceleration endpoint constraints.
|
|
112
|
+
* **Global B‑Spline Interpolation** – C², C³, C⁴ continuity (degree 3–5).
|
|
113
|
+
|
|
114
|
+
### 2 · Motion Profiles
|
|
115
|
+
|
|
116
|
+
* **Double‑S** (S‑curve) – bounded jerk.
|
|
117
|
+
* **Trapezoidal** – classic industrial profile.
|
|
118
|
+
* **Polynomial** – 3/5/7‑order with boundary conditions.
|
|
119
|
+
|
|
120
|
+
### 3 · Path Utilities
|
|
121
|
+
|
|
122
|
+
* **Linear & Circular paths** in 3‑D.
|
|
123
|
+
* **Frenet frames** helper for tool orientation along curves.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Installation
|
|
128
|
+
|
|
129
|
+
InterpolatePy lives on PyPI. Install the latest stable release with:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install InterpolatePy
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Development version (with test & dev extras):
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
git clone https://github.com/GiorgioMedico/InterpolatePy.git
|
|
139
|
+
cd InterpolatePy
|
|
140
|
+
pip install -e '.[all]'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Optional extras:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pip install InterpolatePy[test] # testing only
|
|
147
|
+
pip install InterpolatePy[dev] # linting & build tools
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Quick Start
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from interpolatepy.cubic_spline import CubicSpline
|
|
156
|
+
|
|
157
|
+
t = [0, 5, 10]
|
|
158
|
+
q = [0, 2, 0]
|
|
159
|
+
|
|
160
|
+
spline = CubicSpline(t, q, v0=0.0, vn=0.0)
|
|
161
|
+
print(spline.evaluate(7.5)) # position at t = 7.5 s
|
|
162
|
+
spline.plot() # visualize position/velocity/acceleration
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Usage Examples
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary>Cubic spline with velocity constraints</summary>
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from interpolatepy.cubic_spline import CubicSpline
|
|
174
|
+
|
|
175
|
+
t_points = [0.0, 5.0, 7.0, 10.0]
|
|
176
|
+
q_points = [1.0, 3.0, -1.0, 2.0]
|
|
177
|
+
|
|
178
|
+
s = CubicSpline(t_points, q_points, v0=1.0, vn=0.0)
|
|
179
|
+
position = s.evaluate(6.0)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
<summary>Double‑S trajectory</summary>
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from interpolatepy.double_s import DoubleSTrajectory, StateParams, TrajectoryBounds
|
|
189
|
+
|
|
190
|
+
state = StateParams(q_0=0, q_1=10, v_0=0, v_1=0)
|
|
191
|
+
bounds = TrajectoryBounds(v_bound=5, a_bound=10, j_bound=30)
|
|
192
|
+
traj = DoubleSTrajectory(state, bounds)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
</details>
|
|
196
|
+
|
|
197
|
+
For more, see the [examples folder](examples/) or the full API docs (coming soon).
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Requirements
|
|
202
|
+
|
|
203
|
+
* Python ≥ 3.10
|
|
204
|
+
* NumPy ≥ 2.0
|
|
205
|
+
* SciPy ≥ 1.15
|
|
206
|
+
* Matplotlib ≥ 3.10
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
InterpolatePy uses modern Python tooling for development:
|
|
213
|
+
|
|
214
|
+
* **Code Quality**: Black and isort for formatting, Ruff and mypy for linting and type checking
|
|
215
|
+
* **Testing**: pytest for unit tests and benchmarks
|
|
216
|
+
|
|
217
|
+
To set up the development environment:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
pip install -e '.[all]'
|
|
221
|
+
pre-commit install
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Running Tests
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
python -m pytest tests
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Contributing
|
|
231
|
+
|
|
232
|
+
We love pull requests — thanks for helping improve **InterpolatePy**!
|
|
233
|
+
|
|
234
|
+
1. **Fork** the repository and create a descriptive branch (`feat/my-feature`).
|
|
235
|
+
2. **Install** dev dependencies:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
pip install -e '.[all]'
|
|
239
|
+
pre-commit install
|
|
240
|
+
```
|
|
241
|
+
3. **Code** your change, following our style (Black, isort, Ruff, mypy).
|
|
242
|
+
4. **Test** with `pytest` and run `pre-commit run --all-files`.
|
|
243
|
+
5. **Open** a pull request and explain *why* & *how* your change helps.
|
|
244
|
+
|
|
245
|
+
For larger ideas, open an issue first so we can discuss direction and scope.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Acknowledgments
|
|
250
|
+
|
|
251
|
+
InterpolatePy implements algorithms and mathematical concepts primarily from the following authoritative textbooks:
|
|
252
|
+
|
|
253
|
+
* **Biagiotti, L., & Melchiorri, C.** (2008). *Trajectory Planning for Automatic Machines and Robots*. Springer.
|
|
254
|
+
* **Siciliano, B., Sciavicco, L., Villani, L., & Oriolo, G.** (2010). *Robotics: Modelling, Planning and Control*. Springer.
|
|
255
|
+
|
|
256
|
+
The library's implementation draws heavily from the theoretical frameworks, mathematical formulations, and algorithms presented in these works.
|
|
257
|
+
|
|
258
|
+
I express my gratitude to these authors for their significant contributions to the field of trajectory planning and robotics, which have made this library possible.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
InterpolatePy is released under the MIT License – do whatever you want, but please give credit.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Citation
|
|
269
|
+
|
|
270
|
+
If InterpolatePy contributes to your academic work, consider citing it:
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
@misc{InterpolatePy,
|
|
274
|
+
author = {Giorgio Medico},
|
|
275
|
+
title = {InterpolatePy: Trajectory and Spline Library},
|
|
276
|
+
year = {2025},
|
|
277
|
+
howpublished = {\url{https://github.com/GiorgioMedico/InterpolatePy}}
|
|
278
|
+
}
|
|
279
|
+
```
|