Services Quiz - how to implement the "sides" length requirement

Hi There,

Apologies for the constant questions. Really enjoying the course and I have learnt loads!

My question is about the services quiz. I understand how the logic works and I have implemented the solution for the most part. My confusion is surrounding the side variable. How are we meant to use this to extend the length of the square. Are we meant to be using a time delay, so the larger the time delay, the longer the time between publishing movement and publishing stopping movement for each side of the square. Or are we meant to be using a sensor I am not aware of to measure distance.

Best wishes,


Hi @j.nash,

Thanks for the feedback.

We are not expecting anything complex, just let the robot move for more x seconds according to the side variable before stopping it.

Another hint your might find useful is moving slowly and stopping the robot before each turn.

All the best in the quiz!

1 Like


Thank you for your response. I guess my question is how do you use a timedelay in C++ without the windows delay() in order to keep the robot moving for x seconds.

Best wishes

Try ros::Duration()::sleep(). For example ros::Duration(0.5)::sleep() pauses execution for 0.5 secs.