This package provides a ROS2 interface for the Haply Inverse3 and VerseGrip Stylus (Handle) haptic devices. It includes drivers, visualization tools, and control nodes to operate and test the devices individually or together within a ROS2 environment.
This implementation was tested on:
- Windows 11 (WSL2 Ubuntu 22.04 LTS (64-bit))
- Python 3.10.6
This interface was developed and tested on Ubuntu 22.04 running under WSL. It is therefore recommended to use the same environment for compatibility and stability.
If you don't have WSL installed yet, you can find detailed installation instructions here:
WSL Installation Guide
This interface was developed and tested using ROS2 Humble. It is strongly recommended to use this version to ensure compatibility and stability.
You can find more information on how to install ROS2 Humble here:
ROS2 Installation Guide
Below are the external Python packages that must be installed manually:
-
Name:
websocketspip install websockets
-
Name:
orjsonpip install orjson
-
Name:
rclpypip install rclpy
This interface uses a WebSocket-based communication protocol to interact with the devices.
To enable this, the Haply Inverse SDK Service must be installed. This service acts as a WebSocket server and is required for the interface to function properly.
For installation and testing instructions, please refer to the official documentation:
Haply Inverse SDK Service Guide
-
To verify that your system recognizes the Haply devices, we recommend installing the Haply Device Manager.
You can find installation instructions here:
Haply Device Manager -
Additional demo codes can be found here:
Haply DemosNote: Please note that these examples use direct serial communication, not WebSocket as the ROS2 interface does.
Navigate to the directory where you want to place the repository, then clone it:
git clone <repository url>After cloning, go to the workspace root:
cd ~/haply_ros2_interfaceand build it using colcon:
colcon buildFinally, source the setup script:
source install/setup.bashThis interface is designed for the Haply Inverse3 and VerseGrip Stylus devices.
For setting up and calibrating the devices, please refer to the official Haply documentation:
It is recommended to recalibrate the device each time it is reconnected to ensure accurate tracking and operation.
To use the Haply devices under WSL 2, it is necessary to make the USB connection available to your Linux distribution.
For first-time setup and detailed guidance, follow the official documentation: Microsoft Guide: Connect USB Devices to WSL
After completing the installation steps described in the guide above, follow these commands each time you want to use the device:
-
Open PowerShell as Administrator, and list all connected USB devices:
usbipd list
-
Bind the USB device to allow forwarding to WSL. Replace with the Bus ID shown in the previous step (e.g., 4-4):
usbipd bind --busid <busid>
-
Attach the USB device to WSL
usbipd attach --wsl --busid <busid>
Important: Your Linux distribution (e.g., Ubuntu in WSL) must be running before performing the
attachstep. Simply open a WSL terminal before executing theusbipd attachcommand.Note: If you receive the following warning:
usbipd: warning: The device appears to be used by Windows; stop the software using the device, or bind the device using the '--force' option.
It may be caused by a background process such ashaply-inverse-service.exe.
Open Task Manager and stop this process before attempting to attach the device. -
When finished using the device, you can detach it:
usbipd detach --busid <busid>
Note: The device will be inaccessible from Windows while attached to WSL.
This section presents two simple demos that you can launch immediately after completing the steps above; they showcase the device’s capabilities and basic operation.
This demo implements a virtual haptic sphere interaction.
It continuously computes and applies forces to the Inverse3 device to simulate a spring-like boundary when the device enters the defined sphere volume.
It also publishes a sphere marker to RViz (visualization_marker) so that the simulated ball is also visible in the 3D scene.
Run:
ros2 run haply_interface haptic_ball --ros-args -p stiffness:=200.0 -p position_scale:=10.0This demo moves the device sinusoidally along the z-axis with a 0.1 m amplitude. Meanwhile, it plots the desired and actual positions, allowing you to gauge the PID controller’s accuracy.
To start the node, use:
ros2 run haply_interface target_position_publisherThis package contains the launch files that demonstrate different applications of the Haply devices.
A detailed description of each launch file can be found in the launch_files_README.md.
This package contains the ROS2 nodes used by the system, organized into three categories:
-
Driver nodes → Handle the communication between the Haply devices and ROS2. A detailed description of each node can be found in the
drivers_README.md. -
Visualization nodes → Provide 2D/3D visualization of device states and transforms (e.g., in RViz).
A detailed description of each node can be found in thevisualization_README.md. -
Demo nodes → Demonstrate various capabilities and use-cases of the Haply devices. A detailed description of each node can be found in the
demo_nodes_README.md.
This package includes the STL files used for 3D visualization of the Handle (VerseGrip Stylus) in RViz.
This package defines the custom ROS2 message types used by the ROS2 interface.
This work is related to the MedLaBotX project (2024-1.2.3-HU-RIZONT-00069). The project has been implemented with support provided by the Ministry of Culture and Innovation of Hungary from the National Research, Development, and Innovation Fund, financed under the 2024-1.2.3-HU-RIZONT funding scheme.
If you use this code in your research, please cite our paper:
@article{varga2025haptic,
title={n Open-Source ROS2 Framework for Shared Control in Surgical Teleoperation: Integrating the Haply Inverse3 with the da Vinci Research Kit},
author={Varga, Balint and Fritz, Sebastian and Kiss, Gergely and Takacs, Kristof and Galambos, Peter},
journal={IEEE Transactions on Haptics},
year={2025},
note={Submitted, in Revision},
affiliation={Institute of Control Systems, Karlsruhe Institute of Technology, Germany; Antal Bejczy Center for Intelligent Robotics, Óbuda University, Budapest, Hungary}
}