4.4 Topics Quiz mistake in subject or solution

We have got this instruction in the subject:

  1. obstacle closer than 1 meter in front of the robot), the robot will move forward.
  2. If the laser reading in front of the robot is lower than 1 meter (there is an obstacle closer than 1 meter in front of the robot), the robot will turn left.
  3. If the laser reading at the right side of the robot is lower than 1 meter (there is an obstacle closer than 1 meter at the right side of the robot), the robot will turn left.
  4. If the laser reading at the left side of the robot is lower than 1 meter (there is an obstacle closer than 1 meter at the left side of the robot), the robot will turn right.

But in the solution we have:

  //If the distance to an obstacle at the left side of the robot is smaller than 0.3 meters, the robot will turn right
  if (msg->ranges[719] < 0.3)
  {
    linX = 0.0;
    angZ = -0.2;
  }
  //If the distance to an obstacle at the right side of the robot is smaller than 0.3 meters, the robot will turn left
  if (msg->ranges[0] < 0.3)
  {
    linX = 0.0;
    angZ = 0.2;
  }

1 meter and 0.3 meters. Please fix it. The behavior in the gif is different than in the subject.

Hey Mi,

Thank you for pointing that out. I apologize for the confusion.

We’ll look into it.

We have updated the solution notebook so that it conforms with the instructions.