# IR 360 Locator

![Gather the parts above. The hardware is all 6-32. ](/files/sn1qUqMqTp8ShU35sUKh)

![Attach standoffs from bottom](/files/EACSbGjEZxDp7vEoa1V5) ![Attach sensor to the top.](/files/9zCDlcMYIfpXUp5oJGtp) ![Plug sensor into the I2C ports... make sure the black wire is on the black side. ](/files/cm9YSqn9Y54x9g3L5oer)

{% embed url="<https://docs.google.com/presentation/d/1PIDC5-qEMtaJw_AV_xwqjoFFHQoG97u4k29PQJQF7Zs/edit?usp=sharing>" %}

![IR Beacon](https://modernroboticsinc.com/wp-content/uploads/2019/03/0001365_360-ir-beacon.jpeg)

### Reading the values

```python
import Fusion

# Class definitions -----------------------------------------------------------
f = Fusion.driver()
l = Fusion.locator360(f)

# Program Start ---------------------------------------------------------------
while True:
    print ("Heading   = " + str(l.getHeading(1200)))
    print ("Intensity = " + str(l.getIntensity(1200)))
    print("") 
    f.delay(0.25)

```

### Navigating to the goal

<pre class="language-python"><code class="lang-python">import Fusion

# Object definitions -----------------------------------------------------------
f = Fusion.driver()
l = Fusion.locator360(f)

#while we are close to the beacon, straight away from it...
while (l.getIntensity(1200) > 50):
# the sensor will have a heading of 35 when it is 
## pointing 180 degrees away from the beacon
    if(l.getHeading(1200) &#x3C; 34):
        #turn counterclockwise
        f.motorSpeed(f.M0, 30)
        f.motorSpeed(f.M1, -30)
    elif(l.getHeading(1200) > 36):
        #turn clockwise
        f.motorSpeed(f.M0, -30)
        f.motorSpeed(f.M1, 30)
    else:
        #straight
        f.motorSpeed(f.M0, 50)
        f.motorSpeed(f.M1, 50)
        
<strong>#stop the robot now that we are far enough away        
</strong>f.motorSpeed(f.M0, 0)
f.motorSpeed(f.M1, 0)
#shoot the ball!
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.mccaskeyrobotics.org/fusion/ir-360-locator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
