Drive Square

Project 1 Activity

Instructions

In this activity you will use iteration to drive the robot in a square. Complete the following:

  • Implement drive square in p1_wall_follower/1_drive_square.cpp so that the robot performs the behavior specified below.

You’ll need to use the MBot Bridge API to send drive commands.

  • Hint: Use the robot.drive(vx, vy, wz) function to move the robot.

Expected Behavior

The robot should drive in a square three times. Aim for a sidelength between 0.5 and 1 meters.

Testing

There are no unit tests for this checkpoint.

The robot behavior can be tested by running the drive_square executable.