#include <motor_message.h>
Public Member Functions | |
MotorMessage::ErrorCodes | 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 Public Attributes | |
static const uint8_t | delimeter = 0x7E |
static const int32_t | MOT_POW_ACTIVE = 0x0001 |
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 | protocol_version |
static const uint8_t | valid_registers [] |
static const uint8_t | valid_types [] |
Definition at line 55 of file motor_message.h.
Enumerator | |
---|---|
ERR_NONE | |
ERR_DELIMITER | |
ERR_WRONG_PROTOCOL | |
ERR_BAD_CHECKSUM | |
ERR_BAD_TYPE | |
ERR_UNKNOWN_REGISTER |
Definition at line 189 of file motor_message.h.
Enumerator | |
---|---|
OPT_ENC_6_STATE |
Definition at line 158 of file motor_message.h.
enum MotorMessage::Limits |
Enumerator | |
---|---|
LIM_M1_PWM | |
LIM_M2_PWM | |
LIM_M1_INTEGRAL | |
LIM_M2_INTEGRAL | |
LIM_M1_MAX_SPD | |
LIM_M2_MAX_SPD | |
LIM_PARAM_LIMIT |
Definition at line 163 of file motor_message.h.
Enumerator | |
---|---|
TYPE_READ | |
TYPE_WRITE | |
TYPE_RESPONSE | |
TYPE_ERROR |
Definition at line 62 of file motor_message.h.
Definition at line 70 of file motor_message.h.
|
inline |
Definition at line 58 of file motor_message.h.
|
inline |
Definition at line 59 of file motor_message.h.
MotorMessage::ErrorCodes MotorMessage::deserialize | ( | const RawMotorMessage & | serialized | ) |
Definition at line 148 of file motor_message.cc.
|
staticprivate |
|
staticprivate |
Definition at line 197 of file motor_message.cc.
int32_t MotorMessage::getData | ( | ) | const |
Definition at line 132 of file motor_message.cc.
MotorMessage::Registers MotorMessage::getRegister | ( | ) | const |
Definition at line 119 of file motor_message.cc.
MotorMessage::MessageTypes MotorMessage::getType | ( | ) | const |
Definition at line 109 of file motor_message.cc.
RawMotorMessage MotorMessage::serialize | ( | ) | const |
Definition at line 138 of file motor_message.cc.
void MotorMessage::setData | ( | int32_t | data | ) |
Definition at line 123 of file motor_message.cc.
void MotorMessage::setRegister | ( | MotorMessage::Registers | reg | ) |
Definition at line 113 of file motor_message.cc.
void MotorMessage::setType | ( | MotorMessage::MessageTypes | type | ) |
Definition at line 103 of file motor_message.cc.
|
staticprivate |
Definition at line 187 of file motor_message.cc.
|
staticprivate |
Definition at line 178 of file motor_message.cc.
|
private |
Definition at line 209 of file motor_message.h.
|
static |
Definition at line 200 of file motor_message.h.
|
static |
Definition at line 174 of file motor_message.h.
|
staticprivate |
Definition at line 211 of file motor_message.h.
|
private |
Definition at line 206 of file motor_message.h.
|
private |
Definition at line 204 of file motor_message.h.
|
staticprivate |
Definition at line 215 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 214 of file motor_message.h.