nodelet.cpp
Go to the documentation of this file.
1 #include "nodelet.h"
2 #include "zivid_camera.h"
3 
4 #include <nodelet/nodelet.h>
6 
7 #include <memory>
8 #include <exception>
9 
10 namespace zivid_camera
11 {
13 {
14  try
15  {
16  // Important: use non-multi-threaded callback queues (getNodeHandle and getPrivateNodeHandle).
17  camera = std::make_unique<ZividCamera>(getNodeHandle(), getPrivateNodeHandle());
18  }
19  catch (const std::exception& e)
20  {
21  NODELET_ERROR_STREAM("Failed to initialize camera driver. Exception: \"" << e.what() << "\"");
22  throw;
23  }
24  catch (...)
25  {
26  NODELET_ERROR_STREAM("Failed to initialize camera driver (unknown exception)");
27  throw;
28  }
29 }
30 } // namespace zivid_camera
31 
32 #ifdef __clang__
33 #pragma clang diagnostic push
34 #pragma clang diagnostic ignored "-Wglobal-constructors"
35 #endif
36 
38 
39 #ifdef __clang__
40 #pragma clang diagnostic pop
41 #endif
ros::NodeHandle & getPrivateNodeHandle() const
#define NODELET_ERROR_STREAM(...)
std::unique_ptr< ZividCamera > camera
Definition: nodelet.h:14
ros::NodeHandle & getNodeHandle() const
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void onInit() override
Definition: nodelet.cpp:12


zivid_camera
Author(s): Zivid
autogenerated on Sat Apr 17 2021 02:51:05