A Python library for interfacing with ContactGlobe2 using OSC (Open Sound Control) protocol. This library provides tools to receive and process hand tracking data from ContactGlobe2 devices.
- Receive hand tracking data via OSC protocol
- Support for quaternion-based hand pose data
- Example scripts for both client and server implementations
- Easy integration with Python applications
- Python 3.6 or higher
- python-osc library
- ContactGlobe2 device and DivingStation software
-
Clone this repository:
git clone https://github.com/yourusername/OSC-contactglobe2.git cd OSC-contactglobe2
-
Install the required dependencies:
pip install python-osc
hand.py
- Example script demonstrating how to receive hand tracking datacontact_client.py
- Basic client implementationcontact_server.py
- Basic server implementationosc_client.py
- OSC client implementationosc_server.py
- OSC server implementationlibrary/
- Contains library modulescontact_server.py
- Server library implementationcontactglobe2_client.py
- Client library implementation
See hand.py
for a complete example of receiving and processing hand tracking data:
# Example of processing hand data
def print_message(address, *args):
version = int(args[0])
device_id = str(args[1])
is_left = bool(args[2])
# Process quaternion data for each finger joint...
# Set up OSC server
server = BlockingOSCUDPServer((ip, port), dispatcher)
print(f"Listening on {ip}:{port}")
server.serve_forever()
Update the following parameters in the scripts as needed:
- IP address and port for OSC communication
- Data processing callbacks
- Logging preferences
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.