Wyatt
1.0.1
|
#include <EncoderMessage.h>
Public Member Functions | |
EncoderMessage (Hardware hardware, double data) | |
~EncoderMessage () override | |
std::string | serialize () override |
double | 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 between the raspi and the pololu motor encoders. The Double data represents the RPM of the motor. It may need to be scaled depending on the gear ratio. TODO: to decouple the program from the hardware, the data should represent the speed of the motors in cm/s instead of rpm.
Definition at line 15 of file EncoderMessage.h.
EncoderMessage::EncoderMessage | ( | Hardware | hardware, |
double | data | ||
) |
Constructor.
hardware | The hardware address for the encoder |
data | Double representing the RPM speed of the motors |
MessageLengthException | if hardware length does not match the data size |
Definition at line 7 of file EncoderMessage.cpp.
|
override |
Destructor.
Definition at line 15 of file EncoderMessage.cpp.
double EncoderMessage::getData | ( | ) |
Returns the double data the message is encapsulating
Definition at line 19 of file EncoderMessage.cpp.
|
overridevirtual |
Serializes the message into a string representation. The hardware address is appended to the front.
Implements IMessage.
Definition at line 23 of file EncoderMessage.cpp.