2
0
mirror of https://github.com/team2059/Zaphod synced 2024-12-18 20:12:28 -05:00

Greatly improved the buildscript to almost makefile like functionality. Also added and alias to the users bashrc (frcbot)

This commit is contained in:
Adam Long 2014-06-06 16:24:28 -04:00
parent e24e6166d4
commit 738139995b
3 changed files with 45 additions and 1 deletions

40
build.py Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/python -tt
import sys,os
#Should be changed to the name of the *.out file produced in /bin
ROBOT_NAME = 'Zaphod'
RRIO_IPADDRESS = '10.20.59.2'
#Global functions for the actions
def build():
os.system('cd src && make && cd ..')
def clean():
os.system('cd src && make clean && cd ..')
def deploy():
command = 'cd bin && wput '+ ROBOT_NAME+'.out ftp://frc:frc@'+RRIO_IPADDRESS+'/ni-rt/system/FRC_UserProgram.out'
os.system(command)
#Check that there is actually an action to perform
if len(sys.argv) == 1:
print("Requires an argument")
exit()
#Bulk of the program that checks for the actions it needs to do
if sys.argv[1] == 'build':
build()
if sys.argv[1] == 'clean':
clean()
if sys.argv[1] == 'buildclean':
build()
clean()
if sys.argv[1] == 'deploy':
deploy()

5
configure vendored
View File

@ -1,8 +1,11 @@
#!/bin/bash
git submodule init
git submodule update
export PATH=$PATH:$(pwd)/bin/ucpp/ucpp
echo "export PATH=$PATH:$(pwd)/bin/ucpp/ucpp" >> ~/.bashrc
echo "alias frcbot='python build.py'" >> ~/.bashrc
cd src
ucpp setup -t 2059
ucpp init
ucpp configure
cd ..
source ~/.bashrc

View File

@ -66,6 +66,7 @@ void ZaphodShooter::shootRaw(float power)
shooterRight2->SetRaw(int(floatToPWM(-power)));
}
//Should be run in a loop
void ZaphodShooter::updateShooterPosition()
{
if(e_ShooterState == IDLE_PRESHOT)