genicam_device_nodelet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Roboception GmbH
3  * All rights reserved
4  *
5  * Author: Heiko Hirschmueller
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its contributors
18  * may be used to endorse or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef RC_GENICAM_DRIVERNODELET_H
35 #define RC_GENICAM_DRIVERNODELET_H
36 
38 
39 #include <nodelet/nodelet.h>
40 #include <dynamic_reconfigure/server.h>
41 #include <rc_genicam_driver/rc_genicam_driverConfig.h>
42 #include <rc_common_msgs/Trigger.h>
43 
44 #include <GenApi/GenApi.h>
45 #include <rc_genicam_api/device.h>
46 
47 #include <thread>
48 #include <mutex>
49 #include <atomic>
50 
52 
53 namespace rc
54 {
56 {
57 public:
59  virtual ~GenICamDeviceNodelet();
60 
61  virtual void onInit();
62 
63  bool depthAcquisitionTrigger(rc_common_msgs::Trigger::Request& req, rc_common_msgs::Trigger::Response& resp);
64 
65 private:
66  void initConfiguration();
67 
68  void reconfigure(rc_genicam_driver::rc_genicam_driverConfig& c, uint32_t level);
69 
70  void updateSubscriptions(bool force = false);
71 
72  void subChanged();
73 
76 
77  void grab(std::string id, rcg::Device::ACCESS access);
78 
79  std::string frame_id;
81 
82  boost::recursive_mutex reconfig_mtx;
83  dynamic_reconfigure::Server<rc_genicam_driver::rc_genicam_driverConfig>* reconfig;
84  rc_genicam_driver::rc_genicam_driverConfig config;
85 
86  std::recursive_mutex device_mtx;
87  std::shared_ptr<rcg::Device> dev;
88  std::shared_ptr<GenApi::CNodeMapRef> nodemap;
89 
91  bool scolor;
92 
93  std::thread grab_thread;
94  std::atomic_bool running;
95 
96  std::vector<std::shared_ptr<GenICam2RosPublisher> > pub;
97 
98  std::string device_model;
99  std::string device_version;
100  std::string device_serial;
101  std::string device_mac;
102  std::string device_name;
103  std::string device_interface;
104  std::string device_ip;
111  bool streaming;
112 
114 };
115 
116 } // namespace rc
117 
118 #endif
std::shared_ptr< rcg::Device > dev
bool depthAcquisitionTrigger(rc_common_msgs::Trigger::Request &req, rc_common_msgs::Trigger::Response &resp)
diagnostic_updater::Updater updater
rc_genicam_driver::rc_genicam_driverConfig config
boost::recursive_mutex reconfig_mtx
void publishConnectionDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
void updateSubscriptions(bool force=false)
ros::ServiceServer trigger_service
std::shared_ptr< GenApi::CNodeMapRef > nodemap
dynamic_reconfigure::Server< rc_genicam_driver::rc_genicam_driverConfig > * reconfig
void publishDeviceDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
void grab(std::string id, rcg::Device::ACCESS access)
std::vector< std::shared_ptr< GenICam2RosPublisher > > pub
void reconfigure(rc_genicam_driver::rc_genicam_driverConfig &c, uint32_t level)
std::recursive_mutex device_mtx


rc_genicam_driver
Author(s): Heiko Hirschmueller , Felix Ruess
autogenerated on Sat Feb 13 2021 03:55:07