Hi @236238,
I would suggest that you keep things simple here. I think the idea is that you want to move the robot for some given seconds and then stop it:
- You can just use
time.sleep(duration)
. It may not be 100% accurate as per the simulation as @simon.steinmann91 mentioned but it should be fine for this simple case. - Keep your code simple, as suggested by @simon.steinmann91. You don’t need that while loop.
- Here’s a post about how to ensure your robot moves at the very first command:
How to publish once (only one message) into a topic and get it to work
Please let me know if you need further clarifications.
By the way, welcome to the Community!