mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Preliminary can support
This commit is contained in:
parent
71e4f36e96
commit
32154cf6aa
@ -21,6 +21,7 @@ void HHBase::DisabledPeriodic(){}
|
|||||||
void HHBase::AutonomousPeriodic(){
|
void HHBase::AutonomousPeriodic(){
|
||||||
}
|
}
|
||||||
void HHBase::TeleopPeriodic(){
|
void HHBase::TeleopPeriodic(){
|
||||||
|
hhbot->Handler();
|
||||||
}
|
}
|
||||||
void HHBase::Test(){}
|
void HHBase::Test(){}
|
||||||
START_ROBOT_CLASS(HHBase);
|
START_ROBOT_CLASS(HHBase);
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
#include "HHRobot.h"
|
#include "HHRobot.h"
|
||||||
#include "HHBase.h"
|
#include "HHBase.h"
|
||||||
HHRobot::HHRobot():
|
HHRobot::HHRobot():
|
||||||
//
|
tmpMotor1(new CANTalon(0)),
|
||||||
hhdrive(new RobotDrive(2,0,3,1)),
|
|
||||||
joystick1(new Extreme3dPro(0)){
|
joystick1(new Extreme3dPro(0)){
|
||||||
hhdrive->SetExpiration(0.1);
|
|
||||||
hhdrive->SetInvertedMotor(RobotDrive::kFrontRightMotor, true);
|
|
||||||
hhdrive->SetInvertedMotor(RobotDrive::kRearLeftMotor,true);
|
|
||||||
}
|
}
|
||||||
void HHRobot::Init(){
|
void HHRobot::Init(){
|
||||||
printf("Initing\n");
|
printf("Initing\n");
|
||||||
printf("Code Version: %f\n",0000.1);
|
printf("Code Version: %f\n",0000.1);
|
||||||
//Put table values initally to avoid annoying refreshing
|
|
||||||
}
|
}
|
||||||
//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(){
|
||||||
hhdrive->MecanumDrive_Cartesian(joystick1->GetJoystickAxis("z"), joystick1->GetJoystickAxis("y"), joystick1->GetJoystickAxis("x"));
|
tmpMotor1->Set(joystick1->GetJoystickAxis("y"));
|
||||||
|
SmartDashboard::PutNumber("tmp",joystick1->GetJoystickAxis("y"));
|
||||||
}
|
}
|
||||||
// vim: ts=2:sw=2:et
|
// vim: ts=2:sw=2:et
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "hhlib/input/controller/Joystick.h"
|
#include "hhlib/input/controller/Joystick.h"
|
||||||
class HHRobot{
|
class HHRobot{
|
||||||
private:
|
private:
|
||||||
RobotDrive *hhdrive;
|
CANTalon *tmpMotor1;
|
||||||
Extreme3dPro *joystick1;
|
Extreme3dPro *joystick1;
|
||||||
public:
|
public:
|
||||||
HHRobot();
|
HHRobot();
|
||||||
|
27
src/Makefile
Normal file
27
src/Makefile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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
|
||||||
|
CLEANSER=rm -r
|
||||||
|
REMOTEIP=10.20.59.2
|
||||||
|
|
||||||
|
all : $(OBJECTS)
|
||||||
|
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
||||||
|
|
||||||
|
%.o : %.cpp
|
||||||
|
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(CLEANSER) $(OBJECTS)
|
||||||
|
|
||||||
|
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'
|
||||||
|
|
||||||
|
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'
|
||||||
|
|
||||||
|
updatemakefile:
|
||||||
|
@curl -s https://raw.githubusercontent.com/int0x191f2/nameless/master/configure.sh | sh
|
29
src/Makefile.old
Normal file
29
src/Makefile.old
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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
|
||||||
|
CLEANSER=rm -r
|
||||||
|
REMOTEIP=10.0.1.31
|
||||||
|
|
||||||
|
all : $(OBJECTS)
|
||||||
|
$(CC) -L$(WPILIB)/lib $(LDFLAGS) -o $(EXEC) $(OBJECTS) -lwpi
|
||||||
|
|
||||||
|
%.o : %.cpp
|
||||||
|
$(CC) $(CFLAGS) -I$(WPILIB)/include $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(CLEANSER) $(OBJECTS)
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
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'
|
||||||
|
|
||||||
|
updatemakefile:
|
||||||
|
@curl -s https://raw.githubusercontent.com/int0x191f2/nameless/master/configure.sh | sh
|
Loading…
Reference in New Issue
Block a user