ImageData2CameraImage.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
10 #include "ImageData2CameraImage.h"
11 
12 // Module specification
13 // <rtc-template block="module_spec">
14 static const char* imagedata2cameraimage_spec[] =
15  {
16  "implementation_id", "ImageData2CameraImage",
17  "type_name", "ImageData2CameraImage",
18  "description", "imagedata2cameraimage component",
19  "version", HRPSYS_PACKAGE_VERSION,
20  "vendor", "AIST",
21  "category", "example",
22  "activity_type", "DataFlowComponent",
23  "max_instance", "10",
24  "language", "C++",
25  "lang_type", "compile",
26  // Configuration variables
27 
28  ""
29  };
30 // </rtc-template>
31 
33  : RTC::DataFlowComponentBase(manager),
34  // <rtc-template block="initializer">
35  m_dataIn("imageIn", m_data.data.image),
36  m_dataOut("imageOut", m_data),
37  // </rtc-template>
38  dummy(0)
39 {
40 }
41 
43 {
44 }
45 
46 
47 
49 {
50  std::cout << m_profile.instance_name << ": onInitialize()" << std::endl;
51  // <rtc-template block="bind_config">
52  // Bind variables and configuration variable
53 
54  // </rtc-template>
55 
56  // Registration: InPort/OutPort/Service
57  // <rtc-template block="registration">
58  // Set InPort buffers
59  addInPort("imageIn", m_dataIn);
60 
61  // Set OutPort buffer
62  addOutPort("imageOut", m_dataOut);
63 
64  // Set service provider to Ports
65 
66  // Set service consumers to Ports
67 
68  // Set CORBA Service Ports
69 
70  // </rtc-template>
71  m_data.error_code = 0;
72 
73  return RTC::RTC_OK;
74 }
75 
76 
77 
78 /*
79 RTC::ReturnCode_t ImageData2CameraImage::onFinalize()
80 {
81  return RTC::RTC_OK;
82 }
83 */
84 
85 /*
86 RTC::ReturnCode_t ImageData2CameraImage::onStartup(RTC::UniqueId ec_id)
87 {
88  return RTC::RTC_OK;
89 }
90 */
91 
92 /*
93 RTC::ReturnCode_t ImageData2CameraImage::onShutdown(RTC::UniqueId ec_id)
94 {
95  return RTC::RTC_OK;
96 }
97 */
98 
100 {
101  std::cout << m_profile.instance_name<< ": onActivated(" << ec_id << ")" << std::endl;
102  return RTC::RTC_OK;
103 }
104 
106 {
107  std::cout << m_profile.instance_name<< ": onDeactivated(" << ec_id << ")" << std::endl;
108  return RTC::RTC_OK;
109 }
110 
112 {
113  if (m_dataIn.isNew()){
114  m_dataIn.read();
115  m_dataOut.write();
116  }
117  return RTC::RTC_OK;
118 }
119 
120 /*
121 RTC::ReturnCode_t ImageData2CameraImage::onAborting(RTC::UniqueId ec_id)
122 {
123  return RTC::RTC_OK;
124 }
125 */
126 
127 /*
128 RTC::ReturnCode_t ImageData2CameraImage::onError(RTC::UniqueId ec_id)
129 {
130  return RTC::RTC_OK;
131 }
132 */
133 
134 /*
135 RTC::ReturnCode_t ImageData2CameraImage::onReset(RTC::UniqueId ec_id)
136 {
137  return RTC::RTC_OK;
138 }
139 */
140 
141 /*
142 RTC::ReturnCode_t ImageData2CameraImage::onStateUpdate(RTC::UniqueId ec_id)
143 {
144  return RTC::RTC_OK;
145 }
146 */
147 
148 /*
149 RTC::ReturnCode_t ImageData2CameraImage::onRateChanged(RTC::UniqueId ec_id)
150 {
151  return RTC::RTC_OK;
152 }
153 */
154 
155 
156 
157 extern "C"
158 {
159 
161  {
163  manager->registerFactory(profile,
164  RTC::Create<ImageData2CameraImage>,
165  RTC::Delete<ImageData2CameraImage>);
166  }
167 
168 };
169 
170 
ComponentProfile m_profile
png_infop png_charpp int png_charpp profile
virtual ~ImageData2CameraImage()
Destructor.
OutPort< Img::TimedCameraImage > m_dataOut
png_bytepp image
bool addOutPort(const char *name, OutPortBase &outport)
InPort< Img::ImageData > m_dataIn
ExecutionContextHandle_t UniqueId
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
void ImageData2CameraImageInit(RTC::Manager *manager)
virtual bool isNew()
virtual RTC::ReturnCode_t onInitialize()
virtual bool write(DataType &value)
JSAMPIMAGE data
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
static const char * imagedata2cameraimage_spec[]
bool addInPort(const char *name, InPortBase &inport)
Img::TimedCameraImage m_data
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
ImageData2CameraImage(RTC::Manager *manager)
Constructor.


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