Robot Code | Dashboard | Vision
Code for Team 1418's 2020 competition robot, which is so far unnamed.
Before deploying, you must install robotpy on your robot.
You may then deploy code at any time:
python3 src/robot.py deploy
We recommend using our tool, dep
, here. It simplifies your deploy process and removes pesky steps like manually changing your WiFi network.
You may run the pyfrc
simulator to test this code thus:
python3 src/robot.py sim
We use three total joysticks to control the robot:
- 2 x Logitech Attack 3 (
joystick_left
andjoystick_right
) - 1 x Logitech Extreme 3D Pro (
joystick_alt
)
git
hooks change the process of committing by adding processes before or after the process of committing. After cloning, you should run
./setup.sh
This will set up hooks to run tests before committing to help avoid easy-to-fix errors in the code.
The requirements.txt
file holds all of the programs and their versions needed to run this code. After activating your virtual environment with run
pip3 install -r requirements.txt
In the tests
folder there is another requirements file that needs to be run. To do so, run
pip3 install -r tests/requirements.txt
Entry points allow us to add sub-commands to the overarching RobotPY framework. To load them, move to the root directory, activate your virtual environment and run
pip install -e .
This will set up the entry points that we put in place to facilitate off-robot functions of our code. So far, we use entry points for:
- Generating motion profile trajectories (generate)
These entry points can be run like so
python3 src/robot.py <entry_point_name>
A virtual environment allows you to store dependencies in a project folder, meaning that they do not affect your computer's python installation. To create a virtual environment, first install the virtualenv package
pip3 install virtualenv --user
Now, to create a virtual environment in a project folder, navigate into the folder and run
python3 -m virtualenv venv
After this command, your virtual environment will have been created. It now resides in the "venv" folder inside of your project. However, it is not "enabled" by default, meaning any packages you install right now will still go to your global python install. To activate the environment, run
. venv/bin/activate
You will be able to tell that it worked by looking at the additional prefix that should appear before your main bash prefix. It should look something like
(venv)
After you're done working on a specific project, and want to use your global python installation or activate a different virtual environment, you can type
deactivate
This command will deactivate your current virtual environment from any location in the terminal.
src/
The robot code lives here.
automations/
Automatic scripts for performing common functions.
autonomous/
Autonomous modes.
common/
New robotpy components.
components/
Abstractions for major robot systems.
controllers/
Software implementations not corresponding to physical robot components.
tests/
py.test-based unit tests that test the code and can be run via pyfrc.
- Team 1418
In-season, use of this software is restricted by the FRC rules. After the season ends, the MIT License applies instead.