The loop will be executed very fast (more than 100k requests per seconds on my computer). The robot is overflooded and cannot follow thes commands.
When you add a “print 1”, the consol output slow a lot the inner loop, it’ll will work a bit better.
The best is to add a time.sleep(0.05) in the loop.
To continue en @Theo answer, I think what is actually happening is as your while loop will run at an extremely high frequency (nothing inside it should take more than a few µs), the scheduler will never have the opportunity to switch to another thread as the synchronisation thread for instance. Thus, you order will actually be never sent to the robot. The print that you are using in the second example as it is making a sys call, gives the scheduler an opportunity to switch to another thread.
I’m actually pretty sure that the behaviour of your program will vary a lot depending on the OS you are using. Nevertheless, it’s never a good idea to have such tight loop in your program it will use 100% CPU doing nothing. In your case having this loop run at more than 50Hz will not have any effect as the synchronisation loop are running at 50Hz.
Thanks for your answer, it is the solution. I did not understand since I ran the script on windows, and all was OK…
So now I understand it is not an issue on the ODROID.
Nevertheless I have another issue, I open a new subject for this.