rational-linkages 1.2.dev1__py3-none-any.whl → 1.2.dev2__py3-none-any.whl

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.

Potentially problematic release.


This version of rational-linkages might be problematic. Click here for more details.

@@ -0,0 +1,123 @@
1
+ from rational_linkages import RationalMechanism
2
+ import numpy as np
3
+
4
+
5
+ class ExudynAnalysis:
6
+ """
7
+ Class for dynamics analysis using Exudyn package.
8
+ """
9
+ def __init__(self, gravity: np.ndarray = np.array([0, 0, -9.81])):
10
+ """
11
+ Initialize ExudynAnalysis object.
12
+
13
+ :param list gravity: XYZ gravity vector
14
+ """
15
+ self.gravity = gravity
16
+
17
+ def get_exudyn_params(self, mechanism: RationalMechanism):
18
+ """
19
+ Get parameters for Exudyn simulation.
20
+
21
+ This method is used to get parameters for Exudyn -
22
+ """
23
+ # get positions of links connection points
24
+ links_pts = self._links_points(mechanism)
25
+
26
+ # get joint axes
27
+ joint_axes = self._joints_axes(mechanism)
28
+
29
+ # get links lengths
30
+ links_lengths = self._links_lengths(links_pts)
31
+
32
+ # get links center of gravity positions
33
+ links_masses_pts = self._links_center_of_gravity(links_pts)
34
+
35
+ # body dimensions
36
+ body_dim = [[l, 0.06, 0.06] for l in links_lengths] # TODO width
37
+
38
+ # relative link points
39
+ relative_links_pts = self._relative_links_points(links_pts, links_masses_pts)
40
+
41
+ return (links_pts, links_lengths, body_dim, links_masses_pts,
42
+ joint_axes, relative_links_pts)
43
+
44
+ @staticmethod
45
+ def _links_points(mechanism: RationalMechanism) -> list:
46
+ """
47
+ Get links connection points in default configuration.
48
+
49
+ :param mechanism: RationalMechanism object
50
+
51
+ :return: list of points on links
52
+ :rtype: list
53
+ """
54
+ # get points sequence
55
+ t = .0000000000000000000000001
56
+ points = (mechanism.factorizations[0].direct_kinematics(t, inverted_part=True)
57
+ + mechanism.factorizations[1].direct_kinematics(t, inverted_part=True)[::-1])
58
+
59
+ # rearamge points, so the base link has the first 2 points
60
+ points = points[-1:] + points[:-1]
61
+
62
+ return list(zip(points[::2], points[1::2]))
63
+
64
+ @staticmethod
65
+ def _relative_links_points(links_points: list, centers_of_gravity: list) -> list:
66
+ """
67
+ Get links connection points in default configuration, relative to its center of gravity.
68
+
69
+ :param list links_points: list of point pairs tuples
70
+ :param list centers_of_gravity: list of links' center of gravity positions
71
+
72
+ :return: list of points on links
73
+ :rtype: list
74
+ """
75
+ return [(pts[0] - cog, pts[1] - cog)
76
+ for pts, cog in zip(links_points, centers_of_gravity)]
77
+
78
+ @staticmethod
79
+ def _links_lengths(links_points: list) -> list:
80
+ """
81
+ Get links lengths.
82
+
83
+ :param list links_points: list of point pairs tuples
84
+
85
+ :return: list of links lengths
86
+ :rtype: list
87
+ """
88
+ return [np.linalg.norm(pts[1] - pts[0]) for pts in links_points]
89
+
90
+ @staticmethod
91
+ def _links_center_of_gravity(links_points: list) -> list:
92
+ """
93
+ Get positions of links' center of gravity.
94
+
95
+ :param list links_points: list of point pairs tuples
96
+
97
+ :return: list of links' center of gravity positions
98
+ :rtype: list
99
+ """
100
+ return [(pts[0] + pts[1]) / 2 for pts in links_points]
101
+
102
+ @staticmethod
103
+ def _joints_axes(mechanism: RationalMechanism) -> list:
104
+ """
105
+ Get joints unit axes.
106
+
107
+ :param RationalMechanism mechanism: RationalMechanism object
108
+
109
+ :return: list of joints axes
110
+ :rtype: list
111
+ """
112
+ axes = []
113
+ for axis in mechanism.factorizations[0].dq_axes:
114
+ direction, moment = axis.dq2line()
115
+ axes.append(direction)
116
+
117
+ axes_branch2 = []
118
+ for axis in mechanism.factorizations[1].dq_axes:
119
+ direction, moment = axis.dq2line()
120
+ axes_branch2.append(direction)
121
+
122
+ return axes + axes_branch2[::-1]
123
+
@@ -1,6 +1,7 @@
1
1
  from .DualQuaternion import DualQuaternion
2
2
  from .DualQuaternionAction import DualQuaternionAction
3
3
  from .RationalCurve import RationalCurve
4
+ from .ExudynAnalysis import ExudynAnalysis
4
5
  from .FactorizationProvider import FactorizationProvider
5
6
  from .Linkage import Linkage, PointsConnection, LineSegment
6
7
  from .MiniBall import MiniBall
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rational-linkages
3
- Version: 1.2.dev1
3
+ Version: 1.2.dev2
4
4
  Summary: Rational Linkages Toolbox
5
5
  Author-email: Daniel Huczala <daniel.huczala@uibk.ac.at>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -690,8 +690,9 @@ License-File: LICENSE
690
690
  Requires-Dist: scipy >=1.7.0
691
691
  Requires-Dist: sympy >=1.8.0
692
692
  Requires-Dist: matplotlib >=3.4.0
693
- Requires-Dist: biquaternion-py >=1.1.0
693
+ Requires-Dist: biquaternion-py >=1.2.0
694
694
  Requires-Dist: PyQt5 >=5.15.10
695
+ Requires-Dist: exudyn >=1.7.0
695
696
  Provides-Extra: dev
696
697
  Requires-Dist: coverage ; extra == 'dev'
697
698
  Requires-Dist: pytest ; extra == 'dev'
@@ -706,8 +707,8 @@ Requires-Dist: toml ; extra == 'doc'
706
707
 
707
708
  [![build](https://git.uibk.ac.at/geometrie-vermessung/rational-linkages/badges/main/pipeline.svg)](https://git.uibk.ac.at/geometrie-vermessung/rational-linkages/-/jobs)
708
709
  [![coverage](https://git.uibk.ac.at/geometrie-vermessung/rational-linkages/badges/main/coverage.svg?job=run_tests)](https://git.uibk.ac.at/geometrie-vermessung/rational-linkages/-/jobs)
709
- [![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)]()
710
710
  [![Documentation Status](https://readthedocs.org/projects/rational-linkages/badge/?version=latest)](https://rational-linkages.readthedocs.io/?badge=latest)
711
+ [![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)]()
711
712
  [![PyPI version](https://badge.fury.io/py/rational-linkages.svg)](https://pypi.org/project/rational-linkages/)
712
713
 
713
714
  # Rational Linkages
@@ -718,8 +719,9 @@ documentation is hosted on Read the Docs, available here:
718
719
 
719
720
  ## Intallation instuctions
720
721
 
721
- Recommended Python version is **3.11** (3.10 or higher are supported), when it provides
722
- the smoothest plotting. It is also the version used for development.
722
+ Recommended Python version is **3.11**, when it provides the smoothest plotting
723
+ (but 3.10 or higher are supported). Python 3.11 is also the version used for
724
+ development.
723
725
 
724
726
  ### Install from PyPI
725
727
 
@@ -744,3 +746,13 @@ Using pip:
744
746
  ## Usage
745
747
 
746
748
  See the [documentation examples](https://rational-linkages.readthedocs.io/) for more details.
749
+
750
+
751
+ ## Acknowledgements
752
+
753
+ Funded by the European Union. Views and opinions expressed are however those of
754
+ the author(s) only and do not necessarily reflect those of the European Union
755
+ or the European Research Executive Agency (REA). Neither the European Union
756
+ nor the granting authority can be held responsible for them.
757
+
758
+ <img src="./docs/source/figures/eu.png" width="250" />
@@ -3,6 +3,7 @@ rational_linkages/AffineMetric.py,sha256=6Z1KP1W6uXwlRToofcu-nXlygn_EJ_zmLoT_0nE
3
3
  rational_linkages/ButtonID.py,sha256=wOmSGNFHkLrt8Hh5Pl8j1eqpNsYnH8GWcXLDz4g-WEY,1128
4
4
  rational_linkages/DualQuaternion.py,sha256=949za5fuBok0soJpWMDBKz4MYj4CLUnDJXzbc-ftvcU,16499
5
5
  rational_linkages/DualQuaternionAction.py,sha256=93kPn3Buuj7Wno6Cl312cGOqiMW5-oHzUvfvzMMptxw,4133
6
+ rational_linkages/ExudynAnalysis.py,sha256=mhTXzumFwsxp65VdeSXh-6wxTi5ubX6znJgfX554PYI,3975
6
7
  rational_linkages/FactorizationProvider.py,sha256=umQUrv3YQS8gzDlj3y93X5PtKSLR6kn3C4FQDsRFli8,5931
7
8
  rational_linkages/Linkage.py,sha256=-GpnnAhiQ3EbysaTtRwrKXpuM_DuxSEsKQAB8gfy0IY,8488
8
9
  rational_linkages/MiniBall.py,sha256=UZlSxiSEzj-JXb4p1aq7mlDUv_o70NfGhj6HQ50Ca3E,4171
@@ -18,11 +19,11 @@ rational_linkages/RationalCurve.py,sha256=mp6BN8fB181zPGFM1lqrvDrWlHiNoH6kORBzCC
18
19
  rational_linkages/RationalDualQuaternion.py,sha256=_g87ZCk6Z4mN1_IKBqbR-N0-GWQ7xSrnPXZb7dxkj1M,1487
19
20
  rational_linkages/RationalMechanism.py,sha256=_lvHIqY97c5LBdmBVxdrylqWtfNqxl_aLBzrnqA06B8,27251
20
21
  rational_linkages/TransfMatrix.py,sha256=MOggM2qqDWS6MM40cRnz6dHT6f06WUsKIKsEpa-K7kE,13798
21
- rational_linkages/__init__.py,sha256=oUf94qF8ydm1amrz0aQCG0UEMkzg7WhAUplZb6Zup6Q,753
22
+ rational_linkages/__init__.py,sha256=QMIjaftOVbz4s4KRUl8zUheiPAYIxCGciGCZFx9kPS0,797
22
23
  rational_linkages/models.py,sha256=N3Pk6Nz2BhI4M90FwcLiFL5gGueaKGWHeMZNyywaia4,774
23
24
  rational_linkages/data/bennett_ark24.pkl,sha256=uH0oHezZeleNvXW5JeSEc3cAhi15EWFdhvyEDtjwnz4,40058
24
- rational_linkages-1.2.dev1.dist-info/LICENSE,sha256=SrpxAZ1vJi81S4VF9EBjgxz9qrVj9acCyQPSAk3JgOo,35784
25
- rational_linkages-1.2.dev1.dist-info/METADATA,sha256=9T5vpjO1DZUDIfCGTKCwLwNMtxku-7CoBSASys9J3Pw,44232
26
- rational_linkages-1.2.dev1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
27
- rational_linkages-1.2.dev1.dist-info/top_level.txt,sha256=IxRIuCa6RJFZKK15jamktxgS0abg1PV2WqXo1Z-MalI,18
28
- rational_linkages-1.2.dev1.dist-info/RECORD,,
25
+ rational_linkages-1.2.dev2.dist-info/LICENSE,sha256=SrpxAZ1vJi81S4VF9EBjgxz9qrVj9acCyQPSAk3JgOo,35784
26
+ rational_linkages-1.2.dev2.dist-info/METADATA,sha256=YReQUerHfHtZd7aS7vovfUBIIuOz2-k6mZx2EKiMtO0,44665
27
+ rational_linkages-1.2.dev2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
28
+ rational_linkages-1.2.dev2.dist-info/top_level.txt,sha256=IxRIuCa6RJFZKK15jamktxgS0abg1PV2WqXo1Z-MalI,18
29
+ rational_linkages-1.2.dev2.dist-info/RECORD,,