Skip to content

Working On Robot Code

Adham Elarabawy edited this page Sep 23, 2018 · 12 revisions

Working On Robot Code

So you have already completed the Development Environment Setup, meaning that you already have the following done:

  • Setup System Variables(Windows)
  • Installed Visual Studio Code
  • Installed the necessary Visual Studio Code Extensions

Assuming that you have already done the above steps, and that you want to be able to work with Robot Code, you're in the right place!

Step 1: Download and Install GitHub Desktop

If you have been in robotics for just a week, you've most likely heard a controls member mention GitHub at least once. To understand GitHub, you have to understand what Git means. Git is an open-source version control system that is the programmer's equivalent of google drive. But what does this mean? When developers work on large projects, they often make many changes to the code, releasing many versions: alpha, beta, etc... Version control systems, like Git, keep the many versions organized, making note of every single change to every single file in a repository. Subsequently, developers can easily collaborate, since they can 'download'(called pulling) the newest version of a particular project, make their changes, then 'upload'(called pushing) their changes back to the the online revision, thus making an even newer version. Every developer on the project can see these changes, pull the newest version of the code, add their changes, and then push back their updated version. GitHub is simply a tool that facilitates all of this interaction and makes it easy to visualize.

Now that you know what GitHub is, you can install it.

  1. Firstly, go to GitHub.com, and make an account.
  2. After you get added to the team GitHub, download and install GitHub Desktop(make sure to download the right version for your os).
  3. Once GitHub Desktop is installed, open the application and sign into the account you made earlier.
  4. Then navigate to File>Clone Repository.
  5. Make sure to copy the Local Path on the bottom.
  6. Scroll down until you find 3128-gradle-test and click Clone.

Step 2: Import Gradle into Visual Studio Code

  1. Open Visual Studio Code
  2. Navigate to File>Open Folder
  3. Navigate to the Local Path that you saved earlier.
  4. Select the folder titled 3128-gradle-test
  5. Click Select Folder

This should open the 3128-gradle-test project in Visual Studio Code.

  1. Select the build.gradle file in the File Explorer on the left side of your screen.
  2. Click on the Red Hexagon with a 'W' in it on the top right hand side of your screen. Icon
  3. In the Search Bar that pops up, write Build Robot Code and click on the result.

The Build should be successful. Your terminal should look like this: Success Log

  1. Repeat steps 6-7, but in the Search Bar that pops up, write Deploy Robot Code and click on the result.
  2. Then click on Java in the following menu.

The Build should fail, since you are most likely not connected to the robot. However, the error log should mention something about not being able to find the RoboRio. If your build fails and the error doesn't look like the example below, then you messed up somewhere in the steps above, and you should take a look at the common mistakes below the image.

Error Log

Common Mistakes:

  1. When selecting the Folder in Part 2's steps 3-4, it is easy to select the wrong folder. Make sure to select the 3129-gradle-test folder and not the entire GitHub folder.
  2. Make sure that you have already followed all the steps in the previous guide linked at the top of this guide.

If you would like to learn more about GitHub, go to this guide(Coming Soon).