Eagan, MN
Welcome to the Lockheed Martin / Thomson-Reuters & Eagan High School Team 2220 Website!

PostHeaderIcon Turret.h

#ifndef BTTURRET_H_

#define BTTURRET_H_

 

#include "WPILib.h"

#include <iostream.h>

#include "math.h"

#include "BaeUtilities.h"

 

#include "BTRobot.h"

#include "BTCamera.h"

#include "ControlBoard.h"

 

 

class BTTurret

{

public:

static const int TURRET_FULL_CIRCLE = 1664;

Encoder* turretEnc;

Jaguar* turretMotor;

BTCamera* camera;

//bool foundColor;

bool clLimitPressed;

bool ccLimitPressed;

bool overridden;

bool centered;

BTTurret(ControlBoard*);

//bool FollowCamera(float, bool);

bool Update(void);

void Override(void);

void COTPan(void);

void Center(void);

bool IsColorFound(void);

private:

int count;

static const int ENCODER_FULL_CIRCLE = 128;

static const int TURRET_TO_ENCODER_RATIO = 13;

static const int TURRET_HALF_CIRCLE = 832;

static const int TURRET_QUARTER_CIRCLE = 416;

static const int TURRET_ROTATION_TOLERANCE = 100; //encoder ticks

static const float TURRET_ROTATION_TOLERANCE_NORM = 0.05; // 5% of image range

static const int CL_LIMIT_POSITION = 50;

static const int CC_LIMIT_POSITION = 1614;

static const float MAX_NO_SLIP_SPEED = 0.5;

 

 

DigitalInput* clLimit;

DigitalInput* ccLimit;

DigitalInput* centerLimit;

 

ControlBoard* controlBoard;

 

int ServoToEncRange(float);

};

 

#endif