ikpy 3.3.4__tar.gz → 3.4.2__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.
- {ikpy-3.3.4/src/ikpy.egg-info → ikpy-3.4.2}/PKG-INFO +7 -9
- {ikpy-3.3.4 → ikpy-3.4.2}/README.md +6 -8
- ikpy-3.4.2/src/ikpy/_version.py +1 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/inverse_kinematics.py +3 -3
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/link.py +11 -3
- {ikpy-3.3.4 → ikpy-3.4.2/src/ikpy.egg-info}/PKG-INFO +7 -9
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy.egg-info/SOURCES.txt +1 -0
- ikpy-3.4.2/tests/test_chain_dh.py +55 -0
- ikpy-3.3.4/src/ikpy/_version.py +0 -1
- {ikpy-3.3.4 → ikpy-3.4.2}/LICENSE +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/pyproject.toml +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/setup.cfg +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/__init__.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/chain.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/logs.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/urdf/URDF.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/urdf/__init__.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/urdf/utils.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/utils/__init__.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/utils/geometry.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy/utils/plot.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy.egg-info/dependency_links.txt +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy.egg-info/requires.txt +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/src/ikpy.egg-info/top_level.txt +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/tests/test_chain.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/tests/test_orientation.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/tests/test_poppy_robots.py +0 -0
- {ikpy-3.3.4 → ikpy-3.4.2}/tests/test_urdf.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ikpy
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.2
|
|
4
4
|
Summary: An inverse kinematics library aiming performance and modularity
|
|
5
5
|
Home-page: https://github.com/Phylliade/ikpy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -111,16 +111,14 @@ Contributions are welcome: if you have an awesome patented \(but also open-sourc
|
|
|
111
111
|
If you use IKPy as part of a publication, please use the Bibtex below as a citation:
|
|
112
112
|
|
|
113
113
|
```bibtex
|
|
114
|
-
@software{
|
|
114
|
+
@software{manceron_2024_13256291,
|
|
115
115
|
author = {Manceron, Pierre},
|
|
116
116
|
title = {IKPy},
|
|
117
|
-
month =
|
|
118
|
-
year =
|
|
119
|
-
note = {{If you use this software, please cite it using the
|
|
120
|
-
metadata from this file.}},
|
|
117
|
+
month = aug,
|
|
118
|
+
year = 2024,
|
|
121
119
|
publisher = {Zenodo},
|
|
122
|
-
version = {v3.
|
|
123
|
-
doi = {10.5281/zenodo.
|
|
124
|
-
url = {https://doi.org/10.5281/zenodo.
|
|
120
|
+
version = {v3.4},
|
|
121
|
+
doi = {10.5281/zenodo.13256291},
|
|
122
|
+
url = {https://doi.org/10.5281/zenodo.13256291}
|
|
125
123
|
}
|
|
126
124
|
```
|
|
@@ -100,16 +100,14 @@ Contributions are welcome: if you have an awesome patented \(but also open-sourc
|
|
|
100
100
|
If you use IKPy as part of a publication, please use the Bibtex below as a citation:
|
|
101
101
|
|
|
102
102
|
```bibtex
|
|
103
|
-
@software{
|
|
103
|
+
@software{manceron_2024_13256291,
|
|
104
104
|
author = {Manceron, Pierre},
|
|
105
105
|
title = {IKPy},
|
|
106
|
-
month =
|
|
107
|
-
year =
|
|
108
|
-
note = {{If you use this software, please cite it using the
|
|
109
|
-
metadata from this file.}},
|
|
106
|
+
month = aug,
|
|
107
|
+
year = 2024,
|
|
110
108
|
publisher = {Zenodo},
|
|
111
|
-
version = {v3.
|
|
112
|
-
doi = {10.5281/zenodo.
|
|
113
|
-
url = {https://doi.org/10.5281/zenodo.
|
|
109
|
+
version = {v3.4},
|
|
110
|
+
doi = {10.5281/zenodo.13256291},
|
|
111
|
+
url = {https://doi.org/10.5281/zenodo.13256291}
|
|
114
112
|
}
|
|
115
113
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '3.4.2'
|
|
@@ -34,8 +34,8 @@ def inverse_kinematic_optimization(chain, target_frame, starting_nodes_angles, r
|
|
|
34
34
|
Do not optimize against position
|
|
35
35
|
optimizer: str
|
|
36
36
|
The optimizer to use. Choices:
|
|
37
|
-
* "least_squares": Use scipy.optimize.least_squares
|
|
38
|
-
* "scalar": Use scipy.optimize.minimize
|
|
37
|
+
* "least_squares": Use scipy.optimize.least_squares (the default)
|
|
38
|
+
* "scalar": Use scipy.optimize.minimize (the default prior to IKPy 3.3)
|
|
39
39
|
"""
|
|
40
40
|
if optimizer not in ["least_squares", "scalar"]:
|
|
41
41
|
raise ValueError("Unknown solver: {}".format(optimizer))
|
|
@@ -53,7 +53,7 @@ def inverse_kinematic_optimization(chain, target_frame, starting_nodes_angles, r
|
|
|
53
53
|
|
|
54
54
|
# Compute error to target
|
|
55
55
|
def optimize_target_function(fk):
|
|
56
|
-
target_error = fk[:3, -1] - target
|
|
56
|
+
target_error = (fk[:3, -1] - target)
|
|
57
57
|
|
|
58
58
|
# We need to return the fk, it will be used in a later function
|
|
59
59
|
# This way, we don't have to recompute it
|
|
@@ -40,6 +40,7 @@ class Link:
|
|
|
40
40
|
self.axis_length = length
|
|
41
41
|
self.is_final = is_final
|
|
42
42
|
self.has_rotation = False
|
|
43
|
+
self.has_translation = False
|
|
43
44
|
self.joint_type = None
|
|
44
45
|
|
|
45
46
|
def __repr__(self):
|
|
@@ -267,7 +268,12 @@ class DHLink(Link):
|
|
|
267
268
|
d: float
|
|
268
269
|
offset along previous z to the common normal
|
|
269
270
|
a: float
|
|
270
|
-
|
|
271
|
+
length of the common normal (do not confuse with alpha)
|
|
272
|
+
Assuming a revolute joint, this is the radius about previous z
|
|
273
|
+
alpha: float
|
|
274
|
+
angle about common normal, from old z axis to new z axis
|
|
275
|
+
theta: float
|
|
276
|
+
angle about previous z, from old x to new x
|
|
271
277
|
use_symbolic_matrix: bool
|
|
272
278
|
whether the transformation matrix is stored as Numpy array or as a Sympy symbolic matrix.
|
|
273
279
|
|
|
@@ -277,10 +283,12 @@ class DHLink(Link):
|
|
|
277
283
|
The link object
|
|
278
284
|
"""
|
|
279
285
|
|
|
280
|
-
def __init__(self, name, d=0, a=0, bounds=None, use_symbolic_matrix=True):
|
|
281
|
-
Link.__init__(self, use_symbolic_matrix)
|
|
286
|
+
def __init__(self, name=None, d=0, a=0, alpha=0, theta=0, bounds=None, use_symbolic_matrix=True, length=0):
|
|
287
|
+
Link.__init__(self, use_symbolic_matrix, length=length)
|
|
282
288
|
self.d = d
|
|
283
289
|
self.a = a
|
|
290
|
+
self.alpha = alpha
|
|
291
|
+
self.theta = theta
|
|
284
292
|
|
|
285
293
|
def get_link_frame_matrix(self, parameters):
|
|
286
294
|
""" Computes the homogeneous transformation matrix for this link. """
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ikpy
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.2
|
|
4
4
|
Summary: An inverse kinematics library aiming performance and modularity
|
|
5
5
|
Home-page: https://github.com/Phylliade/ikpy
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -111,16 +111,14 @@ Contributions are welcome: if you have an awesome patented \(but also open-sourc
|
|
|
111
111
|
If you use IKPy as part of a publication, please use the Bibtex below as a citation:
|
|
112
112
|
|
|
113
113
|
```bibtex
|
|
114
|
-
@software{
|
|
114
|
+
@software{manceron_2024_13256291,
|
|
115
115
|
author = {Manceron, Pierre},
|
|
116
116
|
title = {IKPy},
|
|
117
|
-
month =
|
|
118
|
-
year =
|
|
119
|
-
note = {{If you use this software, please cite it using the
|
|
120
|
-
metadata from this file.}},
|
|
117
|
+
month = aug,
|
|
118
|
+
year = 2024,
|
|
121
119
|
publisher = {Zenodo},
|
|
122
|
-
version = {v3.
|
|
123
|
-
doi = {10.5281/zenodo.
|
|
124
|
-
url = {https://doi.org/10.5281/zenodo.
|
|
120
|
+
version = {v3.4},
|
|
121
|
+
doi = {10.5281/zenodo.13256291},
|
|
122
|
+
url = {https://doi.org/10.5281/zenodo.13256291}
|
|
125
123
|
}
|
|
126
124
|
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from ikpy.chain import Chain
|
|
2
|
+
from ikpy.link import OriginLink, DHLink
|
|
3
|
+
from ikpy.utils import plot
|
|
4
|
+
|
|
5
|
+
import matplotlib.pyplot as plt
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
from math import pi
|
|
9
|
+
|
|
10
|
+
class UR10():
|
|
11
|
+
def __init__(self):
|
|
12
|
+
self.robot_name = 'UR10'
|
|
13
|
+
self.home_config = [0, -pi/2, 0, -pi/2, 0, 0]
|
|
14
|
+
self.dh_params = np.array([
|
|
15
|
+
[ 0.1273, 0., pi/2, 0.],
|
|
16
|
+
[ 0., -0.612, 0, 0.],
|
|
17
|
+
[ 0., -0.5723, 0, 0.],
|
|
18
|
+
[ 0.163941, 0., pi/2, 0.],
|
|
19
|
+
[ 0.1147, 0., -pi/2, 0.],
|
|
20
|
+
[ 0.0922, 0., 0, 0.]])
|
|
21
|
+
|
|
22
|
+
self.joint_limits = [
|
|
23
|
+
(-360, 360),
|
|
24
|
+
(-360, 360),
|
|
25
|
+
(-360, 360),
|
|
26
|
+
(-360, 360),
|
|
27
|
+
(-360, 360),
|
|
28
|
+
(-360, 360)]
|
|
29
|
+
|
|
30
|
+
def create_dh_robot(robot):
|
|
31
|
+
# Create a list of links for the robot
|
|
32
|
+
links = []
|
|
33
|
+
for i, dh in enumerate(robot.dh_params):
|
|
34
|
+
link = DHLink(d=dh[0], a=dh[1], alpha=dh[2], theta=dh[3], length=abs(dh[1]))
|
|
35
|
+
link.bounds = robot.joint_limits[i]
|
|
36
|
+
links.append(link)
|
|
37
|
+
|
|
38
|
+
# Create a chain using the robot links
|
|
39
|
+
chain = Chain(links, name=robot.robot_name)
|
|
40
|
+
return chain
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_dh_chain():
|
|
44
|
+
robot = UR10()
|
|
45
|
+
chain = create_dh_robot(robot)
|
|
46
|
+
frame = [[1.112918581, -0.209413742, 0.19382176], [0.0, 1.0, 0.0]]
|
|
47
|
+
target_position, target_orientation = frame
|
|
48
|
+
joint_angles = chain.inverse_kinematics(target_position=target_position, target_orientation=target_orientation, orientation_mode="Z")
|
|
49
|
+
|
|
50
|
+
print(joint_angles)
|
|
51
|
+
|
|
52
|
+
fig, ax = plot.init_3d_figure()
|
|
53
|
+
chain.plot(robot.home_config, ax)
|
|
54
|
+
chain.plot(joint_angles, ax)
|
|
55
|
+
plt.savefig("out/UR10.png")
|
ikpy-3.3.4/src/ikpy/_version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '3.3.4'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|