The hexapod communicates with a desktop system via a self-developed TCP-protocol. The protocol provides commands for controlling the hexapod and transferring sensor data.
The server, developed with Python, gets executed on the Hexapod. A separate thread reads the received commands from the client continuously. The step orders from the client are sent to the linux system and the hardware via the drivers. Every sensor of the hexapod has a thread. These threads read the data and send it to the client with the protocol.
The client, also realised with Python, reads the data and converts it in a more useful dataformat. For instance, accelerometer data gets filtered with a Madgwick Filter in order to get the current orientation of the hexapod. Periodically the most recent data gets fed to the AI, which calculates the next step.
In order to reuse the results from the simulation in the real world, a wrapper is available to exchange simulation model and real Hexapod quickly.