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:
parent
4c1e3d1767
commit
11bfb827c8
@ -11,6 +11,21 @@ void HHRobot::Init(){
|
|||||||
}
|
}
|
||||||
//Main function used to handle periodic tasks on the robot
|
//Main function used to handle periodic tasks on the robot
|
||||||
void HHRobot::Handler(){
|
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
|
// vim: ts=2:sw=2:et
|
||||||
|
@ -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
|
LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a
|
||||||
SOURCES=$(shell find -type f -name "*.cpp")
|
SOURCES=$(shell find -type f -name "*.cpp")
|
||||||
OBJECTS=$(SOURCES:.cpp=.o)
|
OBJECTS=$(SOURCES:.cpp=.o)
|
||||||
WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram
|
WPILIB=/var/frc/wpilib
|
||||||
|
EXEC=bin/FRCUserProgram
|
||||||
CLEANSER=rm -r
|
CLEANSER=rm -r
|
||||||
|
|
||||||
all : $(OBJECTS)
|
all : $(OBJECTS)
|
||||||
|
@ -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
|
LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a
|
||||||
SOURCES=$(shell find -type f -name "*.cpp")
|
SOURCES=$(shell find -type f -name "*.cpp")
|
||||||
OBJECTS=$(SOURCES:.cpp=.o)
|
OBJECTS=$(SOURCES:.cpp=.o)
|
||||||
WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram
|
WPILIB=/var/frc/wpilib
|
||||||
|
EXEC=bin/FRCUserProgram
|
||||||
CLEANSER=rm -r
|
CLEANSER=rm -r
|
||||||
|
|
||||||
all : $(OBJECTS)
|
all : $(OBJECTS)
|
||||||
|
Loading…
Reference in New Issue
Block a user