RobotRaconteurCompanion 0.4.1__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.
Files changed (74) hide show
  1. robotraconteurcompanion-0.4.1/LICENSE.txt +201 -0
  2. robotraconteurcompanion-0.4.1/PKG-INFO +23 -0
  3. robotraconteurcompanion-0.4.1/README.md +247 -0
  4. robotraconteurcompanion-0.4.1/setup.cfg +4 -0
  5. robotraconteurcompanion-0.4.1/setup.py +29 -0
  6. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/InfoParser/__init__.py +355 -0
  7. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/__init__.py +73 -0
  8. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.action.robdef +13 -0
  9. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.actuator.robdef +94 -0
  10. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.bignum.robdef +20 -0
  11. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.color.robdef +55 -0
  12. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.datatype.robdef +61 -0
  13. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.datetime.clock.robdef +34 -0
  14. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.datetime.robdef +77 -0
  15. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.device.clock.robdef +18 -0
  16. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.device.isoch.robdef +18 -0
  17. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.device.robdef +64 -0
  18. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.eventlog.robdef +71 -0
  19. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.fiducial.robdef +95 -0
  20. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.geometry.robdef +173 -0
  21. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.geometry.shapes.robdef +99 -0
  22. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.geometryf.robdef +173 -0
  23. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.geometryi.robdef +173 -0
  24. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.gps.robdef +98 -0
  25. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.hid.joystick.robdef +109 -0
  26. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.identifier.robdef +12 -0
  27. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.image.robdef +124 -0
  28. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.imaging.camerainfo.robdef +42 -0
  29. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.imaging.robdef +126 -0
  30. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.imu.robdef +36 -0
  31. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.laserscan.robdef +83 -0
  32. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.laserscanner.robdef +38 -0
  33. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.lighting.robdef +42 -0
  34. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.objectrecognition.robdef +83 -0
  35. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.octree.robdef +43 -0
  36. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.param.robdef +26 -0
  37. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.pid.robdef +13 -0
  38. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.pointcloud.robdef +116 -0
  39. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.pointcloud.sensor.robdef +122 -0
  40. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.resource.device.robdef +33 -0
  41. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.resource.robdef +64 -0
  42. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.robotics.joints.robdef +115 -0
  43. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.robotics.payload.robdef +19 -0
  44. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.robotics.robot.robdef +259 -0
  45. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.robotics.tool.robdef +130 -0
  46. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.robotics.trajectory.robdef +108 -0
  47. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.sensor.robdef +208 -0
  48. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.sensordata.robdef +25 -0
  49. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.servo.robdef +142 -0
  50. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.signal.robdef +103 -0
  51. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.units.robdef +8 -0
  52. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/StdRobDef/com.robotraconteur.uuid.robdef +7 -0
  53. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/AttributesUtil.py +82 -0
  54. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/DateTimeUtil.py +112 -0
  55. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/DeviceConnector.py +495 -0
  56. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/GeometryUtil.py +721 -0
  57. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/IdentifierUtil.py +194 -0
  58. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/ImageUtil.py +268 -0
  59. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/InfoFileLoader.py +112 -0
  60. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/LocalIdentifiersManager.py +81 -0
  61. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/RobDef.py +71 -0
  62. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/RobotUtil.py +133 -0
  63. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/RobustFunctionCaller.py +150 -0
  64. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/SensorDataUtil.py +48 -0
  65. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/TaskGenerator.py +295 -0
  66. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/TestFixtures.py +119 -0
  67. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/Util/UuidUtil.py +80 -0
  68. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion/__init__.py +13 -0
  69. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/PKG-INFO +23 -0
  70. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/SOURCES.txt +72 -0
  71. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/dependency_links.txt +1 -0
  72. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/not-zip-safe +1 -0
  73. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/requires.txt +9 -0
  74. robotraconteurcompanion-0.4.1/src/RobotRaconteurCompanion.egg-info/top_level.txt +1 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2011-2020 Wason Technology, LLC
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: RobotRaconteurCompanion
3
+ Version: 0.4.1
4
+ Summary: Robot Raconteur Python Companion Library
5
+ Home-page: https://github.com/robotraconteur/robotraconteur_companion_python
6
+ Author: John Wason
7
+ Author-email: wason@wasontech.com
8
+ License-File: LICENSE.txt
9
+ Requires-Dist: RobotRaconteur>=1.1.1
10
+ Requires-Dist: numpy
11
+ Requires-Dist: PyYAML
12
+ Requires-Dist: setuptools
13
+ Requires-Dist: importlib_resources
14
+ Requires-Dist: general_robotics_toolbox>=0.7.1
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest; extra == "test"
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: home-page
20
+ Dynamic: license-file
21
+ Dynamic: provides-extra
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
@@ -0,0 +1,247 @@
1
+ # Robot Raconteur Companion Python
2
+
3
+ <p align="center"><img src="docs/figures/logo-header.svg"></p>
4
+
5
+ The Robot Raconteur companion library contains utilities for working with Robot Raconteur services and devices.
6
+ This companion library is intended to be used with the Robot Raconteur Core library
7
+ (https://github.com/robotraconteur/robotraconteur). This version of the companion library is for Python.
8
+ Other language versions are available at https://github.com/robotraconteur.
9
+
10
+ Robot Raconteur Core focuses on the core capabilities of Robot Raconteur, such as transport, discovery, and
11
+ communication. The companion contains a number of miscelanous utilities that are useful for working with other libraries
12
+ such as numpy, and for working with standard Robot Raconteur service types
13
+ (https://github.com/robotraconteur/robotraconteur_standard_robdef).
14
+
15
+ The companion library is not required to use Robot Raconteur, but is recommended for most users.
16
+
17
+ The companion is intended to evolve faster than the core library, and accept contributions from the community.
18
+
19
+ The companion library is licensed under the Apache 2.0 license.
20
+
21
+ The Robot Raconteur Companion library contains the following utilities:
22
+
23
+ * Standard Service Definition (robdef) types
24
+ * YAML parsers for device info structures
25
+ * Service attribute utilities
26
+ * Geometry type converters
27
+ * Image type converters
28
+ * Date/time converters
29
+ * Identifier utilities
30
+ * UUID utilities
31
+ * Miscellaneous support utilities
32
+
33
+ ## Installation
34
+
35
+ The Robot Raconteur companion library is available on PyPI. It can be installed using pip:
36
+
37
+ ```
38
+ pip install RobotRaconteurCompanion
39
+ ```
40
+
41
+ ## Documentation
42
+
43
+ Documentation for the Robot Raconteur companion library is available at https://robot-raconteur-companion-python.readthedocs.io/en/latest/
44
+
45
+ ## Standard Service Types
46
+
47
+ The companion library contains the standard service types available at
48
+ https://github.com/robotraconteur/robotraconteur_standard_robdef . These types can be registered
49
+ with the local Node using the following code:
50
+
51
+ ```python
52
+ import RobotRaconteur as RR
53
+ RRN = RR.RobotRaconteurNode.s
54
+ import RobotRaconteurCompanion as RRC
55
+ RRC.RegisterStdRobDefServiceTypes(RRN)
56
+ ```
57
+
58
+ Registering the standard service types is not required for clients since they will be pulled from the service.
59
+
60
+ ## Device Info Structure YAML Parsers and Attributes Util
61
+
62
+ Device Info structures are used to describe devices and their capabilities. The structures are provided
63
+ to clients at runtime, typically through a property of a device service. For example, the
64
+ `com.robotraconteur.device.Device` standard type defines the `device_info` property. The
65
+ `com.robotraconteur.robotics.robot.Robot` standard type defines both `device_info` and `robot_info` properties.
66
+ These structures can be used to describe a wide variety of devices, including robots, sensors, and other devices.
67
+ YAML files are used to store the contents of these structures to make it easier to create and edit them. The
68
+ Robot Raconteur companion library contains parsers for these YAML files. The following device info structure types
69
+ are supported:
70
+
71
+ * `com.robotraconteur.actuator.ActuatorInfo`
72
+ * `com.robotraconteur.clock.ClockDeviceInfo`
73
+ * `com.robotraconteur.isoch.IsochDeviceInfo`
74
+ * `com.robotraconteur.device.DeviceInfo`
75
+ * `com.robotraconteur.eventlog.EventLogInfo`
76
+ * `com.robotraconteur.fiducial.FiducialInfo`
77
+ * `com.robotraconteur.fiducial.FiducialSensorInfo`
78
+ * `com.robotraconteur.hid.joystick.JoystickInfo`
79
+ * `com.robotraconteur.image.ImageInfo`
80
+ * `com.robotraconteur.image.FreeformImageInfo`
81
+ * `com.robotraconteur.imaging.camerainfo.PlumbBobDistortionInfo`
82
+ * `com.robotraconteur.imaging.camerainfo.CameraInfo`
83
+ * `com.robotraconteur.imaging.camerainfo.MultiCameraInfo`
84
+ * `com.robotraconteur.laserscan.LaserScanInfo`
85
+ * `com.robotraconteur.laserscan.LaserScanInfof`
86
+ * `com.robotraconteur.laserscan.LaserScanSensorInfo`
87
+ * `com.robotraconteur.lighting.LightInfo`
88
+ * `com.robotraconteur.objectrecognition.ObjectRecognitionSensorInfo`
89
+ * `com.robotraconteur.octree.OcTreeInfo`
90
+ * `com.robotraconteur.param.ParameterInfo`
91
+ * `com.robotraconteur.pointcloud.sensor.PointCloudSensorInfo`
92
+ * `com.robotraconteur.resource.BucketInfo`
93
+ * `com.robotraconteur.resource.ResourceInfo`
94
+ * `com.robotraconteur.robotics.joint.JointInfo`
95
+ * `com.robotraconteur.robotics.payload.PayloadInfo`
96
+ * `com.robotraconteur.robotics.robot.RobotInfo`
97
+ * `com.robotraconteur.robotics.robot.RobotKinChainInfo`
98
+ * `com.robotraconteur.robotics.tool.ToolInfo`
99
+ * `com.robotraconteur.sensor.SensorInfo`
100
+ * `com.robotraconteur.sensordata.SensorDataSourceInfo`
101
+ * `com.robotraconteur.servo.ServoInfo`
102
+ * `com.robotraconteur.signal.SignalInfo`
103
+ * `com.robotraconteur.signal.SignalGroupInfo`
104
+
105
+ The attributes utility class can be used to generate the attributes for a registered service. These attributes
106
+ are used by clients to locate a desired service.
107
+
108
+ Device info files can be parsed using the `RobotRaconteurCompanion.Util.InfoFileLoader` class. The following example
109
+ parses a device info file and prints the device name:
110
+
111
+ ```python
112
+ import RobotRaconteur as RR
113
+ RRN = RR.RobotRaconteurNode.s
114
+ import RobotRaconteurCompanion as RRC
115
+ from RobotRaconteurCompanion.Util.InfoFileLoader import InfoFileLoader
116
+ from RobotRaconteurCompanion.Util.AttributesUtil import AttributesUtil
117
+
118
+ RRC.RegisterStdRobDefServiceTypes(RRN)
119
+ info_loader = InfoFileLoader(RRN)
120
+ camera_info, camera_ident_fd = info_loader.LoadInfoFileFromString(camera_info_text, "com.robotraconteur.imaging.camerainfo.CameraInfo", "camera")
121
+ attributes_util = AttributesUtil(RRN)
122
+ camera_attributes = attributes_util.GetDefaultServiceAttributesFromDeviceInfo(camera_info.device_info)
123
+
124
+ # Register a service and set attributes
125
+ service_ctx = RRN.RegisterService("camera","com.robotraconteur.imaging.Camera",camera)
126
+ service_ctx.SetServiceAttributes(camera_attributes)
127
+ ```
128
+
129
+ ## Geometry Type Converters
130
+
131
+ The Robot Raconteur companion library contains type converters for geometry types defined in,
132
+ `com.robotraconteur.geometry`, `com.robotraconteur.geometryf`, and `com.robotraconteur.geometryi`. These types
133
+ can be converted to and from the corresponding Python types.
134
+
135
+ An example of converting a few types:
136
+
137
+ ```python
138
+ from RobotRaconteur.Client import *
139
+ from RobotRaconteur.Companion.Util import GeometryUtil
140
+
141
+ c = RRN.ConnectService('rr+tcp://localhost:22222?service=MyRobot')
142
+ geom_util = GeometryUtil(client_obj=c)
143
+
144
+ # Create GeometryUtil using the connected object
145
+
146
+ # Get a position vector
147
+ v = c.getf_position()
148
+
149
+ # Convert to numpy array
150
+ v2 = vector3_to_xyz(v)
151
+
152
+ # Convert a rpy xyz to a Robot Raconteur com.robotraconteur.geometry.Transform
153
+ t = rpy_xyz_to_transform(np.deg2rad([10,20,30],[0.1,0.2,0.3]))
154
+ ```
155
+
156
+ ## Image Type Converters
157
+
158
+ The image utilities provide functions to convert between Robot Raconteur image structures and OpenCV numpy arrays.
159
+
160
+ An example of converting a few types:
161
+
162
+ ```python
163
+ from RobotRaconteur.Client import *
164
+ from RobotRaconteurCompanion.Util.ImageUtil import ImageUtil
165
+
166
+ c = RRN.ConnectService('rr+tcp://localhost:2355?service=camera')
167
+ im = c.capture_frame()
168
+
169
+ im_util = ImageUtil(client_obj=c)
170
+ im_mat = im_util.image_to_numpy(im)
171
+
172
+ # Do something with the image
173
+
174
+ # Create a random image
175
+ im_mat = np.random.randint(0,255,(480,640,3),dtype=np.uint8)
176
+ rr_img = im_util.array_to_image(im_mat, "bgr888")
177
+
178
+ # Send the image
179
+ c.send_frame(rr_img)
180
+ ```
181
+
182
+ ## Date/Time Utilities
183
+
184
+ The date/time utilities provide functions for populating Robot Raconteur date/time structures.
185
+
186
+ An example of using the date/time utilities:
187
+
188
+ ```python
189
+ import RobotRaconteur as RR
190
+ RRN = RR.RobotRaconteurNode.s
191
+ import RobotRaconteurCompanion as RRC
192
+ from RobotRaconeteurCompanion.Util.DateTimeUtil import DateTimeUtil
193
+
194
+ RRC.RegisterStdRobDefServiceTypes(RRN)
195
+
196
+ # Create a DateTimeUtil object
197
+ dt_util = DateTimeUtil(RRN)
198
+
199
+ # Create a Robot Raconteur TimeSpec2
200
+ now_timespec2 = dt_util.NowTimeSpec()
201
+
202
+ # Create a Robot Raconteur TimeSpec3
203
+ now_timespec3 = dt_util.NowTimeSpec3()
204
+
205
+ # Create a Robot Raconteur DateTimeUTC
206
+ now_datetimeutc = dt_util.NowDateTimeUTC()
207
+ ```
208
+
209
+ ## Identifier and UUID Utilities
210
+
211
+ The identifier utilities provide functions for creating and parsing Robot Raconteur identifiers and UUIDs.
212
+
213
+ An example of using the identifier utilities:
214
+
215
+ ```python
216
+ import RobotRaconteur as RR
217
+ RRN = RR.RobotRaconteurNode.s
218
+ import RobotRaconteurCompanion as RRC
219
+ from RobotRaconeteurCompanion.Util.IdentifierUtil import IdentifierUtil
220
+
221
+ RRC.RegisterStdRobDefServiceTypes(RRN)
222
+
223
+ # Create an IdentifierUtil
224
+ id_util = IdentifierUtil(RRN)
225
+
226
+ # Create an identifier from a name
227
+ my_device_identifier = id_util.CreateIdentifierFromName("my_device")
228
+
229
+ # Convert the identifier to a string
230
+ my_device_identifier_str = id_util.IdentifierToString(my_device_identifier)
231
+
232
+ # Convert the identifier string back to an identifier
233
+ my_device_identifier2 = id_util.StringToIdentifier(my_device_identifier_str)
234
+
235
+ # Compare identifiers
236
+ assert id_util.IsIdentifierMatch(my_device_identifier, my_device_identifier2)
237
+ ```
238
+
239
+ ## Miscellaneous Utilities
240
+
241
+ Other utility classes are provided for various purposes. These include populating
242
+ `com.robotraconteur.sensordata.SensorData` structures, periodically calling a function, and loading
243
+ Robot Raconteur service info files from packages. See the documentation for more information.
244
+
245
+ ## License
246
+
247
+ Apache 2.0
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages, find_namespace_packages
2
+
3
+ setup(
4
+ name='RobotRaconteurCompanion',
5
+ version='0.4.1',
6
+ description='Robot Raconteur Python Companion Library',
7
+ author='John Wason',
8
+ author_email='wason@wasontech.com',
9
+ url='https://github.com/robotraconteur/robotraconteur_companion_python',
10
+ package_dir={'': 'src'},
11
+ packages=find_namespace_packages(where='src'),
12
+ include_package_data=True,
13
+ zip_safe=False,
14
+ package_data={'RobotRaconteurCompanion.StdRobDef': [
15
+ '*.robdef'
16
+ ]},
17
+ install_requires=[
18
+ 'RobotRaconteur>=1.1.1',
19
+ 'numpy',
20
+ 'PyYAML',
21
+ 'setuptools',
22
+ 'importlib_resources',
23
+ 'general_robotics_toolbox>=0.7.1'
24
+ ],
25
+ tests_require=['pytest'],
26
+ extras_require={
27
+ 'test': ['pytest']
28
+ }
29
+ )