[Bug] robot for problem 3 successfully avoided obstacle

This is an error report.


Screenshot of the error


Error details

the grader indicated that my robot is NOT avoiding the obstacle . this is not the case. i am successfully avoiding obstacle.

Hello @iskrishnas ,

You were using very high velocities in your program logic, especially for angular velocities (10 and 20 radiants/s). This was causing some unexpected scenarios in our autocorrection system, thus marking it as incorrect. If you reduce the velocities to something like this it should pass OK:

// Modified logic as per requirements:
    if (front_reading > 1.0) {
      twist_msg.linear.x = 0.25; // Move forward
    } else if (front_reading < 1.0) {
      twist_msg.angular.z = 0.5; // Turn roght
      twist_msg.linear.x = 0.01; // stop
    }

    if (right_reading < 1.0) {
      twist_msg.angular.z = -0.5; // Turn left
      twist_msg.linear.x = 0.01;  // stop
    } else if (left_reading < 1.0) {
      twist_msg.angular.z = 0.5; // Turn right
      twist_msg.linear.x = 0.01; // stop
    }

Hope this helps,

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