Goliath Fall 2017

Robot Detection

John Ocampo (Electronics and Controls Engineer)
Approved By: Mark Huffman (Project Manager)

### Introduction – The “How”

By John Ocampo (Electronics and Controls Engineer)

Detection is a subroutine used in the collusion protocol. The subfunction will employ an IR proximity sensor, VL6180. The distance outputted  will be converted to a discrete value called squares which are dependent on the measured squares from the physical maze. Each side of the square is roughly 6.6 cms long meaning we have a required range of 1 square. With accordance with the rules of the maze. Ultimately the subroutine will output or return a boolean value which indicates whether or not an object is within the expected range.

#### Psuedo Code

By John Ocampo (Electronics and Controls Engineer)

``` boolean detection(){```

``` set minimum distance(size of a square) to 66 (mm) identify the current distance calculate in respect to squares(ie distance/66) ```

```if current distance is less than 1 return true (there is something within 1 square of range) else return false } ```

#### Actual Code

By John Ocampo (Electronics and Controls Engineer)

``` boolean detection() {```

``` double square_size=66;//mm double num_square=ceil(sensor.getDistance()/square_size); //length of a square is about 66mm //Serial.print("Squares Away "); //Serial.println(num_square); //delay(100); if (num_square<=1) { boolean inrange= true; return(inrange); } else { boolean inrange= false; return(inrange); } } ```

### Potential Problems

By John Ocampo (Electronics and Controls Engineer)

The primary concern is false positives. Since the walls are not physical objects of the maze the IR proximity sensor could sense other robots on the other sides of the wall giving us the false positive. In accordance with the rules of the maze. This can be circumvented by using the hitwall function. If there is a wall the detection function will output a false. Finally, having a range of 1 square is risky due to distance inaccuracies generated over time. Ie as the mission continues the chance of having a collision will increase. This could be solved by increasing the range, but that will exacerbate the previous problem of having invisible walls. The hitwall function will only determine the settings of the current room, not the room 2 or 3 aways. Another function can be made which checks the dimensions of future rooms