You should have a laptop for writing robot code. You can use any OS to write and deploy code, but Windows is required if you want to drive the robot from your computer. Instructions below are for Windows.
All robot code is written in Python. See this page for some Python tutorials.
python
and press Enter. If that doesn’t work, try py
instead.This is Python’s interactive mode. You can type Python code in and press Enter to run it immediately.
exit()
and press Enter to exit Python.python -m pip install --upgrade pip
python -m pip install --upgrade pylint pyfrc robotpy robotpy-rev robotpy-rev.color robotpy-navx pygame remi
pip
is a tool for installing and upgrading packages for Python, to add extra functionality. The first command updates pip to the latest version. The second command installs 5 packages which give you the necessary libraries for writing and testing robot code.
pylint
: A tool for modifying Python code—it will give VS Code the ability to, for example, change the name of a variable by analyzing its usage in a file.pyfrc
: A Python port ofwpilib
, a library for controlling FRC robotsrobotpy-rev
: For sending commands to the Spark motor controllersrobotpy-rev.color
: For the color sensor for the control pannel for the 2020/2021 seasonrobotpy-navx
: For accessing the NavX gyroscope.pygame
: A set of libraries for building games with Python. This is used by the robot simulator for joystick input.remi
: For building interfaces that run in a web browser—we will use this to build a “dashboard” web interface for the robot
Visual Studio Code is our recommended program for writing Python code. (It is different than plain Visual Studio).
The installation process for Driver Station is SLOW! While you are working on this you can continue on some of the other sections. Driver station does not work on the school laptops.
Driver Station is used to control the robot from your computer using a joystick or gamepad. It only works on Windows.
All of our robot code will be on GitHub, so anybody can view it, download it, and edit it.
Git is software for “version control,” which allows us all to collaborate on the code and manage multiple versions and branches of it.
git config --global user.email "your email goes here"
git config --global user.name "Your Name"
git config --global core.editor "code --wait"
Open Command Prompt and type these commands:
cd Documents
git clone https://github.com/seamonsters-2605/SeamonstersTemplate
This will navigate to your Documents folder and download a repository hosted on GitHub called SeamonstersTemplate. This is a template that we use for robot development, including some Python libraries we have developed over the years.