Developer Guide

This page will get you up and running ready to write code for our robot.

OS

The three main operating systems in use today are Windows, macOS, and Linux. Some of the software used in FRC runs only on Windows, but software development for the robot itself can be done on any of the three.

Python setup

The Drop Bears use Python 3.8. If your system doesn't have Python or the version installed is earlier than 3.8 (or if you're unsure), follow the instructions on the Installing Python page.

You also need to install RobotPy, the libraries we use to control the robot.

Recommended: Create a virtual environment

It is recommended (i.e. optional if this looks too hard) to install RobotPy into a virtualenv (venv). This will make it easier to install the next year's version and blow everything away without interfering with any other libraries you may install.

To create a virtualenv named .venv:

python3 -m venv .venv

To activate a virtualenv (so that all python commands use the virtualenv in your current terminal):

Windows Command Prompt:

.venv\bin\activate.bat

Linux/macOS:

. .venv/bin/activate

You can read more information about virtual environments here: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/

To install these libraries:

python3 -m pip install "robotpy[all]"

(If you're on Windows and do not have a python3 command, use py in its place.)

Text editor setup

What is a text editor? It is a program that edits plain text files, and what programmers use to edit their code.

It is important to think what you want to get out of your text editor. Some features to consider about a text editor include: auto save, syntax highlighting (basically colouring text based on keywords), linting (showing warnings and errors within your code).

Recommended text editors:

  • Visual Studio Code download here

    • VS Code has syntax highlighting built in.

    • There is a recommended extension that adds linting.

  • PyCharm download here

    • PyCharm has syntax highlighting, built in linting.

    • This is considered fairly heavyweight by some people.

Git

Git is a version control system that allows for collaboration between people working on a single codebase. At any given time there is a single canonical version of every file. If multiple people change the same file, Git ensures that the changes do not erase each other.

How do I get git?

If you do not already have git installed... – you can check by running git --version in your terminal

Windows: Visit the git website here

macOS: There is a version of git ~built into macOS. It gets installed as a prerequisite for Homebrew. However, you can get a more up-to-date version from Homebrew too: brew install git

Linux: Install git using your package manager.

How do I use git?

A simple guide to using Git and GitHub for the Drop Bears can be found here.

Coding standards

All team code must conform to our style guides. See the Coding Standards page.