# WRO Junior-High 2015. Treasure Hunt. Part 2. Rules ProPreview

We would look at the rules of the competition over our small model and we would start solving the field.

• #199
• 10 Apr 2016
• 7:15

The field of the competition is a great. On the different points of the grid we have treasures. What the robot must do is to collect all the treasures from the field.

### Complete playlist

Find the complete playlist atÂ WRO Junior-High 2015. Treasure Hunt

### WRO Box Collecting Robot

Building instructions for this LEGO Mindstorms EV3 robot used in the World Robotics Olympiad Junior competition

### Treasure hunt EV3-G program without arrays. Possible, but not recommended.

EV3-G program for the treasure hunt competition of the World Robotics Olympiad

### English

- In this video we continue with the World Robotics Olympiad 2015, Junior High Competition. And we'll look at the rules of the competition. We have a small model of the field here. And we'll continue with our robot. This was the robot built in the previous video and will detect some of the colors on the field and we'll try to initially start solving the field.

We have the model of the field, it's a small map. And we have the different treasures that are on the field and you that it looks like a grid. Now there are different colors right here on one side. This would be the east, the west side of the field and this is the east, and this is the north, and this is the south looking from my perspective. And on this field we have a grid and this grid has many points. And on these points we might have different treasures. We have five treasures on the whole field. And different treasures are positioned on different places. Here on the west side we have 1, 2...we have 10 different colors. And this is the code, and we use this code to know what are the positions of the different rows and columns. And it goes like this; first we move and we see yellow. It's yellow and it's right here. Let me just show it to you. It's yellow. This means that the first column, the color of the first row is yellow. Then we detect red. This means that the color of the second row is red. Then we see that it is blue and green and this means that this row is blue and this row is green. So these are the colors of the different rows, yellow, red, blue, and green. Then these are the first four colors in the code then we detect the next four colors. And in the next four colors we see blue. This means that the first column is blue, second yellow. The second column is yellow, third red and fourth green. And we now know the colors of the different rows and the different columns. And this is something that's configured before the competition. And these are the first eight colors. Then the competition goes the following way, we detect column, we detect row and column. And because the two colors are yellow, yellow. And this means that we must go to the intersection between the yellow row and the yellow column. And we see yellow row, yellow column, somehow the robot must get from this position of the field, the west to this intersection. And here it will find a treasure. And this treasure will have a color. The color of this treasure might be red, we don't know. But when the robot goes to the place and takes the treasure, we'll see the color. Then it lifts the treasure and below the treasure there's another color. And this gives us the row and the column where we should go next. For example if we have the treasure that's red and below the treasure we have blue. This means that we must go to the red row and blue column. And this would be this intersection here so the robot must find its way from here to the next intersection then detect again the treasure and below the treasure and move to the next intersection and the next and the next. And it must collect five treasures and return these treasures. So that's the goal of the mission. It's a very interesting mission and it's not very simple. I would say that it's with the medium complexity but it's quite interesting. And the first thing that we will do for this whole field is to detect these 10 colors. Let's start from here. And this is something that we'll do in the next video. This here is the program for our robot. And it's pretty straightforward. We just move the robot forward and then we detect first, we detect the first eight colors and then the last two colors. So these are the rows and the columns for the grid. And these are the coordinates of the first intersection that we must go. And at the end we just turn. And the program is pretty simple but if we enter in the grid, block, we decided to do the following thing. How does the program work? First we wait with the color sensor to detect white. This is where we start. Then we wait to detect one of the colors, two, three, four, five. These are green, blue, yellow, and red. We wait for 0.1 second just to be sure that we are over the color spot. And then we detect the color. And so we get red, we get green, we get blue. Where do we store these values? We decided to store these values in variables, and we have eight different variables. For row one, we have a variable called Row One. For row two, Row Two, for row three and four again, and for the columns, we have Column One variable, column two, column three and column four. These are eight different variables. And in these variables we store the color that was detected by the color sensor and after each detection, after each measurement we just play a tone. And we have our solution with eight different variables. The problem that we saw with this solution is that it is getting pretty complex after that to move the robot on the field with intersection because it has too many switches. Because we must switch and detect if the value for one is one and then another switch inside the switch for the column and then another switch inside the switch and it's getting pretty complex. So we've built this solution but it's not very clean. And the next solution that we are working on is using arrays but this will be in the next video.

## Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

• 5
• 27:26
• 0
• 1
• 0
• 0
• 3d_rotation 1