Skip to content

Commit 0d0cc48

Browse files
committed
Merge remote-tracking branch 'origin/master' into torque_control
2 parents f45dda1 + bff7bf2 commit 0d0cc48

30 files changed

+1657
-117
lines changed

.github/workflows/check_links.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
--exclude '^http://192\.168\.56\.101'
3333
--exclude 'kernel\.org\/pub\/linux\/kernel'
3434
--exclude 'releases/download/v\$%7BURCAP_VERSION%7D/externalcontrol-\$%7BURCAP_VERSION%7D\.jar'
35+
--exclude '^http://rosin-project\.eu'
36+
--exclude '2013181\/gdb-causes-sem-wait-to-fail-with-eintr-error'
3537
--max-concurrency 1
3638
'./**/*.md' './**/*.html' './**/*.rst' './**/*.cpp' './**/*.h' './**/*.py'
3739
- name: Save lychee cache

.github/workflows/industrial-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- NAME: humble
2020
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#humble"
2121
- NAME: jazzy
22-
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"
22+
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#jazzy"
2323
- NAME: kilted
2424
DOWNSTREAM_WORKSPACE: "github:UniversalRobots/Universal_Robots_ROS2_Driver#main"
2525
- NAME: rolling

CHANGELOG.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
Changelog for package ur_client_library
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.1.0 (2025-06-18)
6+
------------------
7+
* Minimal support for building on macOS (`#341 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/341>`_)
8+
* Install endian.h and add that to the target include directories on Windows and MacOS (`#345 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/345>`_)
9+
* Add ScriptReader for script template parsing (`#343 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/343>`_)
10+
* Add more tests for VersionInformation (`#344 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/344>`_)
11+
* Fix driver branch for Jazzy downstream build (`#339 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/339>`_)
12+
* Stop control, when UrDriver object is destroyed (`#338 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/338>`_)
13+
* Add new robot types to URSim startup script (`#331 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/331>`_)
14+
* Fix robot message type POPUP (`#335 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/335>`_)
15+
* Disable checking links for two broken ones (`#333 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/333>`_)
16+
* readme: load ROSin imgs from press_kit repository (`#334 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/334>`_)
17+
* Added configuration data to packages parsed from the primary interface (`#327 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/327>`_)
18+
* Correct message sum in test_tool_contact (`#324 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/324>`_)
19+
* Fix the image sizes in architecture section (`#321 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/321>`_)
20+
* Check links using lychee (`#319 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/319>`_)
21+
* Update ROS distributions for industrial_ci (`#317 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/317>`_)
22+
* Support PolyScopeX simulator for 10.8.0 (`#315 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/315>`_)
23+
* Add an API reference page to the docs (`#314 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/314>`_)
24+
* Update documentation (`#309 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/309>`_)
25+
26+
* Contributors: Andrew C. Morrow, Felix Exner, G.A. vd. Hoorn, Mads Holm Peters
27+
528
2.0.0 (2025-04-16)
629
------------------
730
* Add functionality to send MoveP and MoveC instructions to the robot (`#303 <https://github.com/UniversalRobots/Universal_Robots_Client_Library/issues/303>`_)

CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_library(urcl
1818
src/comm/tcp_socket.cpp
1919
src/comm/tcp_server.cpp
2020
src/control/reverse_interface.cpp
21+
src/control/script_reader.cpp
2122
src/control/script_sender.cpp
2223
src/control/trajectory_point_interface.cpp
2324
src/control/script_command_interface.cpp
@@ -57,9 +58,18 @@ add_library(ur_client_library::urcl ALIAS urcl)
5758
target_compile_features(urcl PUBLIC cxx_std_17)
5859

5960
if(MSVC)
60-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/endian)
6161
target_link_libraries(urcl ws2_32)
62+
target_include_directories(urcl PUBLIC
63+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/endian>
64+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}/3rdparty>
65+
)
6266
else()
67+
if(APPLE)
68+
target_include_directories(urcl PUBLIC
69+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/endian>
70+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}/3rdparty>
71+
)
72+
endif()
6373
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
6474
target_compile_options(urcl PRIVATE -Wall -Wextra -Wno-unused-parameter)
6575

@@ -69,7 +79,7 @@ else()
6979
endif()
7080
endif()
7181

72-
target_include_directories( urcl PUBLIC
82+
target_include_directories(urcl PUBLIC
7383
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
7484
$<INSTALL_INTERFACE:include>
7585
)
@@ -101,6 +111,9 @@ install(TARGETS urcl EXPORT urcl_targets
101111
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
102112
)
103113
install(DIRECTORY include/ DESTINATION include)
114+
install(DIRECTORY 3rdparty/endian/ DESTINATION include/${PROJECT_NAME}/3rdparty
115+
FILES_MATCHING PATTERN "*.h"
116+
)
104117

105118
install(EXPORT urcl_targets
106119
DESTINATION lib/cmake/ur_client_library

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ Developed in collaboration between:
254254
-->
255255

256256
<a href="http://rosin-project.eu">
257-
<img src="http://rosin-project.eu/wp-content/uploads/rosin_ack_logo_wide.png"
257+
<img src="https://raw.githubusercontent.com/rosin-project/press_kit/master/img/rosin_ack_logo_wide.png"
258258
alt="rosin_logo" height="60" >
259259
</a>
260260

261261
Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
262262
More information: <a href="http://rosin-project.eu">rosin-project.eu</a>
263263

264-
<img src="http://rosin-project.eu/wp-content/uploads/rosin_eu_flag.jpg"
264+
<img src="https://raw.githubusercontent.com/rosin-project/press_kit/master/img/rosin_eu_flag.jpg"
265265
alt="eu_flag" height="45" align="left" >
266266

267267
This project has received funding from the European Union’s Horizon 2020

doc/architecture.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ well as a couple of standalone modules to directly use subsets of the library's
1313
architecture/reverse_interface
1414
architecture/rtde_client
1515
architecture/script_command_interface
16+
architecture/script_reader
1617
architecture/script_sender
1718
architecture/trajectory_point_interface
1819
architecture/ur_driver

doc/architecture/script_reader.rst

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
:github_url: https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/doc/architecture/script_reader.rst
2+
3+
.. _script_reader:
4+
5+
ScriptReader
6+
============
7+
8+
Script code used by the :ref:`script_sender` is read from a file. That script code might have to be
9+
dynamically modified based on some configuration input. For example, if the script code contains
10+
connections to a remote PC, that PC's IP address might be configured by the user. Another example
11+
would be to include certain parts of the script code only if the robot's software version supports
12+
that.
13+
14+
For that purpose the ``ScriptReader`` class is provided. It reads the script code from a file and
15+
performs the following substitutions:
16+
17+
- Replaces variables in the form of ``{{variable_name}}`` with the value of the variable
18+
from a provided dictionary.
19+
- Includes other script files using the directive ``{% include file_name %}``. The included file is
20+
read from the same directory as the main script file. Nested includes are also possible.
21+
- Use conditionals in order to add certain parts of the script code only if a condition matches.
22+
23+
The supported substitutions use a basic implementation of the `Jinja2 templating engine` syntax.
24+
25+
.. note::
26+
One special literal is defined for **version information**. Use a software version prefixed with a
27+
``v`` character, e.g. ``v10.8.0`` to encode a software version. Version information entries can be
28+
compared with each other.
29+
30+
**Do not** wrap version information into quotes, as this will be interpreted as a string.
31+
32+
Example
33+
-------
34+
35+
Given two script files:
36+
37+
.. literalinclude:: ../../tests/resources/example_urscript_main.urscript
38+
:caption: tests/resources/example_urscript_main.urscript
39+
:linenos:
40+
:lineno-match:
41+
42+
.. literalinclude:: ../../tests/resources/example_urscript_feature.urscript
43+
:language: python
44+
:caption: tests/resources/example_urscript_feature.urscript
45+
:linenos:
46+
:lineno-match:
47+
48+
The dictionary entry for ``feature_name`` is "torque control".
49+
50+
Depending on the ``SOFTWARE_VERSION`` entry in the dictionary passed to the
51+
``ScriptReader``, the script code will be read as follows:
52+
53+
Given ``SOFTWARE_VERSION = v5.21.0``, the script code will be:
54+
55+
.. code-block:: python
56+
57+
popup("The cool new feature is not supported on Software version 5.23.0")
58+
59+
60+
Given ``SOFTWARE_VERSION = v5.23.0``, the script code will be:
61+
62+
.. code-block:: python
63+
64+
textmsg("torque control is a very cool feature!")
65+
66+
Supported Data
67+
--------------
68+
69+
Data dictionary (C++ side)
70+
~~~~~~~~~~~~~~~~~~~~~~~~~~
71+
72+
The data dictionary supports the following types
73+
74+
- ``str``: A string value, e.g. "Hello World"
75+
- ``int``: An integer value, e.g. 42
76+
- ``double``: A floating point value, e.g. 3.14
77+
- ``bool``: A boolean value, e.g. ``true`` or ``false``
78+
- ``VersionInformation``: A version information value, e.g. ``VersionInformation::fromString("10.8.0")``
79+
80+
Script code side
81+
~~~~~~~~~~~~~~~~
82+
83+
Variable replacements
84+
^^^^^^^^^^^^^^^^^^^^^
85+
86+
Variable replacements in the script code are done using the syntax ``{{ variable_name }}``. For
87+
this to work, the variable ``variable_name`` has to be defined in the data dictionary passed to the
88+
``ScriptReader``.
89+
90+
The expression ``{{ variable_name }}`` will be replaced with the string representation of the
91+
variable's content.
92+
93+
- If the variable is a string, it has to be wrapped into quotes in the script
94+
code. e.g.
95+
96+
.. code-block:: python
97+
98+
textmsg("{{ log_message }}")
99+
100+
101+
- Boolean variables will be replaced with the string ``True`` or ``False``.
102+
- Numeric variables (integer and floating point) will be replaced with the string representation generated by
103+
`std::to_string() <https://en.cppreference.com/w/cpp/string/basic_string/to_string>`_.
104+
- Version information variables will be replaced with the string representation similar to
105+
``10.7.0.0``
106+
107+
Boolean expressions
108+
^^^^^^^^^^^^^^^^^^^
109+
110+
Boolean expressions have to follow one of two possible syntax variations
111+
112+
- Direct evaluation of a boolean variable from the data dictionary:
113+
114+
.. code-block::
115+
116+
boolean_variable_name
117+
118+
- Comparison of a variable with a value using an operator.
119+
120+
.. code-block::
121+
122+
variable_name operator value
123+
124+
The operator has to be one of ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. On the lefthand side
125+
of the operator there has to be a variable from the data dictionary. The right hand side can be
126+
either a variable name or a value. If the right hand side is a variable name, it has to be
127+
defined in the data dictionary as well. Values will be parsed as follows:
128+
129+
- Strings: Wrapped in quotes, e.g. ``"Hello World"`` or ``'Universal Robots'``.
130+
- Numerical values such as ``42``, ``3.14``, ``-1``, ``1e-12``.
131+
- Boolean values: See below.
132+
- Version information: Prefixed with a ``v`` character, e.g. ``v10.8.0``, ``v5.23.0``.
133+
134+
Boolean values parsing
135+
^^^^^^^^^^^^^^^^^^^^^^
136+
137+
Boolean values can be parsed from the following strings:
138+
139+
- ``true``, ``True``, ``TRUE``
140+
- ``on``, ``On``, ``ON``
141+
- ``yes``, ``Yes``, ``YES``
142+
- ``1``
143+
- ``false``, ``False``, ``FALSE``
144+
- ``off``, ``Off``, ``OFF``
145+
- ``no``, ``No``, ``NO``
146+
- ``0``
147+
148+
Conditional blocks
149+
^^^^^^^^^^^^^^^^^^
150+
151+
Conditional blocks have to be started with a ``{% if condition %}`` directive and closed with a
152+
``{% endif %}`` directive. The condition can be any boolean expression as described above.
153+
154+
The ``{% elif condition %}`` and ``{% else %}`` directives can be used to add alternative paths.
155+
156+
Conditional blocks can be nested.

0 commit comments

Comments
 (0)