Unit 3 Topics Quiz Specifics

I submitted the quiz and got green on everything except for the last 2 points, which the graderbot docked because my robot apparently did not avoid the sphere the way it wanted it to. My robot never touched the sphere or any walls. Right now, every time the subscriber gets information from the scan, I go through all the values from the front of the robot to the right side of the robot and make it turn left if any of them are less than 1. If none are less than 1, it moves directly forward. Can anyone shed light on what specifically the quiz is asking for so I can get these last few points?

Hi,
I did the same, also checking a group of rays instead of a single ray. The grader is programmed a bit poorly in that regard. It’s not checking whether you avoid the sphere but rather whether you did the exact same thing as in the solution.
Instead of checking all values only check one angle per direction, see last post here. Remeber to also check the left side though.

Hm. I see. Reason I did a for loop was I thought a single publish to turn wouldn’t turn it enough to completely avoid the obstacle. Guess I’ll work out a wait time of some sort. Thank you for the help.

In the /scan callback set some attribute of you class e.g. left_distance, right_distance, front_distance with the value of the corresponding ray. Then from the callback call your function that computes and publishes the cmd_vel commands based on this.
Alternatively, you can call the function that sends the commands based on a timer.
No need to wait for anything.

This definitely worked. But it’s oddly specific. To the point it docked me when I used the values 179, 359, and 539, but passed me when I simply changed them to 180, 360, and 540. Thank you regardless. On to new things!

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