Get the Toronto Framework GyroDrive Code

On This Page

STEP 1: Use GitHub Desktop to get the Toronto Framework

STEP 2: Compile the Code

STEP 3: Update the VS Code formatter settings

STEP 1: Use GitHub Desktop to get the Toronto Framework GyroDrive project

Log onto GitHub.com and navigate to the TorontoCodingCollective GyroDrive project for 2019.

Click 'Clone or Download' and then 'Open in Desktop'. This will launch the GitHub Desktop and will import the project.

STEP 2: Compile the Code

To compile the code in VS Code:

  • Open VS Code
  • Use File -> Open Folder... to open the downloaded folder
  • Right click on the build.gradle component and select -> Build Robot Code

To Download the Code to your robot

Connect to your robot using a USB cable, network cable, or wireless connection.

Set the team number:

  • click on the WPILib Icon in the control bar in VS Code
  • set your team number

Deploy the code:

  • Right click on the build.gradle component and select -> Deploy Robot Code

NOTE: The code will not work unless the Speed Controllers and encoders are on the correct ports.

STEP 3: Update the VS Code Formatter Settings

The TorontoCodingCollective framework uses formatting settings equivalent to the default eclipse settings for formatting Java code. The Formatter contains information on indentation rules.

Amazingly, the recommended way to set up VS Code formatting is to set up eclipse to the preferred settings, export the settings, and import them into VS Code (seriously, start eclipse and export your favourite formatter?). So the TorontoCodingCollective formatter is included in the GyroDrive project.

To set up the Formatter:

  • Open VS Code
  • Right Click on the TorontoCodingCollective.Formatter.xml
  • Select "Copy Path"
  • Open the settings using file -> Preferences -> Settings
  • Search for "formatter"
  • Paste the copied path into the Java > Format > Settings: URL
  • Set the profile using:
    • Java > Format > Settings: Profile > "TorontoCodingCollective"
    • save the settings using ctrl-s

Turn off the Detect Indentation setting

The Detect Indentation setting automatically converts spaces to tabs when opening a file. Since the TorontoCodingCollective style uses spaces instead of tabs, this setting causes the formatter and the file opening Detect Indentation to conflict. This is NOT something you want, so turn off the Detect Indentation:

  • Open the settings using file -> Preference -> Settings
  • Search for "indentation"
  • unselect the checkbox for Editor: Detect Indentation
  • save the settings using ctrl-s

Check your settings

  • search the settings for @modified, they should look like this (at a minimum)

NEXT STEP: Configure GyroDrive