Service quiz: how did you ensure 90 degrees?

I spent a long time working on ensuring 90 degrees for a perfect square trajectory. I wanted to use /odometer topic to subscribe yaw but didn’t succeed. At last I used a dumb method to pass the quiz reluctantly. but when I open the solution, I found the solution code is using a similar method too lmao. How did you know that angular velocity of 0.2 and 4 secs would generate 90 degrees?

btw there’s a bug in the solution’s cpp file:

int reps = req.repetitions
  for (int i=0; i < repetitions; ++i)

the first line missed a semicolon and the variable repetitions in the second line should be reps.

1 Like

Hi @wangxiaolong0830

I spent 2-3 days at this chapter as well, when I originally did it. I managed to solve the perfect 90°. However the easiest way is a slow turn rate and a fixed time. The issue arises, when you try to turn too quickly.

If you do want to do it perfectly, you can use odometry or IMU (dont remember which one I used). It is much more complicated and stuff you learn later in the course.