# Setting up a new robot (Roborio)

### Rio and Radio setup

1. Flash rio 
    - If it's a rio 2, use balena etcher 
        - [follow the guide from WPILib docs](https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-3/roborio2-imaging.html)
    - If it's a rio 1, use the roborio imaging tool 
        - [follow the guide from WPILib docs](https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-3/imaging-your-roborio.html)
2. Set the roborio's team number 
    - Although there is a roborio team number setter tool, it sucks and sometimes doesn't work. Use the roborio imaging tool to set the team number regardless of it's a rio 1 or 2
3. Flash radio 
    1. Connect to the radio over ethernet
    2. Go to [http://radio.local](http://radio.local)
    3. Set the team number
    4. Set the robot name
    5. Set the password to YETI3506
    6. Hit apply
4. **Power cycle**
5. Deploy code

### CTRE Setup

1. Connect to robot
2. Verify CAN busses are all good 
    - All devices should be flashing orange
3. Make sure all IDs are unique 
    - Devices of different types can have the same ID. Devices of the same type **cannot** have the same ID 
        - e.g. A Kraken X60 and a Pigeon can both have ID 1, but there can only be one Kraken X60 with the ID of 1
4. Update CTRE firmware
5. License motors
6. Name motors
7. Set IDs 
    - Sync with code
8. Confirm motor directions
9. Sync motor directions with CANcoders
10. Zero CANcoders
11. Save CANcoder offsets in code
12. Deploy code
13. **Power cycle**