2
0
mirror of https://github.com/team2059/Dent synced 2025-01-07 22:14:14 -05:00

Inital commit of the codes

This commit is contained in:
Adam Long 2015-01-06 00:07:24 +00:00
commit cd5b063fec
5 changed files with 90 additions and 0 deletions

27
src/HHBase.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "HHBase.h"
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <map>
HHBase::HHBase():
hhbot(new HHRobot()){
printf("Done\n");
}
void HHBase::RobotInit(){
}
void HHBase::DisabledInit(){}
void HHBase::AutonomousInit(){
}
void HHBase::TeleopInit(){
}
void HHBase::DisabledContinuous(){}
void HHBase::AutonomousContinuous(){}
void HHBase::TeleopContinuous(){}
void HHBase::DisabledPeriodic(){}
void HHBase::AutonomousPeriodic(){
}
void HHBase::TeleopPeriodic(){
}
void HHBase::Test(){}
START_ROBOT_CLASS(HHBase);
// vim: ts=2:sw=2:et

26
src/HHBase.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef __HH_BASE_H__
#define __HH_BASE_H__
#include <WPILib.h>
#include <string>
#include "HHRobot.h"
//Because this is the first header to be included, classes need to be declared here
class HHRobot;
class HHBase : public IterativeRobot{
private:
HHRobot *hhbot;
public:
HHBase();
void RobotInit();
void DisabledInit();
void AutonomousInit();
void TeleopInit();
void DisabledContinuous();
void AutonomousContinuous();
void TeleopContinuous();
void DisabledPeriodic();
void AutonomousPeriodic();
void TeleopPeriodic();
void Test();
};
#endif
// vim: ts=2:sw=2:et

20
src/HHRobot.cpp Normal file
View File

@ -0,0 +1,20 @@
#include "HHRobot.h"
#include "HHBase.h"
HHRobot::HHRobot():
//
hhdrive(new RobotDrive(2,0,3,1)),
joystick1(new Extreme3dPro(0)){
hhdrive->SetExpiration(0.1);
hhdrive->SetInvertedMotor(RobotDrive::kFrontRightMotor, true);
hhdrive->SetInvertedMotor(RobotDrive::kRearLeftMotor,true);
}
void HHRobot::Init(){
printf("Initing\n");
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
void HHRobot::Handler(){
hhdrive->MecanumDrive_Cartesian(joystick1->GetJoystickAxis("z"), joystick1->GetJoystickAxis("y"), joystick1->GetJoystickAxis("x"));
}
// vim: ts=2:sw=2:et

16
src/HHRobot.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef __ZAPHOD_ROBOT_H__
#define __ZAPHOD_ROBOT_H__
#include <WPILib.h>
#include "HHBase.h"
#include "hhlib/input/controller/Joystick.h"
class HHRobot{
private:
Extreme3dPro *joystick1;
RobotDrive *hhdrive;
public:
HHRobot();
void Init();
void Handler();
};
#endif
// vim: ts=2:sw=2:et

1
src/hhlib Submodule

@ -0,0 +1 @@
Subproject commit 17606cc482c4cdde363c96fda0b6efd92ccdbad9