This package provides a non-real-time (NRT) ros2_control hardware interface for the Bosch Rexroth ctrlX CORE LINK. It allows ROS2 applications to communicate with the ctrlX Data Layer LINK, enabling the reading of states and sending of commands to variables exposed on the controller.
This hardware interface is designed to map ros2_control interfaces to Data Layer nodes.
-
Bosch Rexroth ctrlX AUTOMATION SDK: This hardware interface is built against the public SDK. You must have the SDK installed and sourced in your development environment.
-
Execution Environment: This driver must be run on the ctrlX device itself (e.g., a ctrlX CORE or COREvirtual), so the datalayer is instantiated.
-
ROS2 Control Snap: The current version of this driver relies on Inter-Process Communication (IPC) to connect to the Data Layer. The
datalayerSDK supports TCP, but due to firewall and security reasons, it is not enabled. Therefore, yourros2_controlnode must be packaged and run as a snap on the ctrlX device to have access to the necessary communication channels.
-
Clone this repository into your ROS2 workspace:
git clone https://github.com/b-robotized/rexroth_datalayer_driver.git src/rexroth_datalayer_driver
-
Build the workspace:
colcon build --packages-select datalayer_bringup datalayer_hardware_interface_nrt --cmake-args -DBUNDLE_SDK_DEP_RPATH=/my/path/to/lib
During build, BUNDLE_SDK_DEP_RPATH must be specified. This ensures that the compiled hardware interface .so can find the required Data Layer libraries (libcomm_datalayer.so) at runtime.
- Source the workspace:
source install/setup.bash
The hardware interface is configured through the URDF file loaded by the ros2_control controller manager. You need to define the Data Layer connection parameters and map the command/state interfaces to specific Data Layer nodes.
device_ip: The IP address of the ctrlX CORE. (Currently ignored in favor of IPC).device_user: Username for the Data Layer connection.device_password: Password for the Data Layer connection.
For each <command_interface> or <state_interface>, you must specify the following parameters:
DL_address: The base address of the node in the Data Layer.DL_variable: The specific variable name under the base address.DL_variable_type: The data type of the variable.
The hardware interface currently supports the following comm::datalayer::VariantType values:
BOOL8INT64UINT64FLOAT64
Example URDF configuration can be found in the accompanying datalayer_bringup package.
Note: for now, Only <gpio> component is supported!
<ros2_control name="DataLayerHardwareInterface" type="system">
<hardware>
<plugin>datalayer_hardware_interface_nrt/DataLayerHardwareInterface_NRT</plugin>
<param name="device_ip">192.168.1.1</param>
<param name="device_user">boschrexroth</param>
<param name="device_password">boschrexroth</param>
</hardware>
<gpio name="datalayer">
<command_interface name="some_output">
<param name="DL_address">fieldbuses/master/instances/my_io</param>
<param name="DL_variable">output/data/my_variable</param>
<param name="DL_variable_type">BOOL8</param>
</command_interface>
<state_interface name="scheduler_counter">
<param name="DL_address">scheduler/admin/info/common-data-rt</param>
<param name="DL_variable">counter</param>
<param name="DL_variable_type">UINT64</param>
</state_interface>
</gpio>
</ros2_control>This hardware interface is under active development. Future improvements include:
- Dynamic Type Detection: Instead of requiring
DL_variable_typein the URDF, the interface will query the metadata of a Data Layer node during theon_configurestep to determine its type automatically. - Expanded Interface Support: support for
<sensor>,<joint>, and<gpio>URDF components. - Broader DatalayerType Support: Add handlers for more Data Layer variant types (e.g.,
FLOAT32,INT32, arrays, etc.). - Initial Value: Implement a mechanism to set initial values for command interfaces on startup.
- Lifecycle Management: Move the Data Layer connection logic from
on_configuretoon_activateandon_deactivateto better align withros2_controllifecycle management. This will allow for cleaner activation and deactivation of the hardware.