dartpy 0.1.0.post110__cp312-cp312-manylinux_2_28_x86_64.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 dartpy might be problematic. Click here for more details.

Files changed (66) hide show
  1. dartpy-0.1.0.post110.dist-info/LICENSE +31 -0
  2. dartpy-0.1.0.post110.dist-info/METADATA +47 -0
  3. dartpy-0.1.0.post110.dist-info/RECORD +66 -0
  4. dartpy-0.1.0.post110.dist-info/WHEEL +5 -0
  5. dartpy-0.1.0.post110.dist-info/top_level.txt +2 -0
  6. dartpy.cpython-312-x86_64-linux-gnu.so +0 -0
  7. dartpy.libs/libGLU-ff1477cc.so.1.3.1 +0 -0
  8. dartpy.libs/libOpenThreads-0250ab5c.so.3.3.1 +0 -0
  9. dartpy.libs/libXi-9178a6bd.so.6.1.0 +0 -0
  10. dartpy.libs/libXxf86vm-8446c95f.so.1.0.0 +0 -0
  11. dartpy.libs/libassimp-79671a85.so.5.2.4 +0 -0
  12. dartpy.libs/libccd-f7023733.so.2.0 +0 -0
  13. dartpy.libs/libconsole_bridge-757d7af3.so.1.0 +0 -0
  14. dartpy.libs/libfcl-fafce69a.so.0.7.0 +0 -0
  15. dartpy.libs/libglut-0c8fd390.so.3.10.0 +0 -0
  16. dartpy.libs/liboctomap-0c5b15c6.so.1.9.6 +0 -0
  17. dartpy.libs/liboctomath-31ce0045.so.1.9.6 +0 -0
  18. dartpy.libs/libosg-b45f9cbc.so.3.7.0 +0 -0
  19. dartpy.libs/libosgDB-209e5143.so.3.7.0 +0 -0
  20. dartpy.libs/libosgGA-260d5c6e.so.3.7.0 +0 -0
  21. dartpy.libs/libosgManipulator-05bcdf02.so.3.7.0 +0 -0
  22. dartpy.libs/libosgShadow-9971a879.so.3.7.0 +0 -0
  23. dartpy.libs/libosgText-16341674.so.3.7.0 +0 -0
  24. dartpy.libs/libosgUtil-e5d05863.so.3.7.0 +0 -0
  25. dartpy.libs/libosgViewer-7dd0f485.so.3.7.0 +0 -0
  26. dartpy.libs/libtinyxml-296537c6.so +0 -0
  27. dartpy.libs/liburdfdom_model-6cad1cb6.so.3.0 +0 -0
  28. dartpy.libs/liburdfdom_model_state-36524f5e.so.3.0 +0 -0
  29. dartpy.libs/liburdfdom_sensor-ad2c126c.so.3.0 +0 -0
  30. dartpy.libs/liburdfdom_world-538ea8a8.so.3.0 +0 -0
  31. tests/__init__.py +0 -0
  32. tests/integration/__init__.py +0 -0
  33. tests/integration/test_joint_force_torque.py +305 -0
  34. tests/unit/__init__.py +0 -0
  35. tests/unit/collision/__init__.py +0 -0
  36. tests/unit/collision/test_collision.py +249 -0
  37. tests/unit/common/__init__.py +0 -0
  38. tests/unit/common/test_logging.py +20 -0
  39. tests/unit/common/test_stopwatch.py +50 -0
  40. tests/unit/common/test_string.py +42 -0
  41. tests/unit/common/test_uri.py +20 -0
  42. tests/unit/constraint/__init__.py +0 -0
  43. tests/unit/constraint/test_constraint.py +42 -0
  44. tests/unit/dynamics/__init__.py +0 -0
  45. tests/unit/dynamics/test_aspect.py +15 -0
  46. tests/unit/dynamics/test_body_node.py +65 -0
  47. tests/unit/dynamics/test_inertia.py +76 -0
  48. tests/unit/dynamics/test_inverse_kinematics.py +98 -0
  49. tests/unit/dynamics/test_joint.py +149 -0
  50. tests/unit/dynamics/test_meta_skeleton.py +41 -0
  51. tests/unit/dynamics/test_simple_frame.py +54 -0
  52. tests/unit/dynamics/test_skeleton.py +23 -0
  53. tests/unit/math/__init__.py +0 -0
  54. tests/unit/math/test_random.py +40 -0
  55. tests/unit/optimizer/__init__.py +0 -0
  56. tests/unit/optimizer/test_optimizer.py +93 -0
  57. tests/unit/simulation/__init__.py +0 -0
  58. tests/unit/simulation/test_world.py +45 -0
  59. tests/unit/utils/__init__.py +0 -0
  60. tests/unit/utils/test_dart_loader.py +72 -0
  61. tests/unit/utils/test_mjcf_parser.py +19 -0
  62. tests/unit/utils/test_sdf_parser.py +21 -0
  63. tests/unit/utils/test_skel_parser.py +22 -0
  64. tests/unit/v7/__init__.py +0 -0
  65. tests/unit/v7/test_import.py +11 -0
  66. tests/util.py +18 -0
@@ -0,0 +1,31 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2011-2016, Humanoid Lab, Georgia Tech Research Corporation
4
+ Copyright (c) 2016-2017, Personal Robotics Lab, Carnegie Mellon University
5
+ Copyright (c) 2011-2019, Graphics Lab, Georgia Tech Research Corporation
6
+ Copyright (c) 2017-2019, Personal Robotics Lab, University of Washington
7
+ Copyright (c) 2017-2019, Open Source Robotics Foundation
8
+ Copyright (c) 2019-2024, The Movement Lab, Stanford University
9
+ Copyright (c) 2019-2024, Jeongseok Lee
10
+ All rights reserved.
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions are met:
14
+
15
+ * Redistributions of source code must retain the above copyright notice, this
16
+ list of conditions and the following disclaimer.
17
+
18
+ * Redistributions in binary form must reproduce the above copyright notice,
19
+ this list of conditions and the following disclaimer in the documentation
20
+ and/or other materials provided with the distribution.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.1
2
+ Name: dartpy
3
+ Version: 0.1.0.post110
4
+ Summary: Python API of Dynamic Animation and Robotics Toolkit.
5
+ Home-page: https://github.com/dartsim/dart.git
6
+ Author: Jeongseok Lee
7
+ Author-email: jslee02@gmail.com
8
+ License: BSD 2-Clause
9
+ Keywords: dartsim robotics
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Framework :: Robot Framework
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: BSD License
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Requires-Python: >=3.7
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest >=6.0 ; extra == 'test'
24
+
25
+ # DART
26
+
27
+ <br>
28
+ <p align="center">
29
+ <img src="https://raw.githubusercontent.com/dartsim/dart/master/docs/dart_logo_377x107.jpg" alt="DART: Dynamic Animation and Robotics Toolkit">
30
+ </p>
31
+
32
+ ## Documentation
33
+
34
+ For more information on DART, please visit the DART documentation: [English](https://dart.readthedocs.io/) | [한국어](https://dart-ko.readthedocs.io/) (WIP)
35
+
36
+ ## Project Status
37
+
38
+ | Item | Status |
39
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | Build | [![CI Ubuntu](https://github.com/dartsim/dart/actions/workflows/ci_ubuntu.yml/badge.svg)](https://github.com/dartsim/dart/actions/workflows/ci_ubuntu.yml) [![CI macOS](https://github.com/dartsim/dart/actions/workflows/ci_macos.yml/badge.svg)](https://github.com/dartsim/dart/actions/workflows/ci_macos.yml) [![CI Windows](https://github.com/dartsim/dart/actions/workflows/ci_windows.yml/badge.svg)](https://github.com/dartsim/dart/actions/workflows/ci_windows.yml) |
41
+ | Doc, Coverage, Linter | [![API Documentation](https://github.com/dartsim/dart/actions/workflows/api_doc.yml/badge.svg)](https://github.com/dartsim/dart/actions/workflows/api_doc.yml) [![Documentation Status](https://readthedocs.org/projects/dart/badge/?version=latest)](https://dart.readthedocs.io/en/latest/?badge=latest) [![codecov](https://codecov.io/gh/dartsim/dart/branch/main/graph/badge.svg)](https://codecov.io/gh/dartsim/dart) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2d95a9b951be4b73a71097670ec351e8)](https://www.codacy.com/gh/dartsim/dart/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dartsim/dart&amp;utm_campaign=Badge_Grade) |
42
+ | Packages | [![Packaging status](https://repology.org/badge/vertical-allrepos/dartsim.svg)](https://repology.org/project/dartsim/versions) [![Publish dartpy](https://github.com/dartsim/dart/actions/workflows/publish_dartpy.yml/badge.svg)](https://github.com/dartsim/dart/actions/workflows/publish_dartpy.yml) |
43
+ | Maintenance | [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/dartsim/dart.svg)](http://isitmaintained.com/project/dartsim/dart "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/dartsim/dart.svg)](http://isitmaintained.com/project/dartsim/dart "Percentage of issues still open") |
44
+
45
+ ## Citation
46
+
47
+ If you use DART in an academic publication, please consider citing this [JOSS Paper](https://doi.org/10.21105/joss.00500) [[BibTeX](https://gist.github.com/jslee02/998b8809e3ae1b7aef6ef04dd2ad5e27)]
@@ -0,0 +1,66 @@
1
+ dartpy.cpython-312-x86_64-linux-gnu.so,sha256=F8Pig9KJOUk7w1BkSdhhT8RSOlKdixOEoQ4yEfBvt7o,16570641
2
+ dartpy-0.1.0.post110.dist-info/RECORD,,
3
+ dartpy-0.1.0.post110.dist-info/METADATA,sha256=fq7vLVC-MVsOpJ6eYNdKZ0lY6u3JkVe6AAw_UBGUnPs,5564
4
+ dartpy-0.1.0.post110.dist-info/WHEEL,sha256=h5hc8tISCKpr_xclAfLoW0tDQH0gc8b3woxL8pJ9CGY,114
5
+ dartpy-0.1.0.post110.dist-info/top_level.txt,sha256=uS54APWVBb-a3RHZ0OUaZMgYA3_YFTZ-6m_1uYJFlls,18
6
+ dartpy-0.1.0.post110.dist-info/LICENSE,sha256=hKSrksb2aZRZJ3O0hWFxBHMazgm3e-PEgZmxPv6ayGc,1740
7
+ dartpy.libs/libosgManipulator-05bcdf02.so.3.7.0,sha256=rQDEBMIsO3eggfySvxXxtsIk-CM18quEmZSlIBERPZg,521577
8
+ dartpy.libs/libosgUtil-e5d05863.so.3.7.0,sha256=evkG_DHAQCGoYYXfSaFp-FYBqI0t7Qenf0TOtlFvu5E,3017121
9
+ dartpy.libs/libOpenThreads-0250ab5c.so.3.3.1,sha256=pt_vdKguGwcrgpaDNDihIbPDS3uwyWyS61XpR2UXdTQ,55809
10
+ dartpy.libs/libGLU-ff1477cc.so.1.3.1,sha256=BGOW9YiNDomfWCJJH2rKOuL4T6HRsibrN3JsfbJdZbc,506529
11
+ dartpy.libs/libconsole_bridge-757d7af3.so.1.0,sha256=9rlEqyFAwYCFhtriMsQANjwAvXdC9ru5Eey8eGcf6zY,31137
12
+ dartpy.libs/liburdfdom_world-538ea8a8.so.3.0,sha256=QPXrPjnfzuoRHRjt3MBNrHqjB_trJwk8y77xg-M7_Fs,241937
13
+ dartpy.libs/liburdfdom_sensor-ad2c126c.so.3.0,sha256=pN-D6GRp55Q0fuiLMaYn9zHvSrIxnG1gbcOTioONtHM,59961
14
+ dartpy.libs/libosgGA-260d5c6e.so.3.7.0,sha256=T2kpPaRGUNOYNWS579LJpVLKkEYDFeD1NvSBM72BwiQ,1243873
15
+ dartpy.libs/liboctomap-0c5b15c6.so.1.9.6,sha256=LZowcDdR9uoWG2wYZ3xvt2FFc3v0U5s3K9dCGC37doU,572049
16
+ dartpy.libs/libosgText-16341674.so.3.7.0,sha256=RvKSdmrT1zpsm2QKtSaNvH_1z1zVyEbd8aQRlzZHHpk,658977
17
+ dartpy.libs/libfcl-fafce69a.so.0.7.0,sha256=khxwqeMFq0ulwGL5SYvTX2t2adC8AQLEaIvfqUqtWFI,14868145
18
+ dartpy.libs/liburdfdom_model_state-36524f5e.so.3.0,sha256=XPQ478EHwaeUcMrWryxc8UfWYMvIOzs1eUNIUkMvEh0,67073
19
+ dartpy.libs/libglut-0c8fd390.so.3.10.0,sha256=k0ZdG5oCioGM7ZtBYE2Mt_ecYloHgNaJ7q3VaGS5PRs,389841
20
+ dartpy.libs/liburdfdom_model-6cad1cb6.so.3.0,sha256=R81-5ZSETzIjwlMJlHpBgZgebx3ngsZPCR8r_iGSBHg,241937
21
+ dartpy.libs/libassimp-79671a85.so.5.2.4,sha256=xkeXmtCqzNlE2X7hrzr6HY4xKCihC2q-no9RMdHU-IE,13416305
22
+ dartpy.libs/libosgDB-209e5143.so.3.7.0,sha256=75AHfgdSWUZt3k9-1HfkZ2fNtqXC0mjYbHKnYLJ1t8A,2248393
23
+ dartpy.libs/libosgShadow-9971a879.so.3.7.0,sha256=71vKmiaAjp_t8UgjNUpHmsnA1lQ_dqP9GLZqG8Gt1ys,934441
24
+ dartpy.libs/libosgViewer-7dd0f485.so.3.7.0,sha256=QkqacBKGz1zOg2Ac9kmso4_Nh9zvMsfeLRAwfp6qp4M,1778697
25
+ dartpy.libs/libXi-9178a6bd.so.6.1.0,sha256=d7hu2oSLjfb-sHACSGBU4z13CnBF0RP11fwKXIw6qdY,76633
26
+ dartpy.libs/libXxf86vm-8446c95f.so.1.0.0,sha256=qLhK_XFE5RAwCLqEmtHH3Y_-5PjYy9H2Ihvm3fTSJE4,25777
27
+ dartpy.libs/liboctomath-31ce0045.so.1.9.6,sha256=ZrS9-FFmG4KQGWpTXgsC4TPuHRV6IDQAIzyCylJJJ2M,44305
28
+ dartpy.libs/libccd-f7023733.so.2.0,sha256=QVj_ePIfofbUYXIr79YN67HeKSisWI-Ibpbjwqgyc1o,45849
29
+ dartpy.libs/libosg-b45f9cbc.so.3.7.0,sha256=XiYmOIHo31tdLf8YcEWSK8I_yOh1EKrC_OcGVONOX1c,5491121
30
+ dartpy.libs/libtinyxml-296537c6.so,sha256=IfTi_e3ZujzdIq_l_jFOHmJipmHrh_GJq8xLHomYtlY,131961
31
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ tests/util.py,sha256=Yy24PPwQfjBe-qsWxA8FApawuWHDpKKPGJD1eAzUAJo,472
33
+ tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
+ tests/integration/test_joint_force_torque.py,sha256=7taMgLk2d1rdGZhYw7G2OZK822TuxylKzrI5rF4MYqc,10246
35
+ tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ tests/unit/constraint/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ tests/unit/constraint/test_constraint.py,sha256=-CTSY8Aeyhwxvqnw3GtroUt6_RYfwgD7v_cU0ZeQZtA,1361
38
+ tests/unit/math/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
+ tests/unit/math/test_random.py,sha256=yTeg06GwJLkHX9-Gyj4_GhTwlco2_po3JZXRPzc_QPY,788
40
+ tests/unit/v7/test_import.py,sha256=4zXjJxuh72QJ5S-83mEf4yr4eDC3aYcFHGtKrcZez_0,143
41
+ tests/unit/v7/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
+ tests/unit/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ tests/unit/common/test_uri.py,sha256=eZJZj8MQplyTogNAsZJwBkb9mrjnuvLz0BLxD_UvVrw,745
44
+ tests/unit/common/test_string.py,sha256=CZyXL9okHilJHDk9T0oISytXOu0uG5izoBHFHmLe8ro,1520
45
+ tests/unit/common/test_stopwatch.py,sha256=QVUK7BHPHbatPQU0b_LRowFRAmtyzC84ld_Nv80YS9c,1230
46
+ tests/unit/common/test_logging.py,sha256=Fggqt5BI1CW2zmcZ_4pbwgZ73gmuuToFZaJ7-gU-gac,415
47
+ tests/unit/dynamics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ tests/unit/dynamics/test_aspect.py,sha256=IUTexMqGy_3qxrJGUteGXLmKsU4I2tRuuI-AYu34j90,380
49
+ tests/unit/dynamics/test_meta_skeleton.py,sha256=zua6y3ZPF-eBIYDiYWt9_Aj4xgMdbhXYZX8CWbe11FM,1066
50
+ tests/unit/dynamics/test_joint.py,sha256=8S5ujxUVvuIjiAa4iNPGBOg4aNBvyGnPLR4Uewuvp1A,4439
51
+ tests/unit/dynamics/test_inertia.py,sha256=SdAT2KNQ3fW27x8pgq13T9dXyQIcZ1CEvH8b1A55acg,2202
52
+ tests/unit/dynamics/test_skeleton.py,sha256=gJoT3CvYX1eXfXdHT2m5Yth15DFG6VlnNuK0iZLLwz4,525
53
+ tests/unit/dynamics/test_body_node.py,sha256=QBz453qGtzlzC56a4118jtrJ4h-I_eU4U00VSRF9sO8,2132
54
+ tests/unit/dynamics/test_inverse_kinematics.py,sha256=tyRS0H7Y2t0O65OOJJUNNPuvZSSSwGavWCp4ehV8L3E,2700
55
+ tests/unit/dynamics/test_simple_frame.py,sha256=IKVXgckdy9OfZ8T1F51WR2mgQpmdRLhd1KemlGIgivk,1937
56
+ tests/unit/collision/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
+ tests/unit/collision/test_collision.py,sha256=KhFuXOtSE4s46MjKBRIu3jA3V_FF3UWhxQJZ3h-8y0Q,7555
58
+ tests/unit/simulation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ tests/unit/simulation/test_world.py,sha256=3FtvvHbKKhHVt0YsomD1dVzbaHfNYPZ4d7eQV069u0I,1317
60
+ tests/unit/optimizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
+ tests/unit/optimizer/test_optimizer.py,sha256=LBnkjjhnYH3oa6SNJu1eimXFzz3QrN5kwQM8Z28Rm44,2491
62
+ tests/unit/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
+ tests/unit/utils/test_skel_parser.py,sha256=4goKjpBs_rBJJrvk6e8mWWaPJLXyYtjnn2LYeFy80is,555
64
+ tests/unit/utils/test_mjcf_parser.py,sha256=IUekER9GvMf_3H89Uy85vINdfYGvkyIYC6y7Gk4TnOM,338
65
+ tests/unit/utils/test_dart_loader.py,sha256=gvJFiZmSak_82DtjurKUhWhvd5w-liZGtmxvZQuOnxs,2216
66
+ tests/unit/utils/test_sdf_parser.py,sha256=uMahhRhRPbQa6c3iQCQU11CdR43WL72oE27yt16qFSk,470
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-manylinux_2_28_x86_64
5
+
@@ -0,0 +1,2 @@
1
+ dartpy_math
2
+ tests
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
tests/__init__.py ADDED
File without changes
File without changes
@@ -0,0 +1,305 @@
1
+ import math
2
+
3
+ import dartpy as dart
4
+ import numpy as np
5
+ import pytest
6
+
7
+
8
+ def read_world(uri: dart.common.Uri):
9
+ options = dart.utils.SdfParser.Options()
10
+ options.mDefaultRootJointType = dart.utils.SdfParser.RootJointType.FIXED
11
+ world = dart.utils.SdfParser.readWorld(uri, options)
12
+ for i in range(world.getNumSkeletons()):
13
+ skel = world.getSkeleton(i)
14
+ for j in range(skel.getNumJoints()):
15
+ joint = skel.getJoint(j)
16
+ joint.setLimitEnforcement(True)
17
+ return world
18
+
19
+
20
+ def test_static():
21
+ # Load world
22
+ world = read_world("dart://sample/sdf/test/force_torque_test.world")
23
+ assert world is not None
24
+ assert world.getNumSkeletons() == 1
25
+
26
+ # Check if the world is correctly loaded
27
+ model_1 = world.getSkeleton(0)
28
+ assert model_1 is not None
29
+ assert model_1.getName() == "model_1"
30
+ assert model_1.getNumBodyNodes() == 2
31
+ assert model_1.getNumJoints() == 2
32
+
33
+ world.setGravity([0, 0, -50])
34
+
35
+ # Simulate 1 step
36
+ world.step()
37
+ t = world.getTime()
38
+
39
+ # Get time step size
40
+ dt = world.getTimeStep()
41
+ assert dt > 0
42
+ assert t == pytest.approx(dt)
43
+
44
+ # Get joint and get force torque
45
+ link_1 = model_1.getBodyNode("link_1")
46
+ assert link_1 is not None
47
+ link_2 = model_1.getBodyNode("link_2")
48
+ assert link_2 is not None
49
+ joint_01 = model_1.getJoint("joint_01")
50
+ assert joint_01 is not None
51
+ joint_12 = model_1.getJoint("joint_12")
52
+ assert joint_12 is not None
53
+
54
+ tf = dart.math.Isometry3()
55
+
56
+ # Run 10 steps
57
+ for _ in range(10):
58
+ world.step()
59
+
60
+ # ----------------------
61
+ # Test joint_01 wrench
62
+ # ----------------------
63
+
64
+ # Reference adjustment for the difference of the joint frame conventions
65
+ # between Gazebo and DART
66
+ tf.set_identity()
67
+ tf.set_translation(joint_01.getTransformFromParentBodyNode().translation())
68
+ parent_frame01 = dart.dynamics.SimpleFrame(
69
+ dart.dynamics.Frame.World(), "parent_frame01", tf
70
+ )
71
+ tf.set_identity()
72
+ tf.set_translation(joint_01.getTransformFromChildBodyNode().translation())
73
+ child_frame01 = dart.dynamics.SimpleFrame(link_1, "child_frame01", tf)
74
+
75
+ parent_f01 = joint_01.getWrenchToParentBodyNode(parent_frame01)
76
+ assert (parent_f01 == [0, 0, 0, 0, 0, 1000]).all()
77
+
78
+ child_f01 = joint_01.getWrenchToChildBodyNode(child_frame01)
79
+ assert (child_f01 == -parent_f01).all()
80
+
81
+ # ----------------------
82
+ # Test joint_12 wrench
83
+ # ----------------------
84
+
85
+ # Reference adjustment for the difference of the joint frame conventions
86
+ # between Gazebo and DART
87
+ tf.set_identity()
88
+ tf.set_translation(joint_12.getTransformFromParentBodyNode().translation())
89
+ parent_frame12 = dart.dynamics.SimpleFrame(link_1, "parent_frame12", tf)
90
+ tf.set_identity()
91
+ tf.set_translation(joint_12.getTransformFromChildBodyNode().translation())
92
+ child_frame12 = dart.dynamics.SimpleFrame(link_2, "child_frame12", tf)
93
+
94
+ parent_f12 = joint_12.getWrenchToParentBodyNode(parent_frame12)
95
+ assert (parent_f12 == [0, 0, 0, 0, 0, 500]).all()
96
+
97
+ child_f12 = joint_12.getWrenchToChildBodyNode(child_frame12)
98
+ assert (child_f12 == -parent_f12).all()
99
+
100
+
101
+ def test_force_torque_at_joint_limits():
102
+ # Load world
103
+ world = read_world("dart://sample/sdf/test/force_torque_test.world")
104
+ assert world is not None
105
+ assert world.getNumSkeletons() == 1
106
+
107
+ # Check if the world is correctly loaded
108
+ model_1 = world.getSkeleton(0)
109
+ assert model_1 is not None
110
+ assert model_1.getName() == "model_1"
111
+ assert model_1.getNumBodyNodes() == 2
112
+ assert model_1.getNumJoints() == 2
113
+
114
+ world.setGravity([0, 0, -50])
115
+
116
+ # Simulate 1 step
117
+ world.step()
118
+ t = world.getTime()
119
+
120
+ # Get time step size
121
+ dt = world.getTimeStep()
122
+ assert dt > 0
123
+ assert t == pytest.approx(dt)
124
+
125
+ # Get joint and get force torque
126
+ link_1 = model_1.getBodyNode("link_1")
127
+ assert link_1 is not None
128
+ link_2 = model_1.getBodyNode("link_2")
129
+ assert link_2 is not None
130
+ joint_01 = model_1.getJoint("joint_01")
131
+ assert joint_01 is not None
132
+ joint_12 = model_1.getJoint("joint_12")
133
+ assert joint_12 is not None
134
+
135
+ # Change gravity so that the top link topples over, then remeasure
136
+ world.setGravity([-30, 10, -50])
137
+
138
+ # Wait for dynamics to be stabilized
139
+ for i in range(2000):
140
+ world.step()
141
+
142
+ tf = dart.math.Isometry3()
143
+
144
+ # Run 5 steps
145
+ for _ in range(5):
146
+ world.step()
147
+
148
+ # ----------------------
149
+ # Test joint_01 wrench
150
+ # ----------------------
151
+
152
+ # Reference adjustment for the difference of the joint frame conventions
153
+ # between Gazebo and DART
154
+ tf.set_identity()
155
+ tf.set_translation(joint_01.getTransformFromParentBodyNode().translation())
156
+ parent_frame01 = dart.dynamics.SimpleFrame(
157
+ dart.dynamics.Frame.World(), "parent_frame01", tf
158
+ )
159
+ tf.set_identity()
160
+ tf.set_translation(joint_01.getTransformFromChildBodyNode().translation())
161
+ child_frame01 = dart.dynamics.SimpleFrame(link_1, "child_frame01", tf)
162
+
163
+ parent_f01 = joint_01.getWrenchToParentBodyNode(parent_frame01)
164
+ assert np.isclose(
165
+ parent_f01, [750, 0, -450, 600, -200, 1000], rtol=0.1, atol=4.5
166
+ ).all()
167
+
168
+ child_f01 = joint_01.getWrenchToChildBodyNode(child_frame01)
169
+ assert np.isclose(
170
+ child_f01, [-750, -450, 0, -600, 1000, 200], rtol=0.1, atol=4.5
171
+ ).all()
172
+
173
+ # ----------------------
174
+ # Test joint_12 wrench
175
+ # ----------------------
176
+
177
+ # Reference adjustment for the difference of the joint frame conventions
178
+ # between Gazebo and DART
179
+ tf.set_identity()
180
+ tf.set_translation(joint_12.getTransformFromParentBodyNode().translation())
181
+ parent_frame12 = dart.dynamics.SimpleFrame(link_1, "parent_frame12", tf)
182
+ tf.set_identity()
183
+ tf.set_translation(joint_12.getTransformFromChildBodyNode().translation())
184
+ child_frame12 = dart.dynamics.SimpleFrame(link_2, "child_frame12", tf)
185
+
186
+ parent_f12 = joint_12.getWrenchToParentBodyNode(parent_frame12)
187
+ assert np.isclose(
188
+ parent_f12, [250, 150, 0, 300, -500, -100], rtol=0.1, atol=0.1
189
+ ).all()
190
+
191
+ child_f12 = joint_12.getWrenchToChildBodyNode(child_frame12)
192
+ assert np.isclose(
193
+ child_f12, [-250, -150, 0, -300, 500, 100], rtol=0.1, atol=0.1
194
+ ).all()
195
+
196
+
197
+ def test_force_torque_at_joint_limits_with_external_forces():
198
+ # Load world
199
+ world = read_world("dart://sample/sdf/test/force_torque_test2.world")
200
+ assert world is not None
201
+ assert world.getNumSkeletons() == 1
202
+
203
+ # Check if the world is correctly loaded
204
+ model_1 = world.getSkeleton(0)
205
+ assert model_1 is not None
206
+ assert model_1.getName() == "boxes"
207
+ assert model_1.getNumBodyNodes() == 3
208
+ assert model_1.getNumJoints() == 3
209
+ assert model_1.getNumDofs() == 2
210
+
211
+ # The first joint is fixed joint
212
+ assert model_1.getRootJoint().getType() == dart.dynamics.WeldJoint.getStaticType()
213
+
214
+ world.setGravity([0, 0, -50])
215
+
216
+ # Simulate 1 step
217
+ world.step()
218
+ t = world.getTime()
219
+
220
+ # Get time step size
221
+ dt = world.getTimeStep()
222
+ assert dt > 0
223
+ assert t == pytest.approx(dt)
224
+
225
+ # Get joint and get force torque
226
+ link_1 = model_1.getBodyNode("link1")
227
+ assert link_1 is not None
228
+ link_2 = model_1.getBodyNode("link2")
229
+ assert link_2 is not None
230
+ link_3 = model_1.getBodyNode("link3")
231
+ assert link_3 is not None
232
+ joint_12 = model_1.getJoint("joint1")
233
+ assert joint_12 is not None
234
+ joint_23 = model_1.getJoint("joint2")
235
+ assert joint_23 is not None
236
+
237
+ tf = dart.math.Isometry3()
238
+
239
+ # Run 45005 steps
240
+ kp1 = 5e4
241
+ kp2 = 1e4
242
+ target1 = 0
243
+ target2 = -0.25 * math.pi
244
+ steps = 4500
245
+ for _ in range(steps):
246
+ # PD control
247
+ j1_state = joint_12.getPosition(0)
248
+ j2_state = joint_23.getPosition(0)
249
+ p1_error = target1 - j1_state
250
+ p2_error = target2 - j2_state
251
+ effort1 = kp1 * p1_error
252
+ effort2 = kp2 * p2_error
253
+ joint_12.setForce(0, effort1)
254
+ joint_23.setForce(0, effort2)
255
+
256
+ world.step()
257
+
258
+ assert joint_12.getPosition(0) == pytest.approx(target1, abs=1e-1)
259
+ assert joint_23.getPosition(0) == pytest.approx(target2, abs=1e-1)
260
+
261
+ tol = 2
262
+
263
+ # ----------------------
264
+ # Test joint_12 wrench
265
+ # ----------------------
266
+
267
+ # Reference adjustment for the difference of the joint frame conventions
268
+ # between Gazebo and DART
269
+ tf.set_identity()
270
+ tf.set_translation(joint_12.getTransformFromParentBodyNode().translation())
271
+ parent_frame01 = dart.dynamics.SimpleFrame(link_1, "parent_frame01", tf)
272
+ tf.set_identity()
273
+ tf.set_translation(joint_12.getTransformFromChildBodyNode().translation())
274
+ child_frame01 = dart.dynamics.SimpleFrame(link_2, "child_frame01", tf)
275
+
276
+ parent_f01 = joint_12.getWrenchToParentBodyNode(parent_frame01)
277
+ assert np.isclose(parent_f01, [25, -175, 0, 0, 0, 300], rtol=0.01, atol=tol).all()
278
+
279
+ child_f01 = joint_12.getWrenchToChildBodyNode(child_frame01)
280
+ assert np.isclose(child_f01, [-25, 175, 0, 0, 0, -300], rtol=0.01, atol=tol).all()
281
+
282
+ # ----------------------
283
+ # Test joint_23 wrench
284
+ # ----------------------
285
+
286
+ # Reference adjustment for the difference of the joint frame conventions
287
+ # between Gazebo and DART
288
+ tf.set_identity()
289
+ tf.set_translation(joint_23.getTransformFromParentBodyNode().translation())
290
+ parent_frame12 = dart.dynamics.SimpleFrame(link_2, "parent_frame12", tf)
291
+ tf.set_identity()
292
+ tf.set_translation(joint_23.getTransformFromChildBodyNode().translation())
293
+ child_frame12 = dart.dynamics.SimpleFrame(link_3, "child_frame12", tf)
294
+
295
+ parent_f12 = joint_23.getWrenchToParentBodyNode(parent_frame12)
296
+ assert np.isclose(parent_f12, [25, 0, 0, 0, 0, 50], rtol=0.01, atol=tol).all()
297
+
298
+ child_f12 = joint_23.getWrenchToChildBodyNode(child_frame12)
299
+ assert np.isclose(
300
+ child_f12, [-17.678, 0, 17.679, -35.355, 0, -35.355], rtol=0.01, atol=tol
301
+ ).all()
302
+
303
+
304
+ if __name__ == "__main__":
305
+ pytest.main()
tests/unit/__init__.py ADDED
File without changes
File without changes