Repository navigation
Conversation
Connector T2 is only available on robots that report Tool Flange V2 through the
RTDE robot properties, which requires PolyScope X 10.15.0 or later. PolyScope 5
does not support it.
- Add ToolVoltage::_48V and SET_TOOL_T2_VOLTAGE (13) to the script command
interface and external_control.urscript, using set_power_output("T2_V", ...).
- UrDriver::setToolVoltageT2() checks the flange type from the RTDE writer before
using the script command interface or the plain script fallback.
- ScriptCommandInterface::setToolVoltage() and setToolVoltageT2() reject
voltages that are not valid for the connector.
- Add the tool_output_voltage_2 / tool_output_current_2 fields to the fake RTDE
server and cover the writer flange reset on reconnect.
On a robot that reports Tool Flange V2, set connector T2 to 24 V, 48 V and 0 V through the script command interface, and to 24 V and 0 V through the plain script fallback. Each step is checked against RTDE tool_output_voltage_2, read by a separate RTDE client because older controllers reject that field. tool_output_voltage_2 is a measured value: on a 10.16.0 robot it read 23 V for 24 V and took about a second to decay after switching off. The check therefore accepts 5 V around the setpoint and waits up to 5 s. Robots that do not report Tool Flange V2 must refuse the command. Verified on a 10.16.0 robot with Tool Flange V2. The 10.15.0 URSim tested so far reports 0 V on tool_output_voltage_2 for every setpoint, so the V2 tests fail there.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #592 +/- ##
==========================================
+ Coverage 83.26% 83.79% +0.52%
==========================================
Files 126 126
Lines 8153 8238 +85
Branches 3745 3779 +34
==========================================
+ Hits 6789 6903 +114
+ Misses 957 925 -32
- Partials 407 410 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
🟡 Changes recommended
The shared 48 V enum can reach T0 during startup, and the plain-script fallback omits the required software-version check.
2 open findings
What changed in this PR
Adds 48 V T2 tool-connector support across the driver, script interface, RTDE integration, documentation, and tests.
Changes:
- Adds T2 voltage APIs, validation, and script command handling.
- Adds Tool Flange V2 and T2 telemetry checks.
- Extends integration/unit tests and examples.
| File | Description |
|---|---|
include/ur_client_library/ur/tool_communication.h |
Adds the 48 V enum value. |
include/ur_client_library/ur/ur_driver.h |
Declares and documents T2 voltage control. |
include/ur_client_library/control/script_command_interface.h |
Extends the script command API and protocol. |
src/ur/ur_driver.cpp |
Implements validated T2 voltage control and fallback. |
src/control/script_command_interface.cpp |
Serializes T2 commands and checks software versions. |
resources/external_control.urscript |
Handles the new T2 command in URScript. |
examples/script_command_interface.cpp |
Demonstrates T2 voltage switching. |
doc/architecture/script_command_interface.rst |
Documents the command and protocol payload. |
tests/test_ur_driver.cpp |
Adds hardware-level voltage and validation tests. |
tests/test_script_reader.cpp |
Tests version-dependent script rendering. |
tests/test_script_command_interface.cpp |
Tests command encoding and validation. |
tests/test_rtde_client_reconnect.cpp |
Tests flange-state reset during reconnection. |
tests/test_rtde_client_fake_server.cpp |
Tests T2 RTDE output fields. |
tests/fake_rtde_server.cpp |
Adds fake-server T2 field types. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ToolCommSetup::setToolVoltage now rejects voltages connector T0 does not
support, so the UrDriver startup script can no longer render
set_tool_voltage(48). ToolCommSetup also gets an optional T2 voltage
(0, 24 or 48 V) which UrDriver applies at startup with
set_power_output("T2_V", ...) when the robot reports Tool Flange V2, and
throws otherwise.
Run UrDriver against the fake primary and RTDE servers to cover the tool voltage paths no CI URSim reaches: the T2 voltage in the startup program, the startup check for Tool Flange V2, and setToolVoltage / setToolVoltageT2 through the script command interface and the script fallback. The fake RTDE server can now report the tool flange type and the URControl version. The tests skip if the default robot ports are in use.

No description provided.