mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Added mecanum drive (kinda works maybe)
This commit is contained in:
parent
32154cf6aa
commit
4c1e3d1767
@ -1,8 +1,9 @@
|
|||||||
#include "HHRobot.h"
|
#include "HHRobot.h"
|
||||||
#include "HHBase.h"
|
#include "HHBase.h"
|
||||||
HHRobot::HHRobot():
|
HHRobot::HHRobot():
|
||||||
tmpMotor1(new CANTalon(0)),
|
DriveStick(new Extreme3dPro(0)),
|
||||||
joystick1(new Extreme3dPro(0)){
|
//FrontRight,FrontLeft,RearRight,RearLeft
|
||||||
|
RobotDrive(new MecanumDrive(40,41,42,43)){
|
||||||
}
|
}
|
||||||
void HHRobot::Init(){
|
void HHRobot::Init(){
|
||||||
printf("Initing\n");
|
printf("Initing\n");
|
||||||
@ -10,7 +11,6 @@ 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(){
|
||||||
tmpMotor1->Set(joystick1->GetJoystickAxis("y"));
|
RobotDrive->handler(DriveStick->GetJoystickAxis("x"),DriveStick->GetJoystickAxis("y"),DriveStick->GetJoystickAxis("z"),0);
|
||||||
SmartDashboard::PutNumber("tmp",joystick1->GetJoystickAxis("y"));
|
|
||||||
}
|
}
|
||||||
// vim: ts=2:sw=2:et
|
// vim: ts=2:sw=2:et
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
#include <WPILib.h>
|
#include <WPILib.h>
|
||||||
#include "HHBase.h"
|
#include "HHBase.h"
|
||||||
#include "hhlib/input/controller/Joystick.h"
|
#include "hhlib/input/controller/Joystick.h"
|
||||||
|
#include "hhlib/drive/MecanumDrive.h"
|
||||||
class HHRobot{
|
class HHRobot{
|
||||||
private:
|
private:
|
||||||
CANTalon *tmpMotor1;
|
Extreme3dPro *DriveStick;
|
||||||
Extreme3dPro *joystick1;
|
MecanumDrive *RobotDrive;
|
||||||
public:
|
public:
|
||||||
HHRobot();
|
HHRobot();
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
|
REMOTEIP=10.20.59.2
|
||||||
CC=arm-frc-linux-gnueabi-g++
|
CC=arm-frc-linux-gnueabi-g++
|
||||||
CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0
|
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
|
WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram
|
||||||
EXEC=bin/FRCUserProgram
|
|
||||||
CLEANSER=rm -r
|
CLEANSER=rm -r
|
||||||
REMOTEIP=10.20.59.2
|
|
||||||
|
|
||||||
all : $(OBJECTS)
|
all : $(OBJECTS)
|
||||||
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
||||||
@ -15,7 +14,7 @@ all : $(OBJECTS)
|
|||||||
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(CLEANSER) $(OBJECTS)
|
$(CLEANSER) $(OBJECTS) bin/FRCUserProgram
|
||||||
|
|
||||||
deploy:
|
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'
|
@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'
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
|
REMOTEIP=10.20.59.2
|
||||||
CC=arm-frc-linux-gnueabi-g++
|
CC=arm-frc-linux-gnueabi-g++
|
||||||
CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0
|
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
|
WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram
|
||||||
EXEC=bin/FRCUserProgram
|
|
||||||
CLEANSER=rm -r
|
CLEANSER=rm -r
|
||||||
REMOTEIP=10.0.1.31
|
|
||||||
|
|
||||||
all : $(OBJECTS)
|
all : $(OBJECTS)
|
||||||
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
||||||
@ -15,12 +14,10 @@ all : $(OBJECTS)
|
|||||||
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(CLEANSER) $(OBJECTS)
|
$(CLEANSER) $(OBJECTS) bin/FRCUserProgram
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
@ssh -v admin@$(REMOTEIP) "rm /home/lvuser/FRCUserProgram"
|
@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'
|
||||||
@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"
|
|
||||||
|
|
||||||
putkey:
|
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'
|
@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'
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 17606cc482c4cdde363c96fda0b6efd92ccdbad9
|
Subproject commit b8306e85030cbd5fea1e15b60b608efc219477b1
|
Loading…
Reference in New Issue
Block a user