OpenNIGrabber.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef OPENNI_GRABBER_H
11 #define OPENNI_GRABBER_H
12 
13 #include <rtm/Manager.h>
14 #include <rtm/DataFlowComponentBase.h>
15 #include <rtm/CorbaPort.h>
16 #include <rtm/DataInPort.h>
17 #include <rtm/DataOutPort.h>
18 #include <rtm/idl/BasicDataTypeSkel.h>
19 #include <pcl/io/openni2_grabber.h>
20 #include <pcl/io/pcd_io.h>
21 #include "hrpsys/idl/pointcloud.hh"
22 #include "hrpsys/idl/Img.hh"
23 
24 // Service implementation headers
25 // <rtc-template block="service_impl_h">
26 
27 // </rtc-template>
28 
29 // Service Consumer stub headers
30 // <rtc-template block="consumer_stub_h">
31 
32 // </rtc-template>
33 
34 using namespace RTC;
35 
41 {
42  public:
51  virtual ~OpenNIGrabber();
52 
53  // The initialize action (on CREATED->ALIVE transition)
54  // formaer rtc_init_entry()
55  virtual RTC::ReturnCode_t onInitialize();
56 
57  // The finalize action (on ALIVE->END transition)
58  // formaer rtc_exiting_entry()
59  // virtual RTC::ReturnCode_t onFinalize();
60 
61  // The startup action when ExecutionContext startup
62  // former rtc_starting_entry()
63  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
64 
65  // The shutdown action when ExecutionContext stop
66  // former rtc_stopping_entry()
67  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
68 
69  // The activated action (Active state entry action)
70  // former rtc_active_entry()
71  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
72 
73  // The deactivated action (Active state exit action)
74  // former rtc_active_exit()
75  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
76 
77  // The execution action that is invoked periodically
78  // former rtc_active_do()
79  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
80 
81  // The aborting action when main logic error occurred.
82  // former rtc_aborting_entry()
83  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
84 
85  // The error action in ERROR state
86  // former rtc_error_do()
87  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
88 
89  // The reset action that is invoked resetting
90  // This is same but different the former rtc_init_entry()
91  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
92 
93  // The state update action that is invoked after onExecute() action
94  // no corresponding operation exists in OpenRTm-aist-0.2.0
95  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
96 
97  // The action that is invoked when execution context's rate is changed
98  // no corresponding operation exists in OpenRTm-aist-0.2.0
99  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
100 
101 
102  protected:
103  // Configuration variable declaration
104  // <rtc-template block="config_declare">
105 
106  // </rtc-template>
107 
108  Img::TimedCameraImage m_image;
109  Img::TimedCameraImage m_depth;
110  PointCloudTypes::PointCloud m_cloud;
111 
112  // DataInPort declaration
113  // <rtc-template block="inport_declare">
114 
115  // </rtc-template>
116 
117  // DataOutPort declaration
118  // <rtc-template block="outport_declare">
122 
123  // </rtc-template>
124 
125  // CORBA Port declaration
126  // <rtc-template block="corbaport_declare">
127 
128  // </rtc-template>
129 
130  // Service declaration
131  // <rtc-template block="service_declare">
132 
133  // </rtc-template>
134 
135  // Consumer declaration
136  // <rtc-template block="consumer_declare">
137 
138  // </rtc-template>
139 
140  private:
141  void grabberCallbackColorImage(const boost::shared_ptr<pcl::io::Image>& image);
142  void grabberCallbackDepthImage(const boost::shared_ptr<pcl::io::DepthImage>& image);
143  void grabberCallbackColorAndDepthImage(const boost::shared_ptr<pcl::io::Image>& image, const boost::shared_ptr<pcl::io::DepthImage>& depth, float reciprocalFocalLength);
144  void grabberCallbackPointCloudRGBA(const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud);
145  void grabberCallbackPointCloud(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &cloud);
146  void outputColorImage(const boost::shared_ptr<pcl::io::Image>& image);
147  void outputDepthImage(const boost::shared_ptr<pcl::io::DepthImage>& image);
148 
149  pcl::Grabber *m_interface;
157  int dummy;
158 };
159 
160 
161 extern "C"
162 {
164 };
165 
166 #endif // OPENNI_GRABBER_H
ec_id
OutPort< Img::TimedCameraImage > m_depthOut
bool m_outputColorImage
OutPort< PointCloudTypes::PointCloud > m_cloudOut
bool m_outputPointCloudRGBA
bool m_outputDepthImage
manager
void OpenNIGrabberInit(RTC::Manager *manager)
Img::TimedCameraImage m_depth
pcl::Grabber * m_interface
sample RT component which has one data input port and one data output port
Definition: OpenNIGrabber.h:39
ExecutionContextHandle_t UniqueId
bool m_requestToWritePointCloud
OutPort< Img::TimedCameraImage > m_imageOut
bool m_requestToWriteImage
bool m_outputPointCloud
Img::TimedCameraImage m_image
PointCloudTypes::PointCloud m_cloud


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50