To get started with programming in our codebase you'll need to setup access with the buildserver, gerrit, and buildkite. this guide walks you through both.
To access our code you will need to request access to both Gerrit and the Build Server. Gerrit is a tool we use to manage git patches similar to github. While the Build Server is required in order to run code on non-linux machines*.
* It is possible to run the code locally on windows through WSL
To setup Gerrit you can follow these steps
#coding
channel in slack.The process for buildkite is the same as the one for gerrit, except select buildkite in the system access request form.
Now that gerrit is set up you'll need a way to run the code, if you're on linux you can run it locally. While on Mac and Windows you'll need to use the buildserver.
To setup the buildserver you can follow these steps
ssh-keygen -t ed25519 -f ~/.ssh/id_971_ed25519 chmod 600 ~/.ssh/id_971_ed25519
#coding
channel in slackcat ~/.ssh/id_971_ed25519
for the key used in the form.~/.ssh/aliases
Host frc971 Port 2222 ForwardAgent yes IdentitiesOnly yes User [YOUR_GERRIT_USERNAME] HostName build.frc971.org IdentityFile ~/.ssh/id_971_ed25519
ssh build "echo If you\'re seeing this, it means everything setup correctly"and if you aren't seeing any errors, it has been setup correctly.
ssh frc971
These steps assume you are on the most up to date debian linux, however they can be adapted to most other distributions.
sudo apt update && sudo apt upgrade
sudo apt install git python3
To run the code you'll need to download the repository from gerrit, make sure to select ssh and not http. Click on SSH, and clone with commit message hook. Copy the command, and run it locally on terminal. To learn more about git, open a terminal and run man git
, or see git(1) (especially the NOTES section).
Once the repositoy is selected you'll want to make sure to configure your name, email on git. This is required to ensure you're following the contributing guidelines above. You can do this by running these following commands:
cd 971-Robot-Code git config user.email "<YOUR_EMAIL_HERE>" git config user.name "<YOUR_NAME>"
We use Bazel to build the code. Bazel has extensive docs, including a nice build encyclopedia reference, and does a great job with fast, correct incremental rebuilds.
bazel test //... bazel build --config=roborio -c opt //...
# For the roborio: bazel build --config=roborio -c opt //y2020/...
# For the raspberry pi: bazel build --config=armv7 -c opt //y2020/...
bazel run -c opt //frc971/config:setup_roborio -- roboRIO-XXX-frc.local
# For the roborio bazel run --config=roborio -c opt //y2020:download_stripped -- roboRIO-971-frc.local
This assumes the roborio is reachable at roboRIO-971-frc.local
. If that does not work, you can try with a static IP address like 10.9.71.2
(see troubleshooting below)
# For the raspberry pi's bazel run --config=armv7 -c opt //y2020:pi_download_stripped -- 10.9.71.101
NOTE:
download_stripped
(or pi_download_stripped
) targets. These will rsync only the changed files, and so are pretty efficient.//y2020/vision:calibration
) for the pi (armv7
), run:bazel run --config=armv7 -c opt //y2020/vision:calibration_strippedYou will then need to manually copy the resulting file over to the robot.