VirtualCamera.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef VIRTUAL_CAMERA_H
11 #define VIRTUAL_CAMERA_H
12 
13 #include <rtm/idl/BasicDataType.hh>
14 #include <rtm/idl/InterfaceDataTypes.hh>
15 #include "hrpsys/idl/HRPDataTypes.hh"
16 #include "hrpsys/idl/Img.hh"
17 #include "hrpsys/idl/pointcloud.hh"
18 #include <rtm/Manager.h>
19 #include <rtm/DataFlowComponentBase.h>
20 #include <rtm/CorbaPort.h>
21 #include <rtm/DataInPort.h>
22 #include <rtm/DataOutPort.h>
23 #include <rtm/idl/BasicDataTypeSkel.h>
24 //Open CV headder
25 #include <cv.h>
26 #include <highgui.h>
27 //
28 #include "hrpsys/util/LogManager.h"
29 #include "hrpsys/util/SDLUtil.h"
30 #include "GLscene.h"
31 class GLcamera;
32 class RTCGLbody;
33 
34 // Service implementation headers
35 // <rtc-template block="service_impl_h">
36 
37 // </rtc-template>
38 
39 // Service Consumer stub headers
40 // <rtc-template block="consumer_stub_h">
41 
42 // </rtc-template>
43 
44 using namespace RTC;
45 
51 {
52  public:
61  virtual ~VirtualCamera();
62 
63  // The initialize action (on CREATED->ALIVE transition)
64  // formaer rtc_init_entry()
65  virtual RTC::ReturnCode_t onInitialize();
66 
67  // The finalize action (on ALIVE->END transition)
68  // formaer rtc_exiting_entry()
69  // virtual RTC::ReturnCode_t onFinalize();
70 
71  // The startup action when ExecutionContext startup
72  // former rtc_starting_entry()
73  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
74 
75  // The shutdown action when ExecutionContext stop
76  // former rtc_stopping_entry()
77  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
78 
79  // The activated action (Active state entry action)
80  // former rtc_active_entry()
81  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
82 
83  // The deactivated action (Active state exit action)
84  // former rtc_active_exit()
85  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
86 
87  // The execution action that is invoked periodically
88  // former rtc_active_do()
89  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
90 
91  // The aborting action when main logic error occurred.
92  // former rtc_aborting_entry()
93  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
94 
95  // The error action in ERROR state
96  // former rtc_error_do()
97  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
98 
99  // The reset action that is invoked resetting
100  // This is same but different the former rtc_init_entry()
101  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
102 
103  // The state update action that is invoked after onExecute() action
104  // no corresponding operation exists in OpenRTm-aist-0.2.0
105  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
106 
107  // The action that is invoked when execution context's rate is changed
108  // no corresponding operation exists in OpenRTm-aist-0.2.0
109  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
110 
111 
112  protected:
113  // Configuration variable declaration
114  // <rtc-template block="config_declare">
115 
116  // </rtc-template>
117 
118  OpenHRP::SceneState m_sceneState;
119  RTC::TimedPoint3D m_basePos;
120  RTC::TimedOrientation3D m_baseRpy;
121  RTC::TimedDoubleSeq m_q;
122 
123  // DataInPort declaration
124  // <rtc-template block="inport_declare">
129 
130  // </rtc-template>
131 
132  Img::TimedCameraImage m_image;
133  RangeData m_range;
134  PointCloudTypes::PointCloud m_cloud;
135  TimedPose3D m_poseSensor;
136 
137  // DataOutPort declaration
138  // <rtc-template block="outport_declare">
143 
144  // </rtc-template>
145 
146  // CORBA Port declaration
147  // <rtc-template block="corbaport_declare">
148 
149  // </rtc-template>
150 
151  // Service declaration
152  // <rtc-template block="service_declare">
153 
154  // </rtc-template>
155 
156  // Consumer declaration
157  // <rtc-template block="consumer_declare">
158 
159  // </rtc-template>
160 
161  private:
162  void setupRangeData();
163  void setupPointCloud();
171  std::string m_pcFormat;
172  bool m_generateMovie, m_isGeneratingMovie;
174  CvVideoWriter *m_videoWriter;
175  IplImage *m_cvImage;
176  std::string m_projectName;
177  std::string m_cameraName;
178  std::map<std::string, RTCGLbody *> m_bodies;
179  int dummy;
180 };
181 
182 
183 extern "C"
184 {
186 };
187 
188 #endif // VIRTUAL_CAMERA_H
GLcamera * m_camera
ec_id
bool m_generatePointCloud
RTC::TimedOrientation3D m_baseRpy
std::map< std::string, RTCGLbody * > m_bodies
InPort< RTC::TimedOrientation3D > m_baseRpyIn
manager
OutPort< RangeData > m_rangeOut
bool m_isGeneratingMovie
Img::TimedCameraImage m_image
SDLwindow m_window
InPort< RTC::TimedPoint3D > m_basePosIn
ExecutionContextHandle_t UniqueId
int m_generatePointCloudStep
void VirtualCameraInit(RTC::Manager *manager)
std::string m_cameraName
IplImage * m_cvImage
OutPort< Img::TimedCameraImage > m_imageOut
std::string m_pcFormat
TimedPose3D m_poseSensor
CvVideoWriter * m_videoWriter
InPort< OpenHRP::SceneState > m_sceneStateIn
LogManager< OpenHRP::SceneState > m_log
OutPort< TimedPose3D > m_poseSensorOut
sample RT component which has one data input port and one data output port
Definition: VirtualCamera.h:49
OpenHRP::SceneState m_sceneState
PointCloudTypes::PointCloud m_cloud
OutPort< PointCloudTypes::PointCloud > m_cloudOut
InPort< RTC::TimedDoubleSeq > m_qIn
RTC::TimedDoubleSeq m_q
RTC::TimedPoint3D m_basePos
std::string m_projectName
RangeData m_range


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