types.cpp
Go to the documentation of this file.
00001 #include "create/types.h"
00002 
00003 namespace create {
00004 
00005   RobotModel::RobotModel(const ProtocolVersion version, const float axleLength, const unsigned int baud, const float maxVelocity, const float wheelDiameter):
00006     id(nextId),
00007     version(version),
00008     axleLength(axleLength),
00009     baud(baud),
00010     maxVelocity(maxVelocity),
00011     wheelDiameter(wheelDiameter) {
00012     nextId <<= 1;
00013   }
00014 
00015   bool RobotModel::operator ==(RobotModel& other) const {
00016     return id == other.id;
00017   }
00018 
00019   RobotModel::operator uint32_t() const {
00020     return id;
00021   }
00022 
00023   uint32_t RobotModel::getId() const {
00024     return id;
00025   }
00026 
00027   ProtocolVersion RobotModel::getVersion() const {
00028     return version;
00029   }
00030 
00031   float RobotModel::getAxleLength() const {
00032     return axleLength;
00033   }
00034 
00035   unsigned int RobotModel::getBaud() const {
00036     return baud;
00037   }
00038 
00039   float RobotModel::getMaxVelocity() const {
00040     return maxVelocity;
00041   }
00042 
00043   float RobotModel::getWheelDiameter() const {
00044     return wheelDiameter;
00045   }
00046 
00047   uint32_t RobotModel::nextId = 1;
00048 
00049   RobotModel RobotModel::ROOMBA_400(V_1, 0.258, 57600);
00050   RobotModel RobotModel::CREATE_1(V_2, 0.258, 57600);
00051   RobotModel RobotModel::CREATE_2(V_3, 0.235, 115200);
00052 }


libcreate
Author(s): Jacob Perron
autogenerated on Sat Nov 26 2016 03:41:46