2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Added axis limiting or whatever you want to call it

This commit is contained in:
Adam Long 2015-01-16 21:01:39 +00:00
parent 4c1e3d1767
commit 11bfb827c8
3 changed files with 20 additions and 3 deletions

View File

@ -11,6 +11,21 @@ void HHRobot::Init(){
}
//Main function used to handle periodic tasks on the robot
void HHRobot::Handler(){
RobotDrive->handler(DriveStick->GetJoystickAxis("x"),DriveStick->GetJoystickAxis("y"),DriveStick->GetJoystickAxis("z"),0);
double x,y,z;
if (DriveStick->GetJoystickButton(1)){
y = 0;
z = 0;
}else{
y = DriveStick->GetJoystickAxis("y");
z = DriveStick->GetJoystickAxis("z");
}
if (DriveStick->GetJoystickButton(2)){
x = 0;
z = 0;
}else{
x = DriveStick->GetJoystickAxis("x");
z = DriveStick->GetJoystickAxis("z");
}
RobotDrive->handler(x,y,z,0);
}
// vim: ts=2:sw=2:et

View File

@ -4,7 +4,8 @@ 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
all : $(OBJECTS)

View File

@ -4,7 +4,8 @@ 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
all : $(OBJECTS)