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

Introduce UrException as exception base class

This commit is contained in:
Felix Mauch
2019-06-11 10:25:50 +02:00
parent 48103aca49
commit c88022eefd
3 changed files with 57 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
#include <csignal>
#include <ur_rtde_driver/ros/hardware_interface.h>
#include <ur_rtde_driver/exceptions.h>
std::unique_ptr<ur_driver::HardwareInterface> g_hw_interface;
@@ -64,9 +65,17 @@ int main(int argc, char** argv)
g_hw_interface.reset(new ur_driver::HardwareInterface);
if (!g_hw_interface->init(nh, nh_priv))
try
{
ROS_ERROR_STREAM("Could not correctly initialize robot. Exiting");
if (!g_hw_interface->init(nh, nh_priv))
{
ROS_ERROR_STREAM("Could not correctly initialize robot. Exiting");
exit(1);
}
}
catch (ur_driver::UrException& e)
{
ROS_FATAL_STREAM("Could not correctly initialize robot: " << e.what());
exit(1);
}
ROS_INFO_STREAM("initialized hw interface");