Python with Robots! #427
jdonwells
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
This is so cool!! I'm not sure the age group you have but man what I would have given to have this at any point in my education. Congrats on being a great teacher that adapts to keep kids involved. Only way to make this cooler is if you have a battlebot tournament or obstacle course at the end of it. Haha. Best! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Getting our kids engaged in the lessons is always a problem. Some are not inspired by the projects. Some think they already know too much to do such simple projects. Robots to the rescue.
What I am looking at is adding an alternate unit project for each unit (except 1 and 5) that uses a robot.
The robots I am using are the DFRobot Maqueen Plus V2. There are many Maqueen versions, some cheaper. I find the Plus V2 to be the most expandable and useful even at a higher cost. With batteries and BBC micro:bit control boards they come out to about $80 each.
There are now two versions of the V2 robots. V2.0 was available up till the beginning of the 23-24 school year. After that you will be getting the V2.1 robots. I had a mix of V2.0 and V2.1 robots but I was able to replace them with all V2.1. Because of that I am changing the example and starter code to only work with V2.1 robots. If you have V2.0 robots contact me. The version is printed on the main board.
For unit 2 I am offering this unit project. A robot pet. There is a pull ahead in this project. They will need a while True loop. This is a simple project. Less difficult than the Zork game. Hook them on the promise of easy assignments then bait and switch.
https://docs.google.com/presentation/d/1haIAb3aTApqLtofnlR9ISrMnT5Rx1-oF4CVxumj0a-c/edit?usp=sharing
Starter code: https://drive.google.com/file/d/151c4uQaqo3sVelOWQUGNtXYMdLsAsrMj/view?usp=sharing
Example solution: https://drive.google.com/file/d/156ey1SCd1ubwPjuh7JxcxMW-hIbVWQnd/view?usp=sharing
For unit 3 a line following robot. This uses the ubiquitous PID algorithm that real robots would use. We don't want it to be too easy for advanced students. Again they will need to pull ahead the while True loop. This project doesn't use lists. There is however complex logic and math.
https://docs.google.com/presentation/d/1QdxlaT2WuEbwisWb3d1CxsuiMVr19kL6_wUgoftC0sw/edit?usp=sharing
Starter code: https://drive.google.com/file/d/15ENRU5eDI1Ti1hefraTgiV_XM9eMDDKA/view?usp=sharing
Example solution: https://drive.google.com/file/d/15ChC8mjP5fc4LnvhQ6uxHteSPp3vf9Vi/view?usp=sharing
Unit 4 is where it gets harder. They will create a robot that follows a list of commands as it traverses a grid of horizontal and vertical lines. This project does use a list. This project will need many loops. There are several issues for them to overcome. They must have a way to input commands of left, right, or straight. They must follow the lines and turn 90 degrees left or right while staying on the lines.
https://docs.google.com/presentation/d/1OKUwC0AQsRntP7xivtDmj6kUANg1PNq3kH6ClYcMdtQ/edit?usp=sharing
Starter code: https://drive.google.com/file/d/13m9yKpoW248QaeqkIG_ugzWVkc_014W2/view?usp=sharing
Example solution: https://drive.google.com/file/d/13dru4exgAoZ55D_UXzh3lC60bdEGEDkG/view?usp=sharing
I always skip unit 5. Some students are not allowed to create music on their computer for religious reasons.
In unit 6 we will solve a maze using the simplest algorithm available: The Left Hand Rule. It is not guaranteed to solve every maze, but a 3x3 grid is fine. To make this project more complex we will require them to track the robot's position in the maze and detect when the maze is solved. This requirement leads us into being able to make a map in the next unit.
https://docs.google.com/presentation/d/1LtEZNOGMg9xo-R_uvRkeaCwQAEwMQd16iwOTx72A8rw/edit?usp=sharing
Starter code: https://drive.google.com/file/d/14rmti-I4mnp208wAk-g2peoeikzflEsg/view?usp=sharing
Example solution: https://drive.google.com/file/d/14gMGZo7_3iIG88453RIhHKD3m1vafknl/view?usp=sharing
Unit 7 requires our students to map the maze. They will be given a 3x5 grid this time. There are numerous ways to store a map, but arrays of arrays will probably be the top choice. They may still use the Left Hand Rule to solve the maze, but they should not require the outer walls to be placed. The map must start with the outer walls as given and the robot will avoid going off the map.
https://docs.google.com/presentation/d/1o4KQ5bfnSIlNc65rD_72ZWUREnXVEOex5qqJ8m41r4A/edit?usp=sharing
Starter code: https://drive.google.com/file/d/15FqOFU2inu0Xb8GS6NjTjLawfrDN1jDf/view?usp=sharing
Example: https://drive.google.com/file/d/15F-R1OCYmyeM2S5GkyunfjH2XNa0YTAb/view?usp=sharing
The final project will be the ultimate maze solver. Building on Unit 7 we will add a new algorithm to find the best path given a map or partial map of the maze at each decision point. They need to be able to run the maze a second or third time using the optimal path. The algorithm they will use is Flood Fill. This is the algorithm of choice in the micromouse competitions.
https://docs.google.com/presentation/d/14HrUn2GIsNluXFs-dTMWauBy5c2ZywZgYlWJWp79JbA/edit?usp=sharing
Starter code: https://drive.google.com/file/d/15otLgspa0SI0yeNDJ-nOutOMHhg1bgML/view?usp=sharing
Examples
curious robot: https://drive.google.com/file/d/15_wRjnweJKbzjCR57OXB3B3peQ7wfLLd/view?usp=sharing
lazy robot: https://drive.google.com/file/d/15SQKNuZpmMPjfsLe5E1HpyjXz08x_crb/view?usp=sharing
The final project could include a competition to be run as a micromouse competition. The rules are summarized as follows.
Beta Was this translation helpful? Give feedback.
All reactions