Skip to main content

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 NameDescriptionReturn Type
VTSDeviceFinder()Instantiate device finder classVTSDeviceFinder
get_devicesGet list of all connected devicesList[VTSDeviceConfig]
countGet count of currently connected devicesint
indexesGet index list of all devicesList[int]
get_snsGet serial number list of all devicesList[str]
get_device_by_snGet specific device by serial numberOptional[VTSDeviceConfig]

📊 GF225 Class - Sensor Operations

Core class for operating GF225 model vision-based tactile sensors, providing data acquisition and processing functions.

Method NameDescriptionReturn Type
GF225Instantiate GF225 sensor classGF225
calibratePerform sensor calibrationNone
collect_sensor_dataCollect vision-based tactile data from sensordict
releaseRelease resources occupied by sensor instanceNone

🚀 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

Best Practices
  • Exception Handling: Always use try-finally to ensure release() is called
  • On-demand Collection: Only request needed data types to improve performance
Performance Optimization
  • 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
Common Pitfalls
  • 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:

  1. View API Documentation - Click on specific methods to learn detailed usage
  2. View Sample Code - Each API provides complete examples
  3. 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!