erdnaxe / kraby

Documentation and ressources of Kraby, an open-source hexapod robot
https://kraby.readthedocs.io
MIT License
12 stars 4 forks source link

Sometimes socket.recv does not receive the full message #8

Closed erdnaxe closed 4 years ago

erdnaxe commented 4 years ago
Traceback (most recent call last):
  File "herkulex_socket.py", line 140, in <module>
    print(h.get_observations())
  File "herkulex_socket.py", line 112, in get_observations
    pos = ret[9] + ((ret[10] & 0x3) << 8)
IndexError: index out of range

This may be fixed by adding a loop on reception.