ROS Basics in 5 Days (Python): Services Quiz

Hello,
I have a question regarding the services quiz in the Course: ROS Basics in 5 days (python). I programmed the whole task, the grading bot finds the service server and client, as well as the message and the launch files. This gives 7 points. However, the movement is classified as not okay. This seems strange, since I use an approach where the service controls the movements by means of odometry. The distance traveled is monitored as distance between initial position and current position.
The rotation angle at the corners is also controlled. In the sim the bot drives nice squares…
The server prints the traveled distances for each leg of the squares. In my first attempts the client asked for side length of 1.0 and 1.5 m, (1.0 and 2.25 square meters). In the last, 4th attempt the side length was set to 1.2 and 2.1 m. So the area constraints should be fulfilled. For the larger square in the last attempt the server reported driven side length of:
Repetition: 1
Leg: 1 Travelled distance: 2.119 m
Leg: 2 Travelled distance: 2.122 m
Leg: 3 Travelled distance: 2.111 m
Leg: 4 Travelled distance: 2.117 m
The travel time was well below 3 min.
So where was the problem with the shape? Do you have an idea what could be the problem? I do not want to waste the last try.

With kind regards
Stephan Neser

Hi @SteveHda

Did you consider the definition of “square meter” given in the notes? Please see the diagram below. You might need to speed up your robot a bit and ensure the robot covers the given squares.

image

Dear bayodesegun,

for a side parameter of 1 my robot drives exactly on the boundaries of the red square, where the starting position one of the corners of the square. Following my post yesterday I also measured (via odom) the mismatch between initial and final position which is on average below 2 cm in x and y axes.
For a square of 2 square meters I would have to travel a side length of sqrt(2) meters. Since in the task there is only the request that the first square is bigger than 1 square meter and the second one is bigger than 2 square meters, I drove the robot a square of 1.5 m side length, which is with 2.25 square meters and clearly fulfills the > 2 square meters condition. What is a little bit frustrating, is that I have to meet conditions which are not clearly defined. The instructions only request a “squarish” shape and a bigger than a certain area square. My trajectories clearly fulfill this conditions, yet they are still rejected.
Maybe you could help me out here. (Time was not the issue, the bot needs under two minutes to finish.)
With kind regards
Stephan Neser

Hi again Steve,

Please take note of the following:

  1. The instruction says “at least” (>=). I believe that is not the same as “more than” (>). So, if you use 1 square meter and 2 square meters it should be good.

  2. For 1 square meter, the robot would cover a single square tile (as shown in the image in the notes). For 2 square meters we expect 4 squares.
    image

  3. Did you consider that the small square has to be done twice while the bigger square is done once?

PS: It looks like you are complicating things with the calculations. You just need to make the robot draw squares whose side is at least as long as the ones shown above.

Hi again bayodesegun,

thank you for your patient support! Now it worked correctly. I missed that I had to drive the first square twice. That did the trick…

I know, that my solution based on /odom is a little over the top for this task, I just wanted to try whether I am able to do it :wink:

However one final comment: the second square has 4 times the area of the first one. So if the first one has an area of 1 square meter, than the second one has 4 square meters, not two. Shouldn’t it be 2 meters square? Maybe it would be better to talk of squares of side length one and two meter, then it would be unambiguous?

Thanks again!

Stephan

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.