Wyatt
1.0.1
|
#include <MotorMessage.h>
Public Member Functions | |
MotorMessage (Hardware hardware, int data) | |
~MotorMessage () override | |
std::string | serialize () override |
int | getData () |
Public Member Functions inherited from IMessage | |
IMessage (Hardware hardware) | |
virtual | ~IMessage () |
Hardware | getHardware () |
Additional Inherited Members | |
Protected Attributes inherited from IMessage | |
Hardware | hardware |
Message class encapsulating data sent to the Pololu motors. TODO: Change the data type from an integer specifying motor power to a double specifying wheel speed in cm/s
Definition at line 10 of file MotorMessage.h.
MotorMessage::MotorMessage | ( | Hardware | hardware, |
int | data | ||
) |
Constructor
hardware | The hardware address of the motor |
data | An Integer representing the speed of the motor [-4095 - 4095] = [Full Backwards, Full Forwards] |
MessageLengthException | if the hardware size does not match |
DataSizeException | if data exceeds FULL_FORWARDS/FULL_BACKWARDS as defined in DriveConstants |
Definition at line 4 of file MotorMessage.cpp.
|
override |
Destructor
Definition at line 17 of file MotorMessage.cpp.
int MotorMessage::getData | ( | ) |
Returns the data the message is encapsulating.
Definition at line 21 of file MotorMessage.cpp.
|
overridevirtual |
Serializes the message into a string representation. The hardware address is appended to the front.
Implements IMessage.
Definition at line 25 of file MotorMessage.cpp.