HID ROS 2 Documentation
A schema-driven ROS 2 hardware interface for USB Human Interface Devices (HID)
HID ROS 2 is a comprehensive framework for integrating USB HID devices with ROS 2 through the ros2_control infrastructure. It provides a schema-driven approach where a single YAML file defines your device’s interface, automatically generating all necessary code for both the ROS 2 side and embedded firmware.
Key Features
Single Source of Truth: Define your device interface once in YAML, generate everything else automatically
Type-Aware Hardware Interface: Native support for
uint8/16/32,int8/16/32, andfloat32/64with proper byte conversionBidirectional Communication: Both input (sensor data) and output (commands) over USB HID
Code Generation: Automatic generation of URDF, controller configs, launch files, and C headers for firmware
Developer Tools: Command-line tools for schema validation, live device inspection, and descriptor generation
Full ros2_control Integration: Works seamlessly with existing ROS 2 controllers and tools
Zero Manual Configuration: No hand-written URDF or configuration files required
Quick Links
Getting Started
- Installation
- Quick Start Guide
- Tutorial: Create Your Custom HID Device Integration
- What You’ll Build
- Prerequisites
- Step 1: Clone and Build the Base Repository
- Step 2: Create Your Custom Device Package
- Step 3: Define Your Device Schema
- Step 4: Build Your Package
- Step 5: Set Up USB Permissions
- Step 6: Test Without Hardware (Optional)
- Step 7: Launch Your Device
- Step 8: Debug and Verify
- Step 9: Customize the Integration
- Troubleshooting
- Next Steps
- Summary
- Additional Resources
- Basic Concepts
Examples
Advanced Topics
- Understanding HID Report Descriptors
- What is a HID Report Descriptor?
- Report Structure Overview
- Interactive Example: Temperature Sensor
- Interactive Example: 3-Axis Accelerometer
- Understanding Item Types
- Byte-Level Item Format
- Report Size vs Report Count
- Input vs Output Reports
- Main Item Flags
- Usage Pages Reference
- Common Mistakes
- Quick Reference
- See Also
- Firmware Integration
- Custom Controllers
- Type System
- Debugging
Development
Additional Resources