-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRTCKinect.h
More file actions
355 lines (305 loc) · 6.59 KB
/
RTCKinect.h
File metadata and controls
355 lines (305 loc) · 6.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
// -*- C++ -*-
/*!
* @file RTCKinect.h
* @brief RTC Kinect 4 Windows
* @date $Date$
*
* $Id$
*/
#ifndef RTCKINECT_H
#define RTCKINECT_H
#include <rtm/Manager.h>
#include <rtm/DataFlowComponentBase.h>
#include <rtm/CorbaPort.h>
#include <rtm/DataInPort.h>
#include <rtm/DataOutPort.h>
#include <rtm/idl/BasicDataTypeSkel.h>
#include <rtm/idl/ExtendedDataTypesSkel.h>
#include <rtm/idl/InterfaceDataTypesSkel.h>
// Service implementation headers
// <rtc-template block="service_impl_h">
// </rtc-template>
// Service Consumer stub headers
// <rtc-template block="consumer_stub_h">
#include "KinectDataTypeStub.h"
// </rtc-template>
using namespace RTC;
using namespace Kinect;
/*!
* @class RTCKinect
* @brief RTC Kinect 4 Windows
*
*/
class RTCKinect
: public RTC::DataFlowComponentBase
{
public:
/*!
* @brief constructor
* @param manager Maneger Object
*/
RTCKinect(RTC::Manager* manager);
/*!
* @brief destructor
*/
~RTCKinect();
// <rtc-template block="public_attribute">
// </rtc-template>
// <rtc-template block="public_operation">
// </rtc-template>
/***
*
* The initialize action (on CREATED->ALIVE transition)
* formaer rtc_init_entry()
*
* @return RTC::ReturnCode_t
*
*
*/
virtual RTC::ReturnCode_t onInitialize();
/***
*
* The finalize action (on ALIVE->END transition)
* formaer rtc_exiting_entry()
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onFinalize();
/***
*
* The startup action when ExecutionContext startup
* former rtc_starting_entry()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
/***
*
* The shutdown action when ExecutionContext stop
* former rtc_stopping_entry()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
/***
*
* The activated action (Active state entry action)
* former rtc_active_entry()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
/***
*
* The deactivated action (Active state exit action)
* former rtc_active_exit()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
/***
*
* The execution action that is invoked periodically
* former rtc_active_do()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
/***
*
* The aborting action when main logic error occurred.
* former rtc_aborting_entry()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
/***
*
* The error action in ERROR state
* former rtc_error_do()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
/***
*
* The reset action that is invoked resetting
* This is same but different the former rtc_init_entry()
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
/***
*
* The state update action that is invoked after onExecute() action
* no corresponding operation exists in OpenRTm-aist-0.2.0
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
/***
*
* The action that is invoked when execution context's rate is changed
* no corresponding operation exists in OpenRTm-aist-0.2.0
*
* @param ec_id target ExecutionContext Id
*
* @return RTC::ReturnCode_t
*
*
*/
// virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
protected:
// <rtc-template block="protected_attribute">
// </rtc-template>
// <rtc-template block="protected_operation">
// </rtc-template>
// Configuration variable declaration
// <rtc-template block="config_declare">
/*!
*
* - Name: debug
* - DefaultValue: 0
*/
int m_debug;
/*!
*
* - Name: enable_camera
* - DefaultValue: 1
*/
int m_enable_camera;
/*!
*
* - Name: enable_depth
* - DefaultValue: 1
*/
int m_enable_depth;
/*!
*
* - Name: camera_width
* - DefaultValue: 640
*/
int m_camera_width;
/*!
*
* - Name: camera_height
* - DefaultValue: 480
*/
int m_camera_height;
/*!
*
* - Name: depth_width
* - DefaultValue: 320
*/
int m_depth_width;
/*!
*
* - Name: depth_height
* - DefaultValue: 240
*/
int m_depth_height;
/*!
*
* - Name: player_index
* - DefaultValue: 0
*/
int m_player_index;
// </rtc-template>
// DataInPort declaration
// <rtc-template block="inport_declare">
TimedLong m_targetElevation;
/*!
*/
InPort<TimedLong> m_targetElevationIn;
// </rtc-template>
// DataOutPort declaration
// <rtc-template block="outport_declare">
CameraImage m_image;
/*!
* Camera Color Image
* - Type: CameraImage
*/
OutPort<CameraImage> m_imageOut;
CameraImage m_depth;
/*!
* Depth Image
* - Type: CameraImage
*/
OutPort<CameraImage> m_depthOut;
TimedLong m_currentElevation;
/*!
*/
OutPort<TimedLong> m_currentElevationOut;
NuiSkeletonFrame m_skeleton;
/*!
*/
OutPort<NuiSkeletonFrame> m_skeletonOut;
SoundSourceLocation m_soundSource;
/*!
*/
OutPort<SoundSourceLocation> m_soundSourceOut;
// </rtc-template>
// CORBA Port declaration
// <rtc-template block="corbaport_declare">
// </rtc-template>
// Service declaration
// <rtc-template block="service_declare">
// </rtc-template>
// Consumer declaration
// <rtc-template block="consumer_declare">
// </rtc-template>
private:
// <rtc-template block="private_attribute">
// </rtc-template>
// <rtc-template block="private_operation">
// </rtc-template>
HANDLE m_pVideoStreamHandle;
HANDLE m_pDepthStreamHandle;
HRESULT WriteColorImage();
HRESULT WriteDepthImage();
HRESULT WriteElevation();
HRESULT WriteSkeleton();
};
extern "C"
{
DLL_EXPORT void RTCKinectInit(RTC::Manager* manager);
};
#endif // RTCKINECT_H