I’m using HAPLY Inverse3 and versegrip. I connected those to PC with USB cable, and I found out that python_samples (Haply / Public / python_samples · GitLab) 01_open_device~06_ball.py works well. It means my PC is getting data from connected Inverse3.
However, i cannot read information of my versegrip with 14_read_versegrip_info.
When running 11_13.py the log is
Traceback (most recent call last):
File “d:\SNUCEM\Haply\python_samples-main\13_visualise_handle.py”, line 40, in
com_stream = HaplyHardwareAPI.SerialStream(connected_devices[0])
~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range.
And when i run 14_versegrip_info.py, the log is below:
[‘COM5\x00’]
{‘device_id’: 0, ‘quaternion’: [0.0, 0.0, 0.0, 0.0], ‘error_flag’: 99, ‘hall_effect_sensor_level’: 0, ‘buttons’: 0, ‘battery_level’: 0.0}
{‘device_id’: 0, ‘quaternion’: [0.0, 0.0, 0.0, 0.0], ‘error_flag’: 99, ‘hall_effect_sensor_level’: 0, ‘buttons’: 0, ‘battery_level’: 0.0}
{‘device_id’: 0, ‘quaternion’: [0.0, 0.0, 0.0, 0.0], ‘error_flag’: 99, ‘hall_effect_sensor_level’: 0, ‘buttons’: 0, ‘battery_level’: 0.0}
How can I get pos,rot infomation correctly with my versegrip?
Thank you
Best regards
Hello @Seungmin I’m missing some information but I’m going to take a guess at what the issue is here. Lets try a couple things together.
Haply used to provide a library called HaplyHardwareAPI and to improve our products robustness we switched away from the API and moved to a Service that runs on your machine. The service haply-inverse-service is part of the Haply Hub.
If you install the Haply Hub and it is running, the old HaplyHardwareAPI will not have access to devices if they have already connected to the newer service. The service connects pretty quickly.
These same sample code tutorials are installed on your machine when you installed the Haply Hub. Go to C://Program Files/Haply/Inverse/tutorials and here you will find the cpp version of some of the tutorials. The ReadMe file will describe how to get started with cpp.
The service is network based approach to device connection so even though these samples are in Cpp, you can use any language that will let you POST / GET .
If there is a reason that you are purposely trying to use the old library and absolutely do not want to use the newer supported service. You can go into the Haply Hub settings, click “Disable Service” and then your code should connect and show the readings.
If neither of these work, let me know and we can dig a little deeper.