Metadata-Version: 2.4
Name: nibotics-hand
Version: 0.1.0
Summary: Python API/SDK for Nibotics NI-PRVS01 Dexterous Hand
Home-page: https://github.com/Nibotics/nibotics-hand-python
Author: Nibotics GmbH
Author-email: Nibotics GmbH <rohith.vadigineni@nibotics.com>
License: BSD-3-Clause
Project-URL: Homepage, https://nibotics.com
Project-URL: Repository, https://github.com/Nibotics/nibotics-hand-python
Project-URL: Documentation, https://github.com/Nibotics/nibotics-hand-python#readme
Keywords: robotics,dexterous hand,nibotics,NI-PRVS01
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pyserial>=3.5
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Nibotics NI-PRVS01 Python SDK

Python API/SDK for the **Nibotics NI-PRVS01** — a 7-DOF dexterous robotic hand with 24-channel pressure sensing, 14-channel microphone array, and IMU.

---

## Hardware Overview

| Feature | Specification |
|---|---|
| DOF | 7 actuated (11 joints) |
| Fingers | 5 (Pinky, Ring, Middle, Index, Thumb) |
| Pressure sensors | 24 channels |
| Temperature sensors | 24 channels |
| Microphones | 14 channels (mic1: 8ch, mic2: 6ch) |
| IMU | 3-axis accelerometer + gyroscope |
| Interface | USB Serial (115200 baud) |
| Firmware | Auto-detected (19 or 24 channel) |

---

## Installation

```bash
pip install nibotics-hand
```

Or install from source:

```bash
git clone https://github.com/nibotics/nibotics-hand-python.git
cd nibotics-hand-python
pip install -e .
```

---

## Quick Start

```python
from nibotics import NI_PRVS01

# Connect to hand
# Windows: use COM port  e.g. COM3, COM6, COM7
# Linux:   use /dev/ttyACM* e.g. /dev/ttyACM0, /dev/ttyACM1
hand = NI_PRVS01('COM6')        # Windows
hand = NI_PRVS01('/dev/ttyACM0') # Linux
hand.connect()

# Move a single finger
hand.move('pinky', position=4095, speed=100)

# Move all fingers
hand.move_all(
    positions=[4095, 4095, 4095, 4095, 2000, 2000, 2000],
    speeds=[100] * 7
)

# Read sensors
data = hand.read_sensors()
print(data.pressure)      # dict per finger
print(data.temperature)   # dict per finger
print(data.imu.accel)     # {'x': ..., 'y': ..., 'z': ...}

# Disconnect
hand.disconnect()
```

---

## Gestures

```python
hand.open()          # all fingers open (position=0)
hand.close_all()     # all fingers closed (position=4095)
hand.fist()          # full fist
hand.pinch()         # pinch grasp
hand.point()         # index finger extended
hand.thumbs_up()     # thumb extended, fingers closed
```

---

## Motor Control

The hand has **7 motors**:

| Index | Motor | Range |
|---|---|---|
| 0 | Pinky | 0 – 4095 |
| 1 | Ring | 0 – 4095 |
| 2 | Middle | 0 – 4095 |
| 3 | Index | 0 – 4095 |
| 4 | Thumb radial extension | 0 – 4095 |
| 5 | Thumb flexion | 0 – 4095 |
| 6 | Thumb grasp | 0 – 4095 |

Speed range: **0 – 250**

---

## Sensor Data

```python
data = hand.read_sensors()

# Pressure (hPa) per finger
data.pressure['pinky']   # list of sensor values
data.pressure['ring']
data.pressure['middle']
data.pressure['index']
data.pressure['thumb_radial_extension']

# Temperature (°C) per finger
data.temperature['pinky']

# Motor feedback
data.positions  # list of 7 current positions
data.speeds     # list of 7 current speeds

# IMU
data.imu.accel  # {'x': ..., 'y': ..., 'z': ...}
data.imu.gyro   # {'x': ..., 'y': ..., 'z': ...}
```

---

## Sensor Callbacks

```python
def on_data(sensor_data):
    print(sensor_data.pressure)

hand.on_sensor_update = on_data
hand.connect()
```

---

## Context Manager

```python
with NI_PRVS01('/dev/ttyACM0') as hand:
    hand.fist()
    hand.open()
```

---

## Repository Structure

```
nibotics-hand-python/
├── nibotics/
│   ├── __init__.py        # Public API
│   ├── hand.py            # NI_PRVS01 main class
│   ├── protocol.py        # Binary serial protocol parser
│   ├── definitions.py     # Protocol constants & PAGE_MAP
│   └── sensor_data.py     # SensorData / IMUData dataclasses
├── tests/
│   ├── unit/              # Unit tests
│   └── integration/       # Hardware integration tests
├── examples/              # Usage examples
├── pyproject.toml
└── setup.py
```

---

## Requirements

- Python ≥ 3.8
- pyserial ≥ 3.5

---

## License

BSD-3-Clause © Nibotics GmbH

---

## Contact
Rohith Anju Nath Vadigineni- rohith.vadigineni@nibotics.com

- **Website:** [nibotics.com](https://nibotics.com)
- **Email:** rohith.vadigineni@nibotics.com
- **Repository:** [github.com/nibotics/nibotics-hand-python](https://github.com/nibotics/nibotics-hand-python)
