A grade 3 student has been given a challenge for a competition and we are stuck on how to code this challenge. The challenge is to place the battle bot into a large black circular battle ring with a white line around the perimeter against another competitor. The first to get pushed out by the other loses. Here is what my students wants to do (if possible):
- hook up three cameras and train each that when it gets within 2cm (ish) of the white perimeter to retreat for 2 seconds and then turn about 45 degrees.
- recognise the other bot and charge to it. When contact is made, keep pushing.
- if it senses another bot pushing it to push back.
- is pushing towards white, do not stop pushing (so override the retreat when pushing).
- this all has to occur on its own. Student is only allowed to start program and then stand back so bot has to operate on its own.
- mainly its competitor are Lego Mindstorms, so we kinda want to beat them!
We know how to colour train and object train (but this doesn't always work, so hoping to find a colour on the other bot to lock onto instead, but need a backup plan). We know how to code forward and turns (where we left yesterday)
We are hoping that with three cameras, all three will be able to colour/object track, to make him more accurate...
And yes, this was a grade 3 student's idea!
Any help with how to program the code. The if/then blocks are not my speciality... yet... Competition is in 2 weeks. Will gladly share results and take video if we can figure this out
Amber (from Kelowna)
Hi Amber from Kelowna! Kudos to the grade 3 student being creative with awesome suggestions. Here's some answers to your question
The type of "robot battle" that you're referring to is "Sumo"
I have implemented a strict "no battle bot robot fighting" with ezrobot - and instead promote social and safety inventions with robotics that help society, not destroy it. I strong disagree with robots being programmed to fight. Using advanced technology for war-far or fighting is a taking steps back as a society. Maybe the student can be asked to invent an idea that helps society rather than destroys it? Here's some positive use-case ideas for robotics helping society:
Here's more detail:
Detecting the ring What i recommend is pointing the camera down toward the ground. Train the robot to recognize the white of the outside ring. When the white is detected, have the robot reverse for a second or two to avoid the ring. Turn around 180 degrees, and move forward again. The idea is ping-pong to bounce off the edges over and over until the robots run into each other and one pushes the other out.
Detecting the opponent Sumo robots don't actually detect the opponent. They simply keep moving back and forth within the ring hoping they run into an opponent. Due to the size of the ring and the opponent, the chances of running into each other are quite high. Usually the robot is approx 10% size of the ring, which gives the robot a 1:10 chance of colliding with the opponent.
Summary
I appreciate (and agree) with your perspective... it's that digital citizenship (responsibility) piece!
There is a big Robotics "tournament" at the local college, hence they set the activities. I will use your suggestions to learn how to detect, but suggest to the student to use these skills to enter the soccer game challenge. This one, they try to score on the opponent's net... similar programming concepts.
I also have a student entering the dance/theatre challenge, where JD will be re-enacting a scene from a movie.
Amber
Those are great objectives! They'll clearly take home the gold
I also don't condone bots for violence but in relation to the technical question of 3 cameras i assume you can always use more than 1 EZB in a project and UART or MQTT connect them so you can use more cameras just sending the results of the image color motion recognition to the primary EZB.
WOW, a no " battlebots" rule? but those are so cool watch. Seeing robots ripped to shreds and parts flying is so cool. Plus I'm a big fan of terminators just a matter of time and we will wipe ourselves out by the machine at the rate technology is going I think.
Sorry but if you have implemented a strict "no battle bot robot fighting" with ezrobot, then why is there a "battle bot" product available in your e-store?
I don't see much of a difference between pushing an opponent out of a ring versus flipping it.
Battle Flipper