#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 | |
const static uint8_t | delimeter = 0x7E |
const static int32_t | MOT_POW_ACTIVE = 0x0001 |
Static Private Member Functions | |
static uint8_t | generateChecksum (const RawMotorMessage &data) |
static uint8_t | generateChecksum (const std::vector< uint8_t > &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 | |
const static uint8_t | protocol_version |
const static uint8_t | valid_registers [] |
const static uint8_t | valid_types [] |
Definition at line 67 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 256 of file motor_message.h.
Enumerator | |
---|---|
OPT_ENC_6_STATE | |
OPT_WHEEL_TYPE_THIN | |
OPT_WHEEL_DIR_REVERSE | |
OPT_DRIVE_TYPE_4WD | |
OPT_WHEEL_TYPE_STANDARD | |
OPT_DRIVE_TYPE_STANDARD | |
OPT_WHEEL_DIR_STANDARD |
Definition at line 192 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 230 of file motor_message.h.
Enumerator | |
---|---|
TYPE_READ | |
TYPE_WRITE | |
TYPE_RESPONSE | |
TYPE_ERROR |
Definition at line 74 of file motor_message.h.
Definition at line 176 of file motor_message.h.
Definition at line 82 of file motor_message.h.
Definition at line 206 of file motor_message.h.
Enumerator | |
---|---|
SYS_EVENT_POWERON |
Definition at line 225 of file motor_message.h.
|
inline |
Definition at line 70 of file motor_message.h.
|
inline |
Definition at line 71 of file motor_message.h.
MotorMessage::ErrorCodes MotorMessage::deserialize | ( | const RawMotorMessage & | serialized | ) |
Definition at line 151 of file motor_message.cc.
|
staticprivate |
Definition at line 200 of file motor_message.cc.
|
staticprivate |
int32_t MotorMessage::getData | ( | ) | const |
Definition at line 135 of file motor_message.cc.
MotorMessage::Registers MotorMessage::getRegister | ( | ) | const |
Definition at line 122 of file motor_message.cc.
MotorMessage::MessageTypes MotorMessage::getType | ( | ) | const |
Definition at line 112 of file motor_message.cc.
RawMotorMessage MotorMessage::serialize | ( | ) | const |
Definition at line 141 of file motor_message.cc.
void MotorMessage::setData | ( | int32_t | data | ) |
Definition at line 126 of file motor_message.cc.
void MotorMessage::setRegister | ( | MotorMessage::Registers | reg | ) |
Definition at line 116 of file motor_message.cc.
void MotorMessage::setType | ( | MotorMessage::MessageTypes | type | ) |
Definition at line 106 of file motor_message.cc.
|
staticprivate |
Definition at line 190 of file motor_message.cc.
|
staticprivate |
Definition at line 181 of file motor_message.cc.
|
private |
Definition at line 276 of file motor_message.h.
|
static |
Definition at line 267 of file motor_message.h.
|
static |
Definition at line 241 of file motor_message.h.
|
staticprivate |
Definition at line 278 of file motor_message.h.
|
private |
Definition at line 273 of file motor_message.h.
|
private |
Definition at line 271 of file motor_message.h.
|
staticprivate |
Definition at line 282 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 281 of file motor_message.h.