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 
90  std::string color_format;
92  bool scolor;
93 
94  std::thread grab_thread;
95  std::atomic_bool running;
96 
97  std::vector<std::shared_ptr<GenICam2RosPublisher> > pub;
98 
99  std::string device_model;
100  std::string device_version;
101  std::string device_serial;
102  std::string device_mac;
103  std::string device_name;
104  std::string device_interface;
105  std::string device_ip;
112  bool streaming;
113 
115 };
116 
117 } // namespace rc
118 
119 #endif
rc::GenICamDeviceNodelet::publishConnectionDiagnostics
void publishConnectionDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
Definition: genicam_device_nodelet.cpp:872
rc::GenICamDeviceNodelet::updateSubscriptions
void updateSubscriptions(bool force=false)
Definition: genicam_device_nodelet.cpp:793
rc::GenICamDeviceNodelet::color_format
std::string color_format
Definition: genicam_device_nodelet.h:90
rc::GenICamDeviceNodelet::initConfiguration
void initConfiguration()
Definition: genicam_device_nodelet.cpp:201
rc::GenICamDeviceNodelet::gev_packet_size
int gev_packet_size
Definition: genicam_device_nodelet.h:106
rc::GenICamDeviceNodelet::trigger_service
ros::ServiceServer trigger_service
Definition: genicam_device_nodelet.h:80
rc::GenICamDeviceNodelet::device_serial
std::string device_serial
Definition: genicam_device_nodelet.h:101
rc::GenICamDeviceNodelet::complete_buffers_total
int complete_buffers_total
Definition: genicam_device_nodelet.h:108
rc::GenICamDeviceNodelet::device_model
std::string device_model
Definition: genicam_device_nodelet.h:99
diagnostic_updater::Updater
rc::GenICamDeviceNodelet::~GenICamDeviceNodelet
virtual ~GenICamDeviceNodelet()
Definition: genicam_device_nodelet.cpp:80
GenApi.h
rc::GenICamDeviceNodelet::current_reconnect_trial
int current_reconnect_trial
Definition: genicam_device_nodelet.h:111
rc::GenICamDeviceNodelet::device_version
std::string device_version
Definition: genicam_device_nodelet.h:100
genicam2ros_publisher.h
rc::GenICamDeviceNodelet::onInit
virtual void onInit()
Definition: genicam_device_nodelet.cpp:95
rc::GenICamDeviceNodelet::subChanged
void subChanged()
Definition: genicam_device_nodelet.cpp:867
rc::GenICamDeviceNodelet::config
rc_genicam_driver::rc_genicam_driverConfig config
Definition: genicam_device_nodelet.h:84
rc::GenICamDeviceNodelet::device_ip
std::string device_ip
Definition: genicam_device_nodelet.h:105
rc::GenICamDeviceNodelet::depthAcquisitionTrigger
bool depthAcquisitionTrigger(rc_common_msgs::Trigger::Request &req, rc_common_msgs::Trigger::Response &resp)
Definition: genicam_device_nodelet.cpp:159
rc::GenICamDeviceNodelet::frame_id
std::string frame_id
Definition: genicam_device_nodelet.h:79
rc::GenICamDeviceNodelet::device_mtx
std::recursive_mutex device_mtx
Definition: genicam_device_nodelet.h:86
rc::GenICamDeviceNodelet::image_receive_timeouts_total
int image_receive_timeouts_total
Definition: genicam_device_nodelet.h:110
diagnostic_updater.h
ros::ServiceServer
rc
Definition: genicam_device_nodelet.cpp:62
rc::GenICamDeviceNodelet::grab_thread
std::thread grab_thread
Definition: genicam_device_nodelet.h:94
rc::GenICamDeviceNodelet::publishDeviceDiagnostics
void publishDeviceDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
Definition: genicam_device_nodelet.cpp:914
rc::GenICamDeviceNodelet::device_mac
std::string device_mac
Definition: genicam_device_nodelet.h:102
rc::GenICamDeviceNodelet::scolor
bool scolor
Definition: genicam_device_nodelet.h:92
rc::GenICamDeviceNodelet::updater
diagnostic_updater::Updater updater
Definition: genicam_device_nodelet.h:114
rc::GenICamDeviceNodelet::reconfig
dynamic_reconfigure::Server< rc_genicam_driver::rc_genicam_driverConfig > * reconfig
Definition: genicam_device_nodelet.h:83
rc::GenICamDeviceNodelet::dev
std::shared_ptr< rcg::Device > dev
Definition: genicam_device_nodelet.h:87
rc::GenICamDeviceNodelet::incomplete_buffers_total
int incomplete_buffers_total
Definition: genicam_device_nodelet.h:109
rc::GenICamDeviceNodelet::running
std::atomic_bool running
Definition: genicam_device_nodelet.h:95
rc::GenICamDeviceNodelet::device_name
std::string device_name
Definition: genicam_device_nodelet.h:103
rcg::Device::ACCESS
ACCESS
nodelet::Nodelet
rc::GenICamDeviceNodelet::reconfig_mtx
boost::recursive_mutex reconfig_mtx
Definition: genicam_device_nodelet.h:82
rc::GenICamDeviceNodelet::grab
void grab(std::string id, rcg::Device::ACCESS access)
Definition: genicam_device_nodelet.cpp:999
device.h
nodelet.h
rc::GenICamDeviceNodelet::streaming
bool streaming
Definition: genicam_device_nodelet.h:112
rc::GenICamDeviceNodelet::pub
std::vector< std::shared_ptr< GenICam2RosPublisher > > pub
Definition: genicam_device_nodelet.h:97
diagnostic_updater::DiagnosticStatusWrapper
rc::GenICamDeviceNodelet::reconfigure
void reconfigure(rc_genicam_driver::rc_genicam_driverConfig &c, uint32_t level)
Definition: genicam_device_nodelet.cpp:422
rc::GenICamDeviceNodelet::scomponents
int scomponents
Definition: genicam_device_nodelet.h:91
rc::GenICamDeviceNodelet::connection_loss_total
int connection_loss_total
Definition: genicam_device_nodelet.h:107
rc::GenICamDeviceNodelet::device_interface
std::string device_interface
Definition: genicam_device_nodelet.h:104
rc::GenICamDeviceNodelet::nodemap
std::shared_ptr< GenApi::CNodeMapRef > nodemap
Definition: genicam_device_nodelet.h:88
rc::GenICamDeviceNodelet
Definition: genicam_device_nodelet.h:55
rc::GenICamDeviceNodelet::GenICamDeviceNodelet
GenICamDeviceNodelet()
Definition: genicam_device_nodelet.cpp:64


rc_genicam_driver
Author(s): Heiko Hirschmueller , Felix Ruess
autogenerated on Sat Oct 26 2024 02:04:09