A Robot Rescue Challenge.
In a Tasmanian Challenge similar to an Australian RoboCup Junior competition, brave robots follow a line, defeat lots of obstacles, and finally go into a “swamp” to rescue a “person” by pushing them out of the “swamp”. Can we teach our Robot to do this?
Following the line towards the “swamp”.
We already have some code that we can use to teach our robot to “follow a line” using one EV3 color sensor (see: https://drgrae.me/lesson/follow-the-edge-of-a-line-4/), as shown below.
Pushing the person out of the swamp.
We already have some code that we can use to push the person out of the swamp, (see: https://drgrae.me/lesson/sumo-4/ ). We can re-use our SUMO code to push the person out.
EV3 SUMO Robot code using EV3-G and one color sensor
Combining “Line Following” and “SUMO” code.
To be able to combine these two pieces of code, we need to be able to tell our robot to:
• Use the “line following” code until it reaches the silver strip at the edge of the swamp,
• Go into the center of the swamp, and then
• Start using the SUMO code to push the person out of the swamp.
We can use a “Switch” command to do this. Diagrammatically, the “Line Following” and “SUMO” code can be combined in this way:-
When your Robot is following a line, the computer in the EV3 computer brick follows this path through the code:
When your Robot sees the silver strip at the start of the swamp, the computer in the EV3 computer brick follows the path below into the SUMO loop of code, as shown below:
You will need to experiment with the motor power settings in the combined code below to be able to teach your Robot to go around the Rescue Course and push the person out of the swamp. Don’t forget to put an extra “Move Tank” command in before the SUMO loop, to move your Robot from the silver paper, in towards the center of the swamp. You may also need to change the ≥ sign in the SUMO code to ≤ , because the swamp has a white surround, rather than the black surround we used in the previous SUMO Challenge.
Experiment! Have fun!