mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Added a check to see that the robot is connected before attempting to write to the socket. Fixes #11
This commit is contained in:
@@ -89,7 +89,10 @@ void UrRealtimeCommunication::addCommandToQueue(std::string inp) {
|
||||
if (inp.back() != '\n') {
|
||||
inp.append("\n");
|
||||
}
|
||||
bytes_written = write(sockfd_, inp.c_str(), inp.length());
|
||||
if (connected_)
|
||||
bytes_written = write(sockfd_, inp.c_str(), inp.length());
|
||||
else
|
||||
print_error("Could not send command \"" +inp + "\". The robot is not connected! Command is discarded" );
|
||||
}
|
||||
|
||||
void UrRealtimeCommunication::setSpeed(double q0, double q1, double q2,
|
||||
|
||||
Reference in New Issue
Block a user