From d2d10a55c09fe0ff771fd0fcec2d8219b0dbadc7 Mon Sep 17 00:00:00 2001 From: tarang Date: Sun, 11 Dec 2016 13:16:32 +0530 Subject: [PATCH 1/4] Added Id based commands for RoboCAN support --- ErrorCodes.h | 6 +- README.md | 14 + RoboteqDevice.cpp | 711 ++++++++++++++++++++++++++++++---------------- RoboteqDevice.h | 61 ++-- sample.cpp | 86 +++--- 5 files changed, 569 insertions(+), 309 deletions(-) diff --git a/ErrorCodes.h b/ErrorCodes.h index 029629b..2a2077e 100644 --- a/ErrorCodes.h +++ b/ErrorCodes.h @@ -1,13 +1,13 @@ #ifndef __ErrorCodes_H_ #define __ErrorCodes_H_ -#define RQ_INVALID_HANDLE -1 +#define RQ_INVALID_HANDLE -1 #define RQ_SUCCESS 0 #define RQ_ERR_OPEN_PORT 1 #define RQ_ERR_NOT_CONNECTED 2 #define RQ_ERR_TRANSMIT_FAILED 3 -#define RQ_ERR_SERIAL_IO 4 -#define RQ_ERR_SERIAL_RECEIVE 5 +#define RQ_ERR_SERIAL_IO 4 +#define RQ_ERR_SERIAL_RECEIVE 5 #define RQ_INVALID_RESPONSE 6 #define RQ_UNRECOGNIZED_DEVICE 7 #define RQ_UNRECOGNIZED_VERSION 8 diff --git a/README.md b/README.md index f628f4c..df5e781 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +# Roboteq Linux Driver + +This is forked from the original Roboteq Linux API which has been found to be outdated(last updated 2014). Many fixes were made in another [fork](https://github.com/brettpac/Roboteq-Linux-API). + +This library derives from improvements made by @brettpac and adds support for RoboCAN based ID referencing for the motors and Debug support. + +All Get and Set commands now have a `Set__ID()` alternative which sends IDs for RoboCAN compatibility. For example, `SetCommandId()` + +`Some parts are still WIP and untested, so may it not work as expected.` + +The older Readme is as follows + +``` # Roboteq-Linux-API This is a branch of the Roboteq Linux API (http://www.roboteq.com/index.php/support/downloads) for the Roboteq NxtGen Series of Motor Controllers. After my own difficulties with the API, some forum posts and telephone conversations with Roboteq support, my conclusion is that there are some serious problems with the API as it currently is and this is my attempt to get it working. +``` diff --git a/RoboteqDevice.cpp b/RoboteqDevice.cpp index 359d1cb..96e1309 100644 --- a/RoboteqDevice.cpp +++ b/RoboteqDevice.cpp @@ -16,360 +16,595 @@ using namespace std; #define BUFFER_SIZE 1024 #define MISSING_VALUE -1024 +// #define DEBUG //Enable this to ignore serial port connections and see debug output on console + RoboteqDevice::RoboteqDevice() { - handle = RQ_INVALID_HANDLE; + handle = RQ_INVALID_HANDLE; } RoboteqDevice::~RoboteqDevice() { - Disconnect(); + Disconnect(); } bool RoboteqDevice::IsConnected() { - return handle != RQ_INVALID_HANDLE; +#ifdef DEBUG + return true; +#endif + return handle != RQ_INVALID_HANDLE; } + int RoboteqDevice::Connect(string port) { - if(IsConnected()) - { - cout<<"Device is connected, attempting to disconnect."< 0) + { + str.append(buf, countRcv); + + //No further data. + if(countRcv < BUFFER_SIZE) + break; + } + + if(countRcv < 0) + { + if(errno == EAGAIN) + return RQ_ERR_SERIAL_IO; + else + return RQ_ERR_SERIAL_RECEIVE; + } +#endif + +#ifdef DEBUG + cout<<"Simulating Read - \n"; +#endif + + return RQ_SUCCESS; +} + +/* + * Commands including IDs for RoboCAN protocol + */ + +int RoboteqDevice::IssueCommandId(int id, string commandType, string command, string args, int waitms, string &response, bool isplusminus) +{ + int status; + string read; + response = ""; + char id_str[4]; + + sprintf(id_str,"%02d",id); + + if(args == "") + status = Write("@" + (string)id_str + commandType + command + "\r"); + else + status = Write("@" + (string)id_str + commandType + command + " " + args + "\r"); - char buf[BUFFER_SIZE + 1] = ""; + if(status != RQ_SUCCESS) + return status; - str = ""; - int i = 0; - while((countRcv = read(handle, buf, BUFFER_SIZE)) > 0) - { - str.append(buf, countRcv); + usleep(waitms * 1000l); - //No further data. - if(countRcv < BUFFER_SIZE) - break; - } + status = ReadAll(read); + if(status != RQ_SUCCESS) + return status; - if(countRcv < 0) - { - if(errno == EAGAIN) - return RQ_ERR_SERIAL_IO; - else - return RQ_ERR_SERIAL_RECEIVE; - } + if(isplusminus) // isplusminus is for commands where the response is only a + or - + { + if(read.length() < 2) // Every response returns a + or - followed by \r\n = 2 chars? + return RQ_INVALID_RESPONSE; - return RQ_SUCCESS; + response = read.substr(read.length() - 2, 1); // + return RQ_SUCCESS; + } + + // the response is like this + // AI=123 + // where AI is the command and 123 is the value + // For a RoboCan command with ID, the return value looks like this + // @04 AI=123 + // Where 04 is the id + // + // How the following code works + // Find the position of 'AI=' which is (command+"=") + // then add command length + 1 to get to the starting index of the actual value + // then find the position of '\r', ie the last character + // now length of the value is last char position - first char position + + string::size_type pos = read.rfind(command + "="); + if(pos == string::npos) + return RQ_INVALID_RESPONSE; + + pos += command.length() + 1; + + string::size_type carriage = read.find("\r", pos); + if(carriage == string::npos) + return RQ_INVALID_RESPONSE; + + response = read.substr(pos, carriage - pos); + + return RQ_SUCCESS; +} +int RoboteqDevice::IssueCommandId(int id, string commandType, string command, int waitms, string &response, bool isplusminus) +{ + return IssueCommandId(id, commandType, command, "", waitms, response, isplusminus); } -int RoboteqDevice::IssueCommand(string commandType, string command, string args, int waitms, string &response, bool isplusminus) +int RoboteqDevice::SetConfigId(int id, int configItem, int index, int value) { - int status; - string read; - response = ""; + string response; + char command[10]; + char args[50]; + + if(configItem < 0 || configItem > 255) + return RQ_INVALID_CONFIG_ITEM; + + sprintf(command, "$%02X", configItem); + sprintf(args, "%i %i", index, value); + if(index == MISSING_VALUE) + { + sprintf(args, "%i", value); + index = 0; + } + + if(index < 0) + return RQ_INDEX_OUT_RANGE; - if(args == "") - status = Write(commandType + command + "\r"); - else - status = Write(commandType + command + " " + args + "\r"); + int status = IssueCommandId(id, "^", command, args, 10, response, true); + if(status != RQ_SUCCESS) + return status; + if(response != "+") + return RQ_SET_CONFIG_FAILED; + + return RQ_SUCCESS; +} +int RoboteqDevice::SetConfigId(int id, int configItem, int value) +{ + return SetConfigId(id, configItem, MISSING_VALUE, value); +} - if(status != RQ_SUCCESS) - return status; +int RoboteqDevice::SetCommandId(int id, int commandItem, int index, int value) +{ + string response; + char command[10]; + char args[50]; + + if(commandItem < 0 || commandItem > 255) + return RQ_INVALID_COMMAND_ITEM; + + sprintf(command, "$%02X", commandItem); + sprintf(args, "%i %i", index, value); + if(index == MISSING_VALUE) + { + if(value != MISSING_VALUE) + sprintf(args, "%i", value); + index = 0; + } - usleep(waitms * 1000l); + if(index < 0) + return RQ_INDEX_OUT_RANGE; - status = ReadAll(read); - if(status != RQ_SUCCESS) - return status; + int status = IssueCommandId(id, "!", command, args, 10, response, true); + if(status != RQ_SUCCESS) + return status; + if(response != "+") + return RQ_SET_COMMAND_FAILED; - if(isplusminus) - { - if(read.length() < 2) - return RQ_INVALID_RESPONSE; + return RQ_SUCCESS; +} +int RoboteqDevice::SetCommandId(int id, int commandItem, int value) +{ + return SetCommandId(id, commandItem, MISSING_VALUE, value); +} +int RoboteqDevice::SetCommandId(int id, int commandItem) +{ + return SetCommandId(id, commandItem, MISSING_VALUE, MISSING_VALUE); +} - response = read.substr(read.length() - 2, 1); - return RQ_SUCCESS; - } +int RoboteqDevice::GetConfigId(int id, int configItem, int index, int &result) +{ + string response; + char command[10]; + char args[50]; + if(configItem < 0 || configItem > 255) + return RQ_INVALID_CONFIG_ITEM; - string::size_type pos = read.rfind(command + "="); - if(pos == string::npos) - return RQ_INVALID_RESPONSE; + if(index < 0) + return RQ_INDEX_OUT_RANGE; - pos += command.length() + 1; + sprintf(command, "$%02X", configItem); + sprintf(args, "%i", index); - string::size_type carriage = read.find("\r", pos); - if(carriage == string::npos) - return RQ_INVALID_RESPONSE; + int status = IssueCommandId(id, "~", command, args, 10, response); + if(status != RQ_SUCCESS) + return status; - response = read.substr(pos, carriage - pos); + istringstream iss(response); + iss>>result; - return RQ_SUCCESS; + if(iss.fail()) + return RQ_GET_CONFIG_FAILED; + + return RQ_SUCCESS; } -int RoboteqDevice::IssueCommand(string commandType, string command, int waitms, string &response, bool isplusminus) +int RoboteqDevice::GetConfigId(int id, int configItem, int &result) { - return IssueCommand(commandType, command, "", waitms, response, isplusminus); + return GetConfigId(id, configItem, 0, result); } -int RoboteqDevice::SetConfig(int configItem, int index, int value) +int RoboteqDevice::GetValueId(int id, int operatingItem, int index, int &result) { - string response; - char command[10]; - char args[50]; + string response; + char command[10]; + char args[50]; + + if(operatingItem < 0 || operatingItem > 255) + return RQ_INVALID_OPER_ITEM; - if(configItem < 0 || configItem > 255) - return RQ_INVALID_CONFIG_ITEM; + if(index < 0) + return RQ_INDEX_OUT_RANGE; - sprintf(command, "$%02X", configItem); - sprintf(args, "%i %i", index, value); - if(index == MISSING_VALUE) - { - sprintf(args, "%i", value); - index = 0; - } + sprintf(command, "$%02X", operatingItem); + sprintf(args, "%i", index); - if(index < 0) - return RQ_INDEX_OUT_RANGE; + int status = IssueCommandId(id, "?", command, args, 10, response); + if(status != RQ_SUCCESS) + return status; - int status = IssueCommand("^", command, args, 10, response, true); - if(status != RQ_SUCCESS) - return status; - if(response != "+") - return RQ_SET_CONFIG_FAILED; + istringstream iss(response); + iss>>result; - return RQ_SUCCESS; + if(iss.fail()) + return RQ_GET_VALUE_FAILED; + + return RQ_SUCCESS; } -int RoboteqDevice::SetConfig(int configItem, int value) +int RoboteqDevice::GetValueId(int id, int operatingItem, int &result) { - return SetConfig(configItem, MISSING_VALUE, value); + return GetValueId(id, operatingItem, 0, result); } -int RoboteqDevice::SetCommand(int commandItem, int index, int value) + + +/* + * No ID Commands + * + */ + +int RoboteqDevice::IssueCommand(string commandType, string command, string args, int waitms, string &response, bool isplusminus) { - string response; - char command[10]; - char args[50]; + int status; + string read; + response = ""; + + if(args == "") + status = Write(commandType + command + "\r"); + else + status = Write(commandType + command + " " + args + "\r"); + + if(status != RQ_SUCCESS) + return status; + + usleep(waitms * 1000l); + + status = ReadAll(read); + if(status != RQ_SUCCESS) + return status; + +#ifndef DEBUG +// Only check the status if not in debug mode + if(isplusminus) + { + if(read.length() < 2) + return RQ_INVALID_RESPONSE; - if(commandItem < 0 || commandItem > 255) - return RQ_INVALID_COMMAND_ITEM; + response = read.substr(read.length() - 2, 1); + return RQ_SUCCESS; + } - sprintf(command, "$%02X", commandItem); - sprintf(args, "%i %i", index, value); - if(index == MISSING_VALUE) - { - if(value != MISSING_VALUE) - sprintf(args, "%i", value); - index = 0; - } - if(index < 0) - return RQ_INDEX_OUT_RANGE; + string::size_type pos = read.rfind(command + "="); + if(pos == string::npos) + return RQ_INVALID_RESPONSE; - int status = IssueCommand("!", command, args, 10, response, true); - if(status != RQ_SUCCESS) - return status; - if(response != "+") - return RQ_SET_COMMAND_FAILED; + pos += command.length() + 1; - return RQ_SUCCESS; + string::size_type carriage = read.find("\r", pos); + if(carriage == string::npos) + return RQ_INVALID_RESPONSE; + + response = read.substr(pos, carriage - pos); +#endif + return RQ_SUCCESS; +} +int RoboteqDevice::IssueCommand(string commandType, string command, int waitms, string &response, bool isplusminus) +{ + return IssueCommand(commandType, command, "", waitms, response, isplusminus); +} + +int RoboteqDevice::SetConfig(int configItem, int index, int value) +{ + string response; + char command[10]; + char args[50]; + + if(configItem < 0 || configItem > 255) + return RQ_INVALID_CONFIG_ITEM; + + sprintf(command, "$%02X", configItem); + sprintf(args, "%i %i", index, value); + if(index == MISSING_VALUE) + { + sprintf(args, "%i", value); + index = 0; + } + + if(index < 0) + return RQ_INDEX_OUT_RANGE; + + int status = IssueCommand("^", command, args, 10, response, true); + if(status != RQ_SUCCESS) + return status; + if(response != "+") + return RQ_SET_CONFIG_FAILED; + + return RQ_SUCCESS; +} +int RoboteqDevice::SetConfig(int configItem, int value) +{ + return SetConfig(configItem, MISSING_VALUE, value); +} + +int RoboteqDevice::SetCommand(int commandItem, int index, int value) +{ + string response; + char command[10]; + char args[50]; + + if(commandItem < 0 || commandItem > 255) + return RQ_INVALID_COMMAND_ITEM; + + sprintf(command, "$%02X", commandItem); + sprintf(args, "%i %i", index, value); + if(index == MISSING_VALUE) + { + if(value != MISSING_VALUE) + sprintf(args, "%i", value); + index = 0; + } + + if(index < 0) + return RQ_INDEX_OUT_RANGE; + + int status = IssueCommand("!", command, args, 10, response, true); + if(status != RQ_SUCCESS) + return status; + if(response != "+") + return RQ_SET_COMMAND_FAILED; + + return RQ_SUCCESS; } int RoboteqDevice::SetCommand(int commandItem, int value) { - return SetCommand(commandItem, MISSING_VALUE, value); + return SetCommand(commandItem, MISSING_VALUE, value); } int RoboteqDevice::SetCommand(int commandItem) { - return SetCommand(commandItem, MISSING_VALUE, MISSING_VALUE); + return SetCommand(commandItem, MISSING_VALUE, MISSING_VALUE); } int RoboteqDevice::GetConfig(int configItem, int index, int &result) { - string response; - char command[10]; - char args[50]; - - if(configItem < 0 || configItem > 255) - return RQ_INVALID_CONFIG_ITEM; + string response; + char command[10]; + char args[50]; - if(index < 0) - return RQ_INDEX_OUT_RANGE; + if(configItem < 0 || configItem > 255) + return RQ_INVALID_CONFIG_ITEM; - sprintf(command, "$%02X", configItem); - sprintf(args, "%i", index); + if(index < 0) + return RQ_INDEX_OUT_RANGE; - int status = IssueCommand("~", command, args, 10, response); - if(status != RQ_SUCCESS) - return status; + sprintf(command, "$%02X", configItem); + sprintf(args, "%i", index); - istringstream iss(response); - iss>>result; + int status = IssueCommand("~", command, args, 10, response); + if(status != RQ_SUCCESS) + return status; +#ifndef DEBUG + istringstream iss(response); + iss>>result; - if(iss.fail()) - return RQ_GET_CONFIG_FAILED; + if(iss.fail()) + return RQ_GET_CONFIG_FAILED; +#endif - return RQ_SUCCESS; + return RQ_SUCCESS; } int RoboteqDevice::GetConfig(int configItem, int &result) { - return GetConfig(configItem, 0, result); + return GetConfig(configItem, 0, result); } int RoboteqDevice::GetValue(int operatingItem, int index, int &result) { - string response; - char command[10]; - char args[50]; + string response; + char command[10]; + char args[50]; - if(operatingItem < 0 || operatingItem > 255) - return RQ_INVALID_OPER_ITEM; + if(operatingItem < 0 || operatingItem > 255) + return RQ_INVALID_OPER_ITEM; - if(index < 0) - return RQ_INDEX_OUT_RANGE; + if(index < 0) + return RQ_INDEX_OUT_RANGE; - sprintf(command, "$%02X", operatingItem); - sprintf(args, "%i", index); + sprintf(command, "$%02X", operatingItem); + sprintf(args, "%i", index); - int status = IssueCommand("?", command, args, 10, response); - if(status != RQ_SUCCESS) - return status; + int status = IssueCommand("?", command, args, 10, response); + if(status != RQ_SUCCESS) + return status; - istringstream iss(response); - iss>>result; + istringstream iss(response); + iss>>result; - if(iss.fail()) - return RQ_GET_VALUE_FAILED; + if(iss.fail()) + return RQ_GET_VALUE_FAILED; - return RQ_SUCCESS; + return RQ_SUCCESS; } int RoboteqDevice::GetValue(int operatingItem, int &result) { - return GetValue(operatingItem, 0, result); + return GetValue(operatingItem, 0, result); } string ReplaceString(string source, string find, string replacement) { - string::size_type pos = 0; + string::size_type pos = 0; while((pos = source.find(find, pos)) != string::npos) - { + { source.replace(pos, find.size(), replacement); pos++; } - return source; + return source; } void sleepms(int milliseconds) { - usleep(milliseconds / 1000); + usleep(milliseconds / 1000); } diff --git a/RoboteqDevice.h b/RoboteqDevice.h index 0908ec5..d770eef 100644 --- a/RoboteqDevice.h +++ b/RoboteqDevice.h @@ -9,39 +9,56 @@ void sleepms(int milliseconds); class RoboteqDevice { private: - int device_fd; - int fd0; - int handle; + int device_fd; + int fd0; + int handle; protected: - void InitPort(); + void InitPort(); - int Write(string str); - int ReadAll(string &str); + int Write(string str); + int ReadAll(string &str); - int IssueCommand(string commandType, string command, string args, int waitms, string &response, bool isplusminus = false); - int IssueCommand(string commandType, string command, int waitms, string &response, bool isplusminus = false); + int IssueCommandId(int id, string commandType, string command, string args, int waitms, string &response, bool isplusminus = false); + int IssueCommandId(int id, string commandType, string command, int waitms, string &response, bool isplusminus = false); + + int IssueCommand(string commandType, string command, string args, int waitms, string &response, bool isplusminus = false); + int IssueCommand(string commandType, string command, int waitms, string &response, bool isplusminus = false); public: - bool IsConnected(); - int Connect(string port); - void Disconnect(); + bool IsConnected(); + int Connect(string port); + void Disconnect(); + + int SetConfig(int configItem, int index, int value); + int SetConfig(int configItem, int value); + + int SetCommand(int commandItem, int index, int value); + int SetCommand(int commandItem, int value); + int SetCommand(int commandItem); + + int GetConfig(int configItem, int index, int &result); + int GetConfig(int configItem, int &result); + + int GetValue(int operatingItem, int index, int &result); + int GetValue(int operatingItem, int &result); + + int SetConfigId(int id, int configItem, int index, int value); + int SetConfigId(int id, int configItem, int value); - int SetConfig(int configItem, int index, int value); - int SetConfig(int configItem, int value); + int SetCommandId(int id, int commandItem, int index, int value); + int SetCommandId(int id, int commandItem, int value); + int SetCommandId(int id, int commandItem); - int SetCommand(int commandItem, int index, int value); - int SetCommand(int commandItem, int value); - int SetCommand(int commandItem); + int GetConfigId(int id, int configItem, int index, int &result); + int GetConfigId(int id, int configItem, int &result); - int GetConfig(int configItem, int index, int &result); - int GetConfig(int configItem, int &result); + int GetValueId(int id, int operatingItem, int index, int &result); + int GetValueId(int id, int operatingItem, int &result); - int GetValue(int operatingItem, int index, int &result); - int GetValue(int operatingItem, int &result); - RoboteqDevice(); - ~RoboteqDevice(); + RoboteqDevice(); + ~RoboteqDevice(); }; #endif diff --git a/sample.cpp b/sample.cpp index 21bce75..a909637 100644 --- a/sample.cpp +++ b/sample.cpp @@ -10,50 +10,44 @@ using namespace std; int main(int argc, char *argv[]) { - string response = ""; - RoboteqDevice device; - int status = device.Connect("/dev/ttyACM0"); - - if(status != RQ_SUCCESS) - { - cout<<"Error connecting to device: "< "< "< "< "< "< "< "< "< "< Date: Sun, 11 Dec 2016 13:37:18 +0530 Subject: [PATCH 2/4] Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df5e781..8ef218b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This library derives from improvements made by @brettpac and adds support for Ro All Get and Set commands now have a `Set__ID()` alternative which sends IDs for RoboCAN compatibility. For example, `SetCommandId()` -`Some parts are still WIP and untested, so may it not work as expected.` +`Some parts are still WIP and untested, so it may not work as expected.` The older Readme is as follows From 985f699668da747d4d17d037bc65fa42412c94c9 Mon Sep 17 00:00:00 2001 From: tarang Date: Fri, 13 Jan 2017 23:11:35 +0530 Subject: [PATCH 3/4] Added Print tags and minor fixes --- RoboteqDevice.cpp | 69 ++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/RoboteqDevice.cpp b/RoboteqDevice.cpp index 96e1309..a899351 100644 --- a/RoboteqDevice.cpp +++ b/RoboteqDevice.cpp @@ -16,7 +16,7 @@ using namespace std; #define BUFFER_SIZE 1024 #define MISSING_VALUE -1024 -// #define DEBUG //Enable this to ignore serial port connections and see debug output on console +// #define ROBOTEQ_DEBUG RoboteqDevice::RoboteqDevice() { @@ -29,7 +29,7 @@ RoboteqDevice::~RoboteqDevice() bool RoboteqDevice::IsConnected() { -#ifdef DEBUG +#ifdef ROBOTEQ_DEBUG return true; #endif return handle != RQ_INVALID_HANDLE; @@ -39,32 +39,32 @@ int RoboteqDevice::Connect(string port) { if(IsConnected()) { - cout<<"Device is connected, attempting to disconnect."< 0) { str.append(buf, countRcv); @@ -187,8 +189,8 @@ int RoboteqDevice::ReadAll(string &str) } #endif -#ifdef DEBUG - cout<<"Simulating Read - \n"; +#ifdef ROBOTEQ_DEBUG + cout<<"[RoboteqDriverLib]Simulating Read - \n"; #endif return RQ_SUCCESS; @@ -207,17 +209,23 @@ int RoboteqDevice::IssueCommandId(int id, string commandType, string command, st sprintf(id_str,"%02d",id); + string id_stdstr(id_str); + + string cmdstr; if(args == "") - status = Write("@" + (string)id_str + commandType + command + "\r"); + cmdstr = ("@" + id_stdstr + commandType + command + "\r"); else - status = Write("@" + (string)id_str + commandType + command + " " + args + "\r"); + cmdstr = ("@" + id_stdstr + commandType + command + " " + args + "\r"); + cout<<"[RoboteqDriverLib]Issuing command = "<>result; From 2ec07242b904c339801921f0a59525c22f434b06 Mon Sep 17 00:00:00 2001 From: tarang Date: Mon, 23 Jan 2017 11:43:57 +0530 Subject: [PATCH 4/4] Added Printing on,off flag and read command bugfixes --- README.md | 4 ---- RoboteqDevice.cpp | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8ef218b..0371e3e 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ This is forked from the original Roboteq Linux API which has been found to be ou This library derives from improvements made by @brettpac and adds support for RoboCAN based ID referencing for the motors and Debug support. -All Get and Set commands now have a `Set__ID()` alternative which sends IDs for RoboCAN compatibility. For example, `SetCommandId()` - -`Some parts are still WIP and untested, so it may not work as expected.` - The older Readme is as follows ``` diff --git a/RoboteqDevice.cpp b/RoboteqDevice.cpp index a899351..94d8161 100644 --- a/RoboteqDevice.cpp +++ b/RoboteqDevice.cpp @@ -17,6 +17,7 @@ using namespace std; #define MISSING_VALUE -1024 // #define ROBOTEQ_DEBUG +// #define PRINTING_ON RoboteqDevice::RoboteqDevice() { @@ -84,7 +85,7 @@ int RoboteqDevice::Connect(string port) } - cout<