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

implemented error when trying to start driver without connection to a robot

This commit is contained in:
Tristan Schnell
2019-06-13 14:54:19 +02:00
committed by Felix Mauch
parent fd6a9ee365
commit d0e995ff7c
2 changed files with 9 additions and 2 deletions

View File

@@ -184,7 +184,10 @@ public:
running_ = false; running_ = false;
if (pThread_.joinable())
{
pThread_.join(); pThread_.join();
}
if (cThread_.joinable()) if (cThread_.joinable())
{ {
cThread_.join(); cThread_.join();

View File

@@ -24,6 +24,7 @@
#include "ur_rtde_driver/comm/parser.h" #include "ur_rtde_driver/comm/parser.h"
#include "ur_rtde_driver/comm/stream.h" #include "ur_rtde_driver/comm/stream.h"
#include "ur_rtde_driver/comm/package.h" #include "ur_rtde_driver/comm/package.h"
#include "ur_rtde_driver/exceptions.h"
namespace ur_driver namespace ur_driver
{ {
@@ -48,7 +49,10 @@ public:
tv.tv_sec = 1; tv.tv_sec = 1;
tv.tv_usec = 0; tv.tv_usec = 0;
stream_.setReceiveTimeout(tv); stream_.setReceiveTimeout(tv);
stream_.connect(); if(!stream_.connect())
{
throw UrException("Failed to connect to robot. Please check if the robot is booted and connected.");
}
} }
void teardownProducer() void teardownProducer()
{ {