getting started frc programming under linux.html - frc971/website GitHub Wiki

The team programming computers all run debian and our package containing the compiler is for debian which means that it will be easier for anybody who wants to test code on their own computer to use debian too. [Ubuntu should also work since it's built on debian.]

Install debian GNU/Linux

The easiest way to install debian is to use the netinst cd image. The download page is at http://www.debian.org/CD/netinst/ and the current version as of 12/5/16 is http://cdimage.debian.org/debian-cd/8.6.0/i386/iso-cd/debian-8.6.0-i386-netinst.iso. A 64 bit iso for newer systems is available here http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/debian-8.6.0-amd64-netinst.iso (valid as of 12/5/2016)

Add packages to debian

After you get debian running, you'll have to install some basic packages in order to compile code. You can install packages from the command line by typing "apt-get install packages" as root, where packages is a space-separated list of packages you want to install. The ones that I can think of are grep, sed, wget, ssh, make, subversion, gawk, gcc, g++, bash, ruby, unzip, patch, ncftp, and vim.

Install the VxWorks cross-compiler

You will also need to download and install the package we have for the VxWorks cross-compiler. It is currently at a temporary location and will eventually be at some other more permanent location. You can install it with "dpkg -i powerpc-wrs-vxworks_4.5.0-1.0_i386.deb" in whatever directory you downloaded it to. You'll need to do that as root.

Get the robot code via Subversion

Please look at the SVN Usage page for tips on using SVN well. The URL for the 2011 code is svn://boardsailor.com/frc971/2011/trunk/src.

EDIT: As of 12/5/2016, the above link to robot code is broken.

Build the robot code

After you check out a new working copy, do a "make" in externals to download WPILib. You'll need an internet connection. After that succeeds, you can just do a "make" in packages to rebuild the robot code. Also see README.html, which is more current than README.txt.

Source Code Control - GIT

The programming team is lead by Brian Silverman.  They use GIT and GERRIT for managing the 971 source code as is documented in this page. If you are unable to access this page, you need your SVN username added to the FRC971 code group in GERRIT.  Austin, Phil, and Brian can add you the group.

Gerrit is used for code review

Austin and Brian found a nice code review tool that Brian thinks would be nice for the team to start using. Michael and Brian got an instance running on the team server, which seems to be almost working. You have to log in with your SVN username and password to use it. After logging in the first time, Austin or Brian have to add you to a group before you can access any of the 971 code. If anybody wants to get started, feel free to go to https://robotics.mvla.net/gerrit and create an account. Send Brian an email after you've done that so he can add you.

Gerrit has a nice quick intro for learning how to use it, and a bunch more advanced documentation too. For now, there's no good way to actually upload or download code, but we're working on fixing that in the server configuration (Brian believes ssh access works from inside the school if anybody wants to play with it quickly).

Alternate Setup (Linux Virtual Machine) - 2016

We have a semi-automated procedure for getting started with programming. First, install the following pieces of software:

  • VirtualBox - This package allows you to run the debian 64 bit virtual machine on your computer including Windows, Mac, and Debian.
    • As a test, go through the steps to create a "new" virtual machine but do not create one.  Check to see if there is a 64 bit version of debian offered.  If you only see 32 bit versions of the operating systems offered, then turn on hardware virtualization in the BIO.  Windows 10 machines running UEFI boot take a bit of work to boot into the BIO.  These are the directions that Johan used November 24, 2017 to boot into the BIOS menu.  Johan found two menu options that delt with virtualization and turned on both of them.  After rebooting, he found the 64 bit versions available in VirtualBox.
  • Vagrant - This is a wrapper around virtual box that makes downloading and customizing virtual machines easier.
  • SVN client. On Windows, TortoiseSVN is a great option

Then we need to checkout the vagrant files from the robotics git repository.  The ideal way to do this is to get a copy of the /vm directory in the 971-Robot-Code git repository.  Since I don't know how to do this, you can check out the entire git repository somehow using Windows and then make a copy of the /vm directory to your desktop or somewhere else.  After doing so, I suggest deleting the 971-Robot-Code repository because you will not be using it.

  • git clone https://[email protected]/gerrit/971-Robot-Code
  • cp -rp 971-Robot-Code/vm ~user/Desktop

If you can't figure that out, then try using the SVN copy of the /vm directory.  This was last synced with the git version on November 25, 2017 by Michael.  The git one may be newer and the changes could be important.

  • 11/29/17 Note: We don't use SVN to bootstrap this process now.  Talk to Phil for help.
  • The files you want are in the vagrant_dev_vm directory.  You can check a copy of this out using SubVersion.  To do this, right click on your Windows desktop and select "SVN Checkout..." and enter https://robotics.mvla.net/svn/frc971/2016/trunk/src/vagrant_dev_vm/ for the "URL of repository:" box, click on OK, enter your SVN username and password, and the vagrant_dev_vml folder will appear on your desktop.  

Contact Michael for a team svn account if you don't have one already.  It is used for SVN and Git.  Once you have checked out a copy of vm or vagrant_dev_vm, navigate to the vm or vagrant_dev_vm folder in a terminal (cd Desktop\vagrant_dev_vm) and read the README.md file.  It tells you to run "vagrant up" from the command line. This command will take a while -- up to an hour. The command will download a basic VirtualBox VM from debian.org that comes pre-installed with jessie.  Best to be using a 64 Intel OS such as Windows 7, OSX, or Debian. After the download is complete, it will customize the virtual machine so you can start building code and submit new patches. Again, this whole process will take a while.  If you see the error message "Unable to resolve dependency: user requested 'vagrant-persistent-storage;vagrant (> 0)'" then run the command "vagrant plugin install vagrant-persistent-storage" and try again.

When the "vagrant up" command is done, execute "vagrant reload".  This will reboot the VM and start a graphical environment that was installed in the previous step.

Now you can log in to the new machine with the following credentials: username is "user" and the password is also "user". From here you can use gerrit (as described by previous sections on this page) to download the robot code and start building for it.

Talk with Phil if you need help with this.

Tags: 
⚠️ **GitHub.com Fallback** ⚠️