-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDriveTrain.h
executable file
·47 lines (44 loc) · 1.16 KB
/
DriveTrain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef DRIVETRAIN_H
#define DRIVETRAIN_H
#include <RobotDrive.h>
#include "EncodeDistance.h"
#include "ports.h"
#include "Sensors.h"
class DriveTrain : public RobotDrive
{
public:
DriveTrain(class main_robot* robot,
uint8_t modFL,uint32_t chanFL,
uint8_t modRL,uint32_t chanRL,
uint8_t modFR,uint32_t chanFR,
uint8_t modRR,uint32_t chanRR);
~DriveTrain();
enum Dir{RIGHT, LEFT};
void autoDrive(double distance);
void autoTurn(double degrees);
void teleTurn(Dir direction, double power);
void updateDrive();
void updateTurn();
void update();
bool isAuto();
void stopAuto();
EncodeDistance* encode;
Sensors* sensor;
class main_robot* robot;
bool isMovingL;
bool isMovingR;
bool isTurningL;
bool isTurningR;
bool hasDriven;
bool hasTurned;
double neededDist;
double originUltraDist;
float speedL;
float speedR;
static const double SPEED;
static const double PI = 3.14159265;
static const double ROBOTRAD = 3.0;
static const double CIRCUMROBOT;
static const double ZEROTEST = 0.001;
};
#endif // DRIVETRAIN_H