diff --git a/README.md b/README.md index ecd555d..48378d9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This project uses [Vagrant](https://www.vagrantup.com/) and creates a virtual ma ### Configuration - Set the roboRIO host in `config/host` - Copy your code into `src/` +- Set the main file in `config/buildfile` ### Usage Once provisioning completes, log into the machine with `vagrant ssh`. Use the following commands to build and deploy your project: @@ -24,6 +25,7 @@ If you would like to automate the build process, you can run the following comma ssh vagrant@127.0.0.1 -p 2222 -i /path/to/frc-cpp-vagrantfile/.vagrant/machines/default/virtualbox/private_key 'build&&deploy' ``` Changing /path/to/frc-cpp-vagrantfile to the path of the frc-cpp-vagrantfile directory. +Run: `while true;do clear;build 2>&1|less;done` in the virtual machine to compile when the you press `q` ### Issues - There is no way to automate updating wpilib diff --git a/bootstrap.sh b/bootstrap.sh index 34ad697..2f5b1a0 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,7 +8,7 @@ add-apt-repository -y ppa:byteit101/frc-toolchain apt-get update apt-get install -y frc-toolchain # Compiles code in the /vagrant/src folder -echo 'echo "Starting build";test -f /vagrant/build/FRCUserProgram&&rm /vagrant/build/FRCUserProgram;arm-frc-linux-gnueabi-g++ -std=c++1y -I/vagrant/wpilib/include "-I/vagrant/src" -O0 -g3 -Wall -c -fmessage-length=0 -o /vagrant/build/Robot.o /vagrant/src/Robot.cpp&&arm-frc-linux-gnueabi-g++ -L/vagrant/wpilib/lib -Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a -o /vagrant/build/FRCUserProgram /vagrant/build/Robot.o -lwpi;rm /vagrant/build/Robot.o;echo "Done"' > /usr/local/bin/build +echo "echo 'Starting build';test -f /vagrant/build/FRCUserProgram&&rm /vagrant/build/FRCUserProgram;arm-frc-linux-gnueabi-g++ -std=c++1y -I/vagrant/wpilib/include '-I/vagrant/src' -O0 -g3 -Wall -c -fmessage-length=0 -o /vagrant/build/Robot.o /vagrant/src/\`cat /vagrant/config/buildfile|head -n 1\`&&arm-frc-linux-gnueabi-g++ -L/vagrant/wpilib/lib -Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a -o /vagrant/build/FRCUserProgram /vagrant/build/Robot.o -lwpi;rm /vagrant/build/Robot.o;echo 'Done'" > /usr/local/bin/build # Uploads the code to the rRIO based on /vagrant/config/host file echo "cat /vagrant/FRCUserProgram | ssh \`cat /vagrant/config/host|head -n 1\` 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram;/usr/local/frc/bin/frcKillRobot.sh -t -r'||echo 'You probably haven\'t succesfully built yet. Run build to compile the program''" > /usr/local/bin/deploy # Creates ssh key if it doesn't exist and cats the public key to the rRIO diff --git a/config/buildfile b/config/buildfile new file mode 100644 index 0000000..1bd4844 --- /dev/null +++ b/config/buildfile @@ -0,0 +1,2 @@ +Zaphod.cpp +The line above should be the path of the main file relative to src. The program will compile /vagrant/src/$FILE where $FILE is the line above. It should include headers that include other files that need to be compiled. The default is Robot.cpp.