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

Added catch in case communication fails

This commit is contained in:
Thomas Timm Andersen
2015-09-24 16:26:19 +02:00
parent ef7acd55b6
commit 6f3bd5d06f
5 changed files with 49 additions and 37 deletions

View File

@@ -296,18 +296,21 @@ void UrDriver::uploadProg() {
}
void UrDriver::start() {
if (sec_interface_->start()) {
rt_interface_->robot_state_->setVersion(
sec_interface_->robot_state_->getVersion());
rt_interface_->start();
ip_addr_ = rt_interface_->getLocalIp(); //inet_ntoa(serv_addr.sin_addr);
bool UrDriver::start() {
if (!sec_interface_->start())
return false;
rt_interface_->robot_state_->setVersion(
sec_interface_->robot_state_->getVersion());
if (!rt_interface_->start())
return false;
ip_addr_ = rt_interface_->getLocalIp(); //inet_ntoa(serv_addr.sin_addr);
#ifdef ROS_BUILD
ROS_DEBUG("Listening on %s:%u\n", ip_addr_.c_str(), REVERSE_PORT_);
ROS_DEBUG("Listening on %s:%u\n", ip_addr_.c_str(), REVERSE_PORT_);
#else
printf("Listening on %s:%u\n", ip_addr_.c_str(), REVERSE_PORT_);
printf("Listening on %s:%u\n", ip_addr_.c_str(), REVERSE_PORT_);
#endif
}
return true;
}
void UrDriver::halt() {