Extra – A Robot that rescues a “Person” from a “Swamp”.

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?

A sample RoboCup Junior Rescue Arena.
A sample RoboCup Junior Rescue Arena.

 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.

Line Follow EV3-G using one EV3 color sensor
Line Follow program using EV3-G and one EV3 color sensor

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 using EV3-G and one color sensor

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:-

Diagram of EV3-G rescue code
Diagram of EV3-G rescue code

When your Robot is following a line, the computer in the EV3 computer brick follows this path through the code:

Line Follow EV3-G rescue code diagram
Line Follow EV3-G rescue code diagram

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:

RoboCup Junior Rescue EV3-G SUMO code
RoboCup Junior Rescue EV3-G SUMO code

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.

Code for EV3-G RoboCup Junior Rescue, line following and SUMO code combined
Code for EV3-G RoboCup Junior Rescue, line following and SUMO code combined

Experiment! Have fun!

Arenas

Free Line Mazes & arenas can be downloaded from https://drgrae.me/lesson/maze-3/ . A commercial RoboCup Junior arena can be purchased from  MTA.

4 thoughts on “Extra – A Robot that rescues a “Person” from a “Swamp”.”

Leave a Reply

Your email address will not be published. Required fields are marked *