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:
@@ -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!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user