Try It Out
Site: | GoLabs |
Course: | Robotic Challenges with Python and GoPiGo |
Book: | Try It Out |
Printed by: | Guest user |
Date: | Thursday, 21 November 2024, 6:45 PM |
Description
This is the fifth challenge within the Robotics with GoPiGo and Python Curriculum.
Your task is to design a robot program to deliver a selection of mail to the residents of GoPiGo Drive, a small cul-de-sac containing 3 houses.
Learn how to how to use and calibrate the color sensor.
1. Set Things Up
- Clear the courier’s memory
- Run your code by selecting Restart Kernel and Run All Cells from Jupyter’s Kernel menu.
- Calibrate the line follower and color sensor in the current environment.
- Place the courier at the delivery depot, facing towards the houses, with the line follower centered over the black line.
2. Read the Address
- Choose a card to deliver.
- Place the color marking under the color sensor
- Click on the Read Address button.
Do the postman’s eyes light up the same color as the card? If not, check & fix your code and try again.
3. Deliver the Package
Place the package to be delivered in the package holder and click on the Deliver Letter button in the notebook.
Does the courier :
- navigate the delivery route,
- deliver the package to the correct house
- and successfully return to the depot?
If not, check & fix your code and try again.
4. Make Adjustments
If the courier loses the line on a corner, try reducing the motor speed and/or adjusting the multiplier for the proportional controller.
5. Test the Code Again
Repeat the address reading and delivery steps until all 3 cards are successfully delivered.
6. Test for the Failure Cases
With the courier waiting at the delivery depot, click on the Deliver Letter button in your notebook without giving the postman a card to read first.
Does it attempt to deliver to one of the houses?
If so, why do you think this happens?
If necessary, fix your code so that it prompts you to present it with an address to read first when you forget to do so.
7. Success!
You have successfully completed the Courier mission. All packages and letters have been delivered and everyone is happy with your service!
If there is any time left, you can try your hands at the extension challenges: