#include <motor_message.h>
Public Member Functions | |
int | deserialize (const RawMotorMessage &serialized) |
int32_t | getData () const |
MotorMessage::Registers | getRegister () const |
MotorMessage::MessageTypes | getType () const |
MotorMessage () | |
RawMotorMessage | serialize () const |
void | setData (int32_t data) |
void | setRegister (MotorMessage::Registers reg) |
void | setType (MotorMessage::MessageTypes type) |
~MotorMessage () | |
Static Private Member Functions | |
static uint8_t | generateChecksum (const std::vector< uint8_t > &data) |
static uint8_t | generateChecksum (const RawMotorMessage &data) |
static int | verifyRegister (uint8_t r) |
static int | verifyType (uint8_t t) |
Private Attributes | |
boost::array< uint8_t, 4 > | data |
uint8_t | register_addr |
uint8_t | type |
Static Private Attributes | |
static const uint8_t | delimeter |
static const uint8_t | protocol_version |
static const uint8_t | valid_registers [] |
static const uint8_t | valid_types [] |
Definition at line 40 of file motor_message.h.
enum MotorMessage::Limits |
Enumerator | |
---|---|
LIM_M1_PWM | |
LIM_M2_PWM | |
LIM_M1_INTEGRAL | |
LIM_M2_INTEGRAL |
Definition at line 130 of file motor_message.h.
Enumerator | |
---|---|
TYPE_READ | |
TYPE_WRITE | |
TYPE_RESPONSE | |
TYPE_ERROR |
Definition at line 47 of file motor_message.h.
Definition at line 55 of file motor_message.h.
|
inline |
Definition at line 43 of file motor_message.h.
|
inline |
Definition at line 44 of file motor_message.h.
int MotorMessage::deserialize | ( | const RawMotorMessage & | serialized | ) |
Definition at line 139 of file motor_message.cc.
|
staticprivate |
|
staticprivate |
Definition at line 190 of file motor_message.cc.
int32_t MotorMessage::getData | ( | ) | const |
Definition at line 123 of file motor_message.cc.
MotorMessage::Registers MotorMessage::getRegister | ( | ) | const |
Definition at line 110 of file motor_message.cc.
MotorMessage::MessageTypes MotorMessage::getType | ( | ) | const |
Definition at line 100 of file motor_message.cc.
RawMotorMessage MotorMessage::serialize | ( | ) | const |
Definition at line 129 of file motor_message.cc.
void MotorMessage::setData | ( | int32_t | data | ) |
Definition at line 114 of file motor_message.cc.
void MotorMessage::setRegister | ( | MotorMessage::Registers | reg | ) |
Definition at line 104 of file motor_message.cc.
void MotorMessage::setType | ( | MotorMessage::MessageTypes | type | ) |
Definition at line 94 of file motor_message.cc.
|
staticprivate |
Definition at line 180 of file motor_message.cc.
|
staticprivate |
Definition at line 171 of file motor_message.cc.
|
private |
Definition at line 157 of file motor_message.h.
|
staticprivate |
Definition at line 159 of file motor_message.h.
|
staticprivate |
Definition at line 161 of file motor_message.h.
|
private |
Definition at line 154 of file motor_message.h.
|
private |
Definition at line 152 of file motor_message.h.
|
staticprivate |
Definition at line 165 of file motor_message.h.
|
staticprivate |
Copyright (c) 2016, Ubiquity Robotics All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of ubiquity_motor nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition at line 164 of file motor_message.h.