diff --git a/src/HHRobot.cpp b/src/HHRobot.cpp index e381a4b..0ceb0af 100644 --- a/src/HHRobot.cpp +++ b/src/HHRobot.cpp @@ -1,8 +1,9 @@ #include "HHRobot.h" #include "HHBase.h" HHRobot::HHRobot(): - tmpMotor1(new CANTalon(0)), - joystick1(new Extreme3dPro(0)){ + DriveStick(new Extreme3dPro(0)), + //FrontRight,FrontLeft,RearRight,RearLeft + RobotDrive(new MecanumDrive(40,41,42,43)){ } void HHRobot::Init(){ printf("Initing\n"); @@ -10,7 +11,6 @@ void HHRobot::Init(){ } //Main function used to handle periodic tasks on the robot void HHRobot::Handler(){ - tmpMotor1->Set(joystick1->GetJoystickAxis("y")); - SmartDashboard::PutNumber("tmp",joystick1->GetJoystickAxis("y")); + RobotDrive->handler(DriveStick->GetJoystickAxis("x"),DriveStick->GetJoystickAxis("y"),DriveStick->GetJoystickAxis("z"),0); } // vim: ts=2:sw=2:et diff --git a/src/HHRobot.h b/src/HHRobot.h index 21828fd..c1f7b60 100644 --- a/src/HHRobot.h +++ b/src/HHRobot.h @@ -3,10 +3,11 @@ #include #include "HHBase.h" #include "hhlib/input/controller/Joystick.h" +#include "hhlib/drive/MecanumDrive.h" class HHRobot{ private: - CANTalon *tmpMotor1; - Extreme3dPro *joystick1; + Extreme3dPro *DriveStick; + MecanumDrive *RobotDrive; public: HHRobot(); void Init(); diff --git a/src/Makefile b/src/Makefile index 952e810..01fcaa2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,12 +1,11 @@ +REMOTEIP=10.20.59.2 CC=arm-frc-linux-gnueabi-g++ CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a SOURCES=$(shell find -type f -name "*.cpp") OBJECTS=$(SOURCES:.cpp=.o) -WPILIB=/var/frc/wpilib -EXEC=bin/FRCUserProgram +WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram CLEANSER=rm -r -REMOTEIP=10.20.59.2 all : $(OBJECTS) $(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi @@ -15,7 +14,7 @@ all : $(OBJECTS) $(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@ clean: - $(CLEANSER) $(OBJECTS) + $(CLEANSER) $(OBJECTS) bin/FRCUserProgram deploy: @cat bin/FRCUserProgram | ssh admin@$(REMOTEIP) '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' diff --git a/src/Makefile.old b/src/Makefile.old index b265c91..01fcaa2 100644 --- a/src/Makefile.old +++ b/src/Makefile.old @@ -1,12 +1,11 @@ +REMOTEIP=10.20.59.2 CC=arm-frc-linux-gnueabi-g++ CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a SOURCES=$(shell find -type f -name "*.cpp") OBJECTS=$(SOURCES:.cpp=.o) -WPILIB=/var/frc/wpilib -EXEC=bin/FRCUserProgram +WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram CLEANSER=rm -r -REMOTEIP=10.0.1.31 all : $(OBJECTS) $(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi @@ -15,12 +14,10 @@ all : $(OBJECTS) $(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@ clean: - $(CLEANSER) $(OBJECTS) + $(CLEANSER) $(OBJECTS) bin/FRCUserProgram deploy: - @ssh -v admin@$(REMOTEIP) "rm /home/lvuser/FRCUserProgram" - @scp bin/FRCUserProgram admin@$(REMOTEIP) - @ssh -v admin@$(REMOTEIP) "/etc/profile.d/natinst-path.sh; chmod a+x /home/lvuser/FRCUserProgram; /usr/local/frc/bin/frcKillRobot.sh -t -r" + @cat bin/FRCUserProgram | ssh admin@$(REMOTEIP) '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' putkey: @test -d ~/.ssh||mkdir ~/.ssh;test -f ~/.ssh/id_rsa||ssh-keygen -t rsa -f ~/.ssh/id_rsa -b 4096 -q -N '';cat ~/.ssh/id_rsa.pub|ssh -v admin@$(REMOTEIP) 'cat >> /tmp/key;mkdir -p ~/.ssh;cat /tmp/key >> ~/.ssh/authorized_keys;rm /tmp/key' diff --git a/src/hhlib b/src/hhlib index 17606cc..b8306e8 160000 --- a/src/hhlib +++ b/src/hhlib @@ -1 +1 @@ -Subproject commit 17606cc482c4cdde363c96fda0b6efd92ccdbad9 +Subproject commit b8306e85030cbd5fea1e15b60b608efc219477b1