ART v1.0-alpha
A Robot Template that raises the floor for VRC teams
Loading...
Searching...
No Matches
TankDrive.cpp
Go to the documentation of this file.
1
16#include "ART/TankDrive.h"
17
18namespace art
19{
20 TankDrive::TankDrive(vex::motor_group left, vex::motor_group right) : m_left(left), m_right(right) {}
21
22 void TankDrive::arcade(double x, double y, double rot)
23 {
24 m_cmdX = x;
25 m_cmdY = y;
26 m_cmdRot = rot;
27 update();
28 }
29 void TankDrive::arcade(double drive, double rot)
30 {
31 m_cmdY = drive;
32 m_cmdRot = rot;
33 update();
34 }
35 void TankDrive::tank(double left, double right){
36 m_cmdY = left + right;
37 m_cmdRot = left - right;
38 update();
39 }
40
41 void TankDrive::LeftSplitArcade(const vex::controller &cont)
42 {
43 arcade(cont.Axis3.position(), cont.Axis1.position());
44 update();
45 }
46 void TankDrive::LeftSplitArcadeCurved(const vex::controller &cont)
47 {
48 arcade(cont.Axis3.position() * cont.Axis3.position() * cont.Axis3.position() * 0.01 * 0.01,
49 cont.Axis1.position() * cont.Axis1.position() * cont.Axis1.position() * 0.01 * 0.01);
50 update();
51 }
57} // namespace art
Header containing the TankDrive class.
void set(double cmd)
Sets the motor to spin at the specified command.
SimpleMotorGroup m_left
a SimpleMotorGroup for the left side
Definition TankDrive.h:164
double m_cmdY
The Stored command for the Y-direction.
Definition TankDrive.h:193
TankDrive(vex::motor_group left, vex::motor_group right)
Construct a new Tank Drive object.
Definition TankDrive.cpp:20
void LeftSplitArcade(const vex::controller &cont)
Commands the TankDrive using arcade inputs directly from a controller.
Definition TankDrive.cpp:41
void arcade(double x, double y, double rot)
Commands the TankDrive using arcade inputs.
Definition TankDrive.cpp:22
void tank(double left, double right)
Commands the TankDrive using tank inputs.
Definition TankDrive.cpp:35
SimpleMotorGroup m_right
a SimpleMotorGroup for the right side
Definition TankDrive.h:174
void update()
Uses the stored commands to command the motors.
Definition TankDrive.cpp:52
double m_cmdRot
The Stored command for rotation.
Definition TankDrive.h:201
double m_cmdX
The Stored command for the X-direction.
Definition TankDrive.h:185
void LeftSplitArcadeCurved(const vex::controller &cont)
Commands the TankDrive using arcade inputs directly from a controller.
Definition TankDrive.cpp:46
Definition PID.h:20