1
1
# Universal Robots Client Library
2
- * [ Universal Robots Client Library] ( #universal-robots-client-library )
3
- * [ Build instructions] ( #build-instructions )
4
- * [ Use this library in other projects] ( #use-this-library-in-other-projects )
5
- * [ License] ( #license )
6
- * [ Library contents] ( #library-contents )
7
- * [ Example driver] ( #example-driver )
8
- * [ Architecture] ( #architecture )
9
- * [ A word on the primary / secondary interface] ( #a-word-on-the-primary--secondary-interface )
10
- * [ A word on Real-Time scheduling] ( #a-word-on-real-time-scheduling )
11
- * [ Producer / Consumer architecture] ( #producer--consumer-architecture )
12
- * [ Logging configuration] ( #logging-configuration )
13
- * [ Change logging level] ( #change-logging-level )
14
- * [ Create new log handler] ( #create-new-log-handler )
15
- * [ Console_bridge] ( #console_bridge )
16
- * [ Acknowledgement] ( #acknowledgement )
17
-
18
2
19
3
A C++ library for accessing Universal Robots interfaces. With this library C++-based drivers can be
20
4
implemented in order to create external applications leveraging the versatility of Universal Robots
21
5
robotic manipulators.
22
6
23
7
## Requirements
24
- * ** Polyscope** (The software running on the robot controller) version ** 3.14.3** (for CB3-Series),
25
- or ** 5.9.4** (for e-Series) or higher. If you use an older Polyscope version it is suggested to
26
- update your robot. If for some reason (please tell us in the issues why) you cannot upgrade your
27
- robot, please see the [ version compatibility table] ( doc/polyscope_compatibility.md ) for a
28
- compatible tag.
29
- * The library requires an implementation of ** POSIX threads** such as the ` pthread ` library
30
- * Socket communication is currently based on Linux sockets. Thus, this library will require Linux
31
- for building and using.
32
- * The [ master] ( https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/master )
33
- branch of this repository requires a C++17-compatible compiler. For building this library without
34
- a C++17-requirement, please use the
35
- [ boost] ( https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/boost ) branch
36
- instead that requires the boost library.
37
- For the C++17 features, please use those minimum compiler versions:
38
-
39
- | Compiler | min. version |
40
- | -----------| --------------|
41
- | ** GCC** | 7 |
42
- | ** Clang** | 7 |
43
8
9
+ * ** Polyscope** (The software running on the robot controller) version ** 3.14.3** (for CB3-Series),
10
+ or ** 5.9.4** (for e-Series) or higher. If you use an older Polyscope version it is suggested to
11
+ update your robot. If for some reason (please tell us in the issues why) you cannot upgrade your
12
+ robot, please see the [ version compatibility table] ( doc/polyscope_compatibility.rst ) for a
13
+ compatible tag.
14
+ * The library requires an implementation of ** POSIX threads** such as the ` pthread ` library
15
+ * Socket communication is currently based on Linux sockets. Thus, this library will require Linux
16
+ for building and using.
17
+ * The [ master] ( https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/master )
18
+ branch of this repository requires a C++17-compatible compiler. For building this library without
19
+ a C++17-requirement, please use the
20
+ [ boost] ( https://github.com/UniversalRobots/Universal_Robots_Client_Library/tree/boost ) branch
21
+ instead that requires the boost library.
44
22
45
23
## Build instructions
46
- See [ Build / installation] ( docs/installation.rst )
24
+
25
+ See [ Build / installation] ( doc/installation.rst )
47
26
48
27
## License
28
+
49
29
The majority of this library is licensed under the Apache-2.0 licensed. However, certain parts are
50
30
licensed under different licenses:
51
- - The queue used inside the communication structures is originally written by Cameron Desrochers
52
- and is released under the BSD-2-Clause license.
53
- - The semaphore implementation used inside the queue implementation is written by Jeff Preshing and
54
- licensed under the zlib license
55
- - The Dockerfile used for the integration tests of this repository is originally written by Arran
56
- Hobson Sayers and released under the MIT license
31
+
32
+ * The queue used inside the communication structures is originally written by Cameron Desrochers
33
+ and is released under the BSD-2-Clause license.
34
+ * The semaphore implementation used inside the queue implementation is written by Jeff Preshing and
35
+ licensed under the zlib license
36
+ * The Dockerfile used for the integration tests of this repository is originally written by Arran
37
+ Hobson Sayers and released under the MIT license
57
38
58
39
While the main ` LICENSE ` file in this repository contains the Apache-2.0 license used for the
59
40
majority of the work, the respective libraries of third-party components reside together with the
60
41
code imported from those third parties.
61
42
62
43
## Library contents
44
+
63
45
Currently, this library contains the following components:
64
- * ** Basic primary interface:** The primary interface isn't fully implemented at the current state
65
- and provides only basic functionality. See [ A word on the primary / secondary
66
- interface] ( #a-word-on-the-primary--secondary-interface ) for further information about the primary
67
- interface.
68
- * ** RTDE interface:** The [ RTDE interface] ( https://www.universal-robots.com/articles/ur-articles/real-time-data-exchange-rtde-guide/ )
69
- is fully supported by this library. See [ RTDEClient] ( #rtdeclient ) for further information on how
70
- to use this library as an RTDE client.
71
- * ** Dashboard interface:** The [ Dashboard server] ( https://www.universal-robots.com/articles/ur-articles/dashboard-server-e-series-port-29999/ ) can be accessed directly from C++ through helper functions using this library.
72
- * ** Custom motion streaming:** This library was initially developed as part of the [ Universal
73
- Robots ROS driver] ( https://github.com/UniversalRobots/Universal_Robots_ROS_Driver ) . Therefore, it
74
- also contains a mechanism to do data streaming through a custom socket, e.g. to perform motion
75
- command streaming.
46
+
47
+ * ** Basic primary interface:** The primary interface isn't fully implemented at the current state
48
+ and provides only basic functionality. See [ A word on the primary / secondary
49
+ interface] ( #a-word-on-the-primary--secondary-interface ) for further information about the primary
50
+ interface.
51
+ * ** RTDE interface:** The [ RTDE interface] ( https://www.universal-robots.com/articles/ur-articles/real-time-data-exchange-rtde-guide/ )
52
+ is fully supported by this library. See
53
+ [ RTDEClient] ( https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_client_library/doc/architecture.html#rtdeclient )
54
+ for further information on how
55
+ to use this library as an RTDE client.
56
+ * ** Dashboard interface:** The [ Dashboard
57
+ server] ( https://www.universal-robots.com/articles/ur-articles/dashboard-server-e-series-port-29999/ )
58
+ can be accessed directly from C++ through helper functions using this library.
59
+ * ** Custom motion streaming:** This library was initially developed as part of the [ Universal
60
+ Robots ROS driver] ( https://github.com/UniversalRobots/Universal_Robots_ROS_Driver ) . Therefore, it
61
+ also contains a mechanism to do data streaming through a custom socket, e.g. to perform motion
62
+ command streaming.
76
63
77
64
## Example driver
65
+
78
66
In the ` examples ` subfolder you will find a minimal example of a running driver. It starts an
79
67
instance of the ` UrDriver ` class and prints the RTDE values read from the controller. To run it make
80
68
sure to
81
- * have an instance of a robot controller / URSim running at the configured IP address (or adapt the
82
- address to your needs)
83
- * run it from the package's main folder (the one where this README.md file is stored), as for
84
- simplicity reasons it doesn't use any sophisticated method to locate the required files.
69
+
70
+ * have an instance of a robot controller / URSim running at the configured IP address (or adapt the
71
+ address to your needs)
72
+ * run it from the package's main folder (the one where this README.md file is stored), as for
73
+ simplicity reasons it doesn't use any sophisticated method to locate the required files.
85
74
86
75
## Architecture
87
- See [ Architecture documentation] ( docs/architecture.rst )
76
+
77
+ See [ Architecture documentation] ( doc/architecture.rst )
88
78
89
79
## A word on the primary / secondary interface
80
+
90
81
Currently, this library doesn't support the primary interface very well, as the [ Universal Robots
91
82
ROS driver] ( https://github.com/UniversalRobots/Universal_Robots_ROS_Driver ) was built mainly upon
92
83
the RTDE interface. Therefore, there is also no ` PrimaryClient ` for directly accessing the primary
93
84
interface. This may change in future, though.
94
85
95
- The ` comm::URStream ` class can be used to open a connection to the primary / secondary interface and
96
- send data to it. The [ producer/consumer] ( #producer--consumer-architecture ) pipeline structure can also be used
97
- together with the primary / secondary interface. However, package parsing isn't implemented for most
98
- packages currently. See the [ ` primary_pipeline ` example] ( examples/primary_pipeline.cpp ) on details
99
- how to set this up. Note that when running this example, most packages will just be printed as their
100
- raw byte streams in a hex notation, as they aren't implemented in the library, yet.
86
+ The ` comm::URStream ` class can be used to open a connection to the primary / secondary interface
87
+ and send data to it. The [ producer/consumer] ( #producer--consumer-architecture ) pipeline structure
88
+ can also be used together with the primary / secondary interface. However, package parsing isn't
89
+ implemented for most packages currently. See the [ ` primary_pipeline `
90
+ example] ( examples/primary_pipeline.cpp ) on details how to set this up. Note that when running this
91
+ example, most packages will just be printed as their raw byte streams in a hex notation, as they
92
+ aren't implemented in the library, yet.
101
93
102
94
## A word on Real-Time scheduling
95
+
103
96
As mentioned above, for a clean operation it is quite critical that arriving RTDE messages are read
104
97
before the next message arrives. Due to this, both, the RTDE receive thread and the thread calling
105
- ` getDataPackage() ` should be scheduled with real-time priority. See [ this guide] ( doc/real_time.md )
98
+ ` getDataPackage() ` should be scheduled with real-time priority. See [ this guide] ( doc/real_time.rst )
106
99
for details on how to set this up.
107
100
108
101
The RTDE receive thread will be scheduled to real-time priority automatically, if applicable. If
@@ -112,24 +105,28 @@ scheduled to real-time priority by the application. See the
112
105
as an example.
113
106
114
107
## Producer / Consumer architecture
108
+
115
109
Communication with the primary / secondary and RTDE interfaces is designed to use a
116
110
consumer/producer pattern. The Producer reads data from the socket whenever it comes in, parses the
117
111
contents and stores the parsed packages into a pipeline queue.
118
112
You can write your own consumers that use the packages coming from the producer. See the
119
113
[ ` comm::ShellConsumer ` ] ( include/ur_client_library/comm/shell_consumer.h ) as an example.
120
114
121
115
## Logging configuration
116
+
122
117
As this library was originally designed to be included into a ROS driver but also to be used as a
123
118
standalone library, it uses custom logging macros instead of direct ` printf ` or ` std::cout `
124
119
statements.
125
120
126
121
The macro based interface is by default using the [ ` DefaultLogHandler ` ] ( include/ur_client_library/default_log_handler.h )
127
122
to print the logging messages as ` printf ` statements. It is possible to define your own log handler
128
- to change the behavior, [ see create new log handler] ( #Create -new-log-handler ) on how to.
123
+ to change the behavior, [ see create new log handler] ( #create -new-log-handler ) on how to.
129
124
130
125
### Change logging level
126
+
131
127
Make sure to set the logging level in your application, as by default only messages of level
132
128
WARNING or higher will be printed. See below for an example:
129
+
133
130
``` c++
134
131
#include " ur_client_library/log.h"
135
132
@@ -143,6 +140,7 @@ int main(int argc, char* argv[])
143
140
```
144
141
145
142
### Create new log handler
143
+
146
144
The logger comes with an interface [`LogHandler`](include/ur_client_library/log.h), which can be
147
145
used to implement your own log handler for messages logged with this library. This can be done by
148
146
inheriting from the `LogHandler class`.
@@ -197,24 +195,29 @@ int main(int argc, char* argv[])
197
195
```
198
196
199
197
## Contributor Guidelines
198
+
200
199
* This repo supports [ pre-commit] ( https://pre-commit.com/ ) e.g. for automatic code formatting. TLDR:
201
200
This will prevent you from committing falsely formatted code:
202
- ```
201
+
202
+ ``` bash
203
203
pipx install pre-commit
204
204
pre-commit install
205
205
```
206
+
206
207
* Succeeding pipelines are a must on Pull Requests (unless there is a reason, e.g. when there have
207
208
been upstream changes).
208
209
* We try to increase and keep our code coverage high, so PRs with new
209
210
features should also have tests covering them.
210
211
* Parameters of public methods must all be documented.
211
212
212
213
## Acknowledgment
214
+
213
215
Many parts of this library are forked from the [ ur_modern_driver] ( https://github.com/ros-industrial/ur_modern_driver ) .
214
216
215
217
Developed in collaboration between:
216
218
217
- [ <img height =" 60 " alt =" Universal Robots A/S " src =" doc/resources/ur_logo.jpg " >] ( https://www.universal-robots.com/ )   ; and   ;
219
+ [ <img height =" 60 " alt =" Universal Robots A/S " src =" doc/resources/ur_logo.jpg " >] ( https://www.universal-robots.com/ )
220
+   ; and   ;
218
221
[ <img height =" 60 " alt =" FZI Research Center for Information Technology " src =" doc/resources/fzi-logo_transparenz.png " >] ( https://www.fzi.de ) .
219
222
220
223
<!--
0 commit comments