Wyatt
1.0.1
Main Page
Classes
Files
File List
include
commands
DriveMotorRPM.h
1
//
2
// Created by Tucker Haydon on 4/27/17.
3
//
4
5
#pragma once
6
#include "../hardwareinterface/MotorAdapter.h"
7
#include "../sensors/EncoderSensor.h"
8
#include "../Communicator.h"
9
#include "Command.h"
10
#include "../DriveConstants.h"
11
#include <stdlib.h>
12
#include <math.h>
13
17
class
DriveMotorRPM
:
public
Command
{
18
19
public
:
20
29
DriveMotorRPM
(
Communicator
* comm,
Hardware
motorHardware,
EncoderSensor
* encoder,
int
desiredRPM,
int
direction);
30
34
~DriveMotorRPM
();
35
40
bool
execute
()
override
;
41
47
bool
cleanup
(
bool
canceled)
override
;
48
49
private
:
50
int
desiredRPM;
51
int
direction;
52
Hardware
motorHardware;
53
EncoderSensor
* encoder;
54
Communicator
* comm;
55
56
double
k_p = 1.0;
57
double
k_d = 0.0;
58
59
double
lastDiff = 0;
60
double
setpoint = 0;
61
62
};
DriveMotorRPM::~DriveMotorRPM
~DriveMotorRPM()
Definition:
DriveMotorRPM.cpp:18
Hardware
Definition:
Hardware.h:11
Communicator
Definition:
Communicator.h:22
DriveMotorRPM::DriveMotorRPM
DriveMotorRPM(Communicator *comm, Hardware motorHardware, EncoderSensor *encoder, int desiredRPM, int direction)
Definition:
DriveMotorRPM.cpp:9
DriveMotorRPM::execute
bool execute() override
Definition:
DriveMotorRPM.cpp:22
DriveMotorRPM::cleanup
bool cleanup(bool canceled) override
Definition:
DriveMotorRPM.cpp:51
Command
Definition:
Command.h:6
DriveMotorRPM
Definition:
DriveMotorRPM.h:17
EncoderSensor
Definition:
EncoderSensor.h:17
Generated by
1.8.11