API Documentation
📚 API Documentation
This document provides a complete API reference for pyvitaisdk, including all features for device management and sensor data acquisition.
🎯 Feature Overview
pyvitaisdk mainly provides the following two categories of functions:
🔍 Device Management
Find, enumerate, and manage connected vision-based tactile sensor devices through the VTSDeviceFinder class
📊 Data Collection
Collect multi-dimensional data including images, depth maps, Marker displacement, slip state, etc. through the GF225 class
📖 API Directory
🔍 VTSDeviceFinder Class - Device Management
Core class for finding and managing Vitai vision-based tactile sensor devices.
| Method Name | Description | Return Type |
|---|---|---|
| VTSDeviceFinder() | Instantiate device finder class | VTSDeviceFinder |
| get_devices | Get list of all connected devices | List[VTSDeviceConfig] |
| count | Get count of currently connected devices | int |
| indexes | Get index list of all devices | List[int] |
| get_sns | Get serial number list of all devices | List[str] |
| get_device_by_sn | Get specific device by serial number | Optional[VTSDeviceConfig] |
📊 GF225 Class - Sensor Operations
Core class for operating GF225 model vision-based tactile sensors, providing data acquisition and processing functions.
| Method Name | Description | Return Type |
|---|---|---|
| GF225 | Instantiate GF225 sensor class | GF225 |
| calibrate | Perform sensor calibration | None |
| collect_sensor_data | Collect vision-based tactile data from sensor | dict |
| release | Release resources occupied by sensor instance | None |
🚀 Quick Start Examples
Basic Example: Find Device and Collect Data
from pyvitaisdk import VTSDeviceFinder, GF225, GFDataType
# 1. Find devices
finder = VTSDeviceFinder()
devices = finder.get_devices()
if not devices:
print("❌ No devices found")
exit(1)
print(f"✅ Found {len(devices)} device(s)")
# 2. Initialize sensor
sensor = GF225(devices[0])
# 3. Calibrate sensor
print("📸 Calibrating sensor...")
sensor.calibrate()
# 4. Collect data
data = sensor.collect_sensor_data(
GFDataType.WARPED_IMG,
GFDataType.DEPTH_MAP,
GFDataType.SLIP_STATE
)
# 5. Process data
warped_img = data[GFDataType.WARPED_IMG]
depth_map = data[GFDataType.DEPTH_MAP]
slip_state = data[GFDataType.SLIP_STATE]
print(f"Image size: {warped_img.shape}")
print(f"Slip state: {slip_state.name}")
# 6. Release resources
sensor.release()
print("✅ Done")
Advanced Example: Multi-device Management
from pyvitaisdk import VTSDeviceFinder, GF225
# Find all devices
finder = VTSDeviceFinder()
# Get device serial numbers
serial_numbers = finder.get_sns()
print(f"Device serial numbers: {serial_numbers}")
# Use device with specific serial number
if serial_numbers:
device = finder.get_device_by_sn(serial_numbers[0])
sensor = GF225(device)
sensor.calibrate()
# ... use sensor ...
sensor.release()
💡 Usage Tips
- Exception Handling: Always use try-finally to ensure
release()is called - On-demand Collection: Only request needed data types to improve performance
- Avoid repeatedly creating and releasing sensor instances when collecting data in a loop
- Use appropriate output resolution to balance performance and accuracy
- Consider using multiprocessing for multiple sensors
- Forgetting to call
calibrate()will result in inaccurate data - Not calling
release()may prevent the device from being opened again - Sensor surface must be free of contact during calibration
📚 Detailed Documentation
Click on any method name in the API directory above to view detailed parameter descriptions, return values, sample code, and notes.
🆘 Get Help
If you encounter any issues during use:
- View API Documentation - Click on specific methods to learn detailed usage
- View Sample Code - Each API provides complete examples
- Contact Technical Support - Get help through the official website
🎉 Get Started
Now that you understand the basic structure of the API, click on the method names above to view detailed documentation and start your development journey!