Refactored the communication protocol with the real robot (thanks to Olivier)