-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChassis.h
More file actions
50 lines (37 loc) · 1.54 KB
/
Chassis.h
File metadata and controls
50 lines (37 loc) · 1.54 KB
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
48
49
50
#ifndef CHASSIS_H
#define CHASSIS_H
#include <WPILib.h>
#include "Portnums.h"
class Chassis {
public:
// These methods are visable (callable) to anyone using this class
// If you wish to add or remove any public methods, talk to Nick Papadakis
// Constructor
Chassis(int inLeft, int inRight, int inTilt);
//Initialization
bool Init();
// Drives the chassis with two values: one for the right motor and one for the left
// Arguments: left - Speed of left motor; -1 to 1. right - Speed of right motor; -1 to 1
void TankDrive(float inLeft, float inRight, float throttle = 1, bool invert = false);
// Drives the chassis with two values: a forward speed and a turn speed
// Arguments: forward - Speed at which to move forward; -1 to 1. turn - Speed to turn; -1 to 1
void ArcadeDrive(float forward, float turn, float throttle = 1, bool invert = false);
//Sets Jaguars to brake mode so the motors provide resistance when Jaguars are set to 0
void SetBrake();
//Sets Jaguars to coast mode so the motors don't provide resistance when the Jaguars are set to 0
void SetCoast();
//Manually utilizes the lifter arm to tilt the chassis
void ManualTilt(float speed);
// Turns off all motors controlled by this class
void Disable();
// Does general processing and should be called every 20ms
void Idle();
private:
// Put useful functions and variables here
bool Initialized;
CANJaguar *LeftJag;
CANJaguar *RightJag;
CANJaguar *TiltJag;
RobotDrive *drivetrain;
};
#endif