1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 10:00:48 +02:00

Fixed compatability issue

Pre-refactor version of URScript topic used to automatically append newline when not the last character of the message however that was not the case for the new version.
This commit is contained in:
Simon Rasmussen
2018-03-01 10:07:44 +01:00
committed by GitHub
parent a2137b4762
commit 24d4406c91

View File

@@ -13,10 +13,14 @@ URScriptHandler::URScriptHandler(URCommander &commander)
void URScriptHandler::urscriptInterface(const std_msgs::String::ConstPtr& msg) void URScriptHandler::urscriptInterface(const std_msgs::String::ConstPtr& msg)
{ {
LOG_INFO("Message received"); LOG_INFO("Message received");
std::string str(msg->data);
if (str.back() != '\n')
str.append('\n');
switch (state_) switch (state_)
{ {
case RobotState::Running: case RobotState::Running:
if (!commander_.uploadProg(msg->data)) if (!commander_.uploadProg(str))
{ {
LOG_ERROR("Program upload failed!"); LOG_ERROR("Program upload failed!");
} }