Add support for first generation Create (Roomba 400 series)

This commit is contained in:
Jacob Perron 2016-03-14 20:04:34 -07:00
parent ee4c06a404
commit f073458624
7 changed files with 348 additions and 132 deletions

View file

@ -51,6 +51,8 @@ namespace create {
LED_CHECK = 8
};
RobotModel model;
uint8_t mainMotorPower;
uint8_t sideMotorPower;
uint8_t vacuumMotorPower;
@ -85,11 +87,11 @@ namespace create {
/* Default constructor.
* Does not attempt to establish serial connection to Create.
*/
Create();
Create(RobotModel = CREATE_2);
/* Attempts to establish serial connection to Create.
*/
Create(const std::string& port, const int& baud);
Create(const std::string& port, const int& baud, RobotModel = CREATE_2);
~Create();

View file

@ -48,7 +48,7 @@ namespace create {
std::vector<uint8_t> ids;
public:
Data();
Data(RobotModel = CREATE_2);
~Data();
bool isValidPacketID(const uint8_t id) const;

View file

@ -33,6 +33,11 @@ POSSIBILITY OF SUCH DAMAGE.
#define CREATE_TYPES_H
namespace create {
enum RobotModel {
CREATE_1 = 0, // Roomba 400 series
CREATE_2 // Roomba 600 series
};
enum SensorPacketID {
ID_GROUP_0 = 0,
ID_GROUP_1 = 1,