# Vibration API

## 1. Overview

This document introduces how to send vibration control commands to HandDriver via the UDP protocol to trigger vibration feedback for the vibrators of the glove.

{% hint style="warning" %}
Please ensure that it is used within the same local area network (LAN).
{% endhint %}

## 2. Usage Instructions

### 2.1. Basic Parameters

* **Protocol**: UDP
* **Port**: 8920
* **IP Address**: Local IP or assign a specific IP
* **Data Format**: JSON

### 2.2. Data Format

{% code overflow="wrap" %}

```json
{
    "ctrl": { // character name
        "LeftHand": [ // 
            {"Name": "Vibrators","Value": 0}, // vibrators number ( (int)0~3 );0-none,1-vib1,2-vib2,3-both
            
            {"Name": "Duration","Value": 0.04}, // time value ( (float)0.04~2.5 )
            
            {"Name": "Amplitude","Value": 4} // intensity value ( (int)4~10 )
        ],
        "RightHand": [
            {"Name": "Vibrators","Value": 2}, // vibrators number ( (int)0~3 );0-none,1-vib1,2-vib2,3-both
            
            {"Name": "Duration","Value": 1}, // time value ( (float)0.04~2.5 )
            {"Name": "Amplitude","Value": 4} // intensityvalue ( (int)4~10 )
        ]
    }
}
```

{% endcode %}

### 2.3. Parameter Description

* **Vibrators**: Vibration motor ID (0-3), Vibrator 1 is under the buttons and Virbrator 2 is under the joystick
* **Duration**: Vibration duration (seconds)
* **Amplitude**: Vibration intensity (4-10)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://udexreal.gitbook.io/udexreal-docs/glove-data-c++-python-sdk-for-robotics/vibration-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
