Learn 3: Create Your First Class
4. Reset Method
To allow us to reset the courier’s state on demand, let’s also create a reset() function that performs the following functions
- close its eyes
- set the motor speed
- clear the emergency stop flag
- take an initial position reading from the line follower
def reset(self):
courier.close_eyes()
courier.set_speed(courier.DEFAULT_SPEED)
self.emergency_stop_flag = 0
self.position = line_follower.position_val()
Be certain that the indentation matches that of the init() method!!!