YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FrameGrabber_nwc_yarp.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
8
9#include <yarp/os/Network.h>
11#include <yarp/os/LogStream.h>
13
14#include <yarp/sig/ImageUtils.h>
15
16namespace {
17YARP_LOG_COMPONENT(FRAMEGRABBER_NWC_YARP, "yarp.devices.frameGrabber_nwc_yarp")
18} // namespace
19
20using namespace yarp::dev;
21using namespace yarp::sig;
22
23// BEGIN FrameGrabberOf_ForwarderWithStream
24template <typename ImageType>
29
30template <typename ImageType>
33 std::lock_guard<std::mutex> lock(m_mutex);
34 // If not configured for receiving streams, do a RPC call via thrift
35 if (!m_streamReceiver)
36 {
37 if (!m_thriftClient) {
38 //return ReturnValue::return_code::return_value_error_generic;
39 return 0;
40 }
41 auto ret = m_thriftClient->getHeightRPC();
42 if (ret.ret) {
43 return ret.val;
44 }
45 return 0;
46 }
47 else
48 {
49 return m_streamReceiver->lastHeight();
50 }
51}
52
53template <typename ImageType>
55{
56 std::lock_guard<std::mutex> lock(m_mutex);
57 // If not configured for receiving streams, do a RPC call via thrift
58 if (!m_streamReceiver)
59 {
60 if (!m_thriftClient)
61 {
62 //return ReturnValue::return_code::return_value_error_generic;
63 return 0;
64 }
65 auto ret = m_thriftClient->getWidthRPC();
66 if (ret.ret)
67 {
68 return ret.val;
69 }
70 return 0;
71 }
72 else
73 {
74 return m_streamReceiver->lastWidth();
75 }
76}
77
78template <typename ImageType>
80{
81 std::lock_guard<std::mutex> lock(m_mutex);
82 // If not configured for receiving streams, do an RPC call via thrift
83 if (!m_streamReceiver)
84 {
85 if (!m_thriftClient)
86 {
87 return ReturnValue::return_code::return_value_error_generic;
88 }
89 auto ret = m_thriftClient->getImageRPC();
90 if (ret.ret)
91 {
92 image.copy(ret.fImage);
93 }
94 return ret.ret;
95 }
96
97 bool b= m_streamReceiver->lastImage(image);
98 if (!b) {
99 return ReturnValue::return_code::return_value_error_not_ready;
100 }
101 return ReturnValue_ok;
102}
103
104template <typename ImageType>
106 std::vector<yarp::dev::vertex_t> vertices,
108{
109 std::lock_guard<std::mutex> lock(m_mutex);
110 // If not configured for receiving streams, do an RPC call via thrift
111 if(!m_streamReceiver)
112 {
113 if (!m_thriftClient) {
114 return ReturnValue::return_code::return_value_error_generic;
115 }
116 std::vector<yarp::dev::vertex_t> vv;
117 vv.resize(vertices.size());
118 for (size_t i = 0; i < vertices.size(); i++)
119 {
120 vv[i] = vertices[i];
121 }
122 auto ret = m_thriftClient->getImageCropRPC(cropType, vv);
123 if (ret.ret) {
124 image.copy(ret.fImage);
125 }
126 return ret.ret;
127 }
128
129 if (cropType == YARP_CROP_RECT) {
130 if (vertices.size() != 2) {
131 yCError(FRAMEGRABBER_NWC_YARP, "GetImageCrop failed: RECT mode requires 2 vertices");
132 return ReturnValue::return_code::return_value_error_method_failed;
133 }
134 ImageType full;
135 bool b = m_streamReceiver->lastImage(full);
136 if (!b || full.width() == 0 || full.height() == 0)
137 {
138 yCError(FRAMEGRABBER_NWC_YARP, "GetImageCrop failed: No image received");
139 return ReturnValue::return_code::return_value_error_not_ready;
140 }
141
142 std::pair<unsigned int, unsigned int> v0;
143 v0.first = vertices[0].x;
144 v0.second = vertices[0].y;
145 std::pair<unsigned int, unsigned int> v1;
146 v1.first = vertices[1].x;
147 v1.second = vertices[1].y;
148 if (!yarp::sig::utils::cropRect(full, v0, v1, image)) {
149 yCError(FRAMEGRABBER_NWC_YARP, "GetImageCrop failed: utils::cropRect error: (%d, %d) (%d, %d)",
150 vertices[0].x,
151 vertices[0].y,
152 vertices[1].x,
153 vertices[1].y);
154 return ReturnValue::return_code::return_value_error_method_failed;
155 }
156 }
157 else if (cropType == YARP_CROP_LIST) {
158 yCError(FRAMEGRABBER_NWC_YARP, "List type not yet implemented");
159 return ReturnValue::return_code::return_value_error_not_implemented_by_device;
160 }
161
162 return ReturnValue_ok;
163}
164
165
166template <typename ImageType>
168{
169 std::lock_guard<std::mutex> lock(m_mutex);
170 m_streamReceiver = streamReceiver;
171}
172// END FrameGrabberOf_ForwarderWithStream
173
174// BEGIN FrameGrabber_nwc_yarp
176 FrameGrabberOf_ForwarderWithStream<yarp::sig::ImageOf<yarp::sig::PixelRgb>>(&m_frameGrabber_RPC),
177 FrameGrabberOf_ForwarderWithStream<yarp::sig::ImageOf<yarp::sig::PixelMono>>(&m_frameGrabber_RPC),
178 FrameGrabberOf_ForwarderWithStream<yarp::sig::ImageOf<yarp::sig::PixelFloat>>(&m_frameGrabber_RPC),
179 FrameGrabberOf_ForwarderWithStream<yarp::sig::FlexImage>(&m_frameGrabber_RPC)
180{
181}
182
183
185{
186 if (!this->parseParams(config)) { return false; }
187
188 if (!m_no_stream) {
189 if (!m_streamReceiver.open(m_local, m_remote, m_carrier)) {
190 return false;
191 }
196 }
197
198 std::string rpc_local = m_local + "/rpc_client";
199 std::string rpc_remote = m_remote + "/rpc";
200 if (!m_rpcPort.open(rpc_local)) {
201 yCError(FRAMEGRABBER_NWC_YARP) << "Failed to open " << rpc_local << "port.";
202 }
203
204 if (!m_remote.empty()) {
205 yCInfo(FRAMEGRABBER_NWC_YARP) << "Connecting" << m_rpcPort.getName() << "to" << rpc_remote;
206 if (!yarp::os::NetworkBase::connect(m_rpcPort.getName(), rpc_remote)) {
207 yCError(FRAMEGRABBER_NWC_YARP) << "Failed to connect" << m_rpcPort.getName() << "to" << rpc_remote;
208 return false;
209 }
210 } else {
211 yCInfo(FRAMEGRABBER_NWC_YARP) << "No remote specified. Waiting for connection";
212 }
213
215 if (!m_frameGrabber_RPC.yarp().attachAsClient(m_rpcPort))
216 {
217 yCError(FRAMEGRABBER_NWC_YARP, "Error! Cannot attach the port as a client");
218 m_rpcPort.close();
219 return false;
220 }
221
222 // Check the protocol version
223 if (!m_frameGrabber_RPC.checkProtocolVersion()) {
224 return false;
225 }
226
227 return true;
228}
229
231{
232 m_rpcPort.interrupt();
233 m_rpcPort.close();
234
235 m_streamReceiver.close();
236
237 return true;
238}
239
240
242{
243 return m_streamReceiver.lastStamp();
244}
245
246
247/*
248* IRgbVisualParams interface. Look at IVisualParams.h for documentation
249*/
251{
252 std::lock_guard <std::mutex> lg(m_mutex);
253 auto r = m_frameGrabber_RPC.getRgbHeightRPC();
254 return r.height;
255}
256
258{
259 std::lock_guard <std::mutex> lg(m_mutex);
260 auto r = m_frameGrabber_RPC.getRgbWidthRPC();
261 return r.width;
262}
263
265{
266 std::lock_guard <std::mutex> lg(m_mutex);
267 auto r = m_frameGrabber_RPC.getRgbSupportedConfigurationsRPC();
268 configurations = r.configuration;
269 return r.ret;
270}
271
273{
274 std::lock_guard <std::mutex> lg(m_mutex);
275 auto r = m_frameGrabber_RPC.getRgbResolutionRPC();
276 height = r.height;
277 width = r.width;
278 return r.ret;
279}
280
282{
283 std::lock_guard <std::mutex> lg(m_mutex);
284 auto r = m_frameGrabber_RPC.setRgbResolutionRPC(width, height);
285 return r;
286}
287
288ReturnValue FrameGrabber_nwc_yarp::getRgbFOV(double &horizontalFov, double &verticalFov)
289{
290 std::lock_guard <std::mutex> lg(m_mutex);
291 yarp::os::Value val("RGB");
292 auto r = m_frameGrabber_RPC.getRgbFOVRPC();
293 horizontalFov = r.horizontalFov;
294 verticalFov = r.verticalFOV;
295 return r.ret;
296}
297
298ReturnValue FrameGrabber_nwc_yarp::setRgbFOV(double horizontalFov, double verticalFov)
299{
300 std::lock_guard <std::mutex> lg(m_mutex);
301 auto r = m_frameGrabber_RPC.setRgbFOVRPC(horizontalFov, verticalFov);
302 return r;
303}
304
306{
307 std::lock_guard <std::mutex> lg(m_mutex);
308 auto r = m_frameGrabber_RPC.getRgbIntrinsicParamRPC();
309 intrinsic = r.params;
310 return r.ret;
311}
312
314{
315 std::lock_guard <std::mutex> lg(m_mutex);
316 auto r= m_frameGrabber_RPC.getRgbMirroringRPC();
317 mirror = r.mirror;
318 return r.ret;
319}
320
322{
323 std::lock_guard <std::mutex> lg(m_mutex);
324 auto r = m_frameGrabber_RPC.setRgbMirroringRPC(mirror);
325 return r;
326}
327
328/*
329* IFrameGrabberControls specific interface methods
330*/
332{
333 std::lock_guard<std::mutex> lg(m_mutex);
334 auto r = m_frameGrabber_RPC.getCameraDescriptionRPC();
335 camera.busType = r.camera.busType;
336 camera.deviceDescription = r.camera.deviceDescription;
337 return r.ret;
338}
339
341{
342 std::lock_guard<std::mutex> lg(m_mutex);
343 auto r = m_frameGrabber_RPC.hasFeatureRPC((int32_t)feature);
345 return r.ret;
346}
347
349{
350 std::lock_guard<std::mutex> lg(m_mutex);
351 auto r = m_frameGrabber_RPC.setFeature1RPC((int32_t)feature, value);
352 return r;
353}
354
356{
357 std::lock_guard<std::mutex> lg(m_mutex);
358 auto r = m_frameGrabber_RPC.getFeature1RPC((int32_t)feature);
359 value = r.value;
360 return r.ret;
361}
362
364{
365 std::lock_guard<std::mutex> lg(m_mutex);
366 auto r = m_frameGrabber_RPC.setFeature2RPC((int32_t)feature, value1, value2);
367 return r;
368}
369
371{
372 std::lock_guard<std::mutex> lg(m_mutex);
373 auto r = m_frameGrabber_RPC.getFeature2RPC((int32_t)feature);
374 value1 = r.value1;
375 value2 = r.value2;
376 return r.ret;
377}
378
380{
381 std::lock_guard<std::mutex> lg(m_mutex);
382 auto r = m_frameGrabber_RPC.hasOnOffRPC((int32_t)feature);
383 HasOnOff = r.HasOnOff;
384 return r.ret;
385}
386
388{
389 std::lock_guard<std::mutex> lg(m_mutex);
390 auto r = m_frameGrabber_RPC.setActiveRPC((int32_t)feature, onoff);
391 return r;
392}
393
395{
396 std::lock_guard<std::mutex> lg(m_mutex);
397 auto r = m_frameGrabber_RPC.getActiveRPC((int32_t)feature);
398 isActive = r.isActive;
399 return r.ret;
400}
401
403{
404 std::lock_guard<std::mutex> lg(m_mutex);
405 auto r = m_frameGrabber_RPC.hasAutoRPC((int32_t)feature);
406 hasAuto = r.hasAuto;
407 return r.ret;
408}
409
411{
412 std::lock_guard<std::mutex> lg(m_mutex);
413 auto r = m_frameGrabber_RPC.hasManualRPC((int32_t)feature);
415 return r.ret;
416}
417
419{
420 std::lock_guard<std::mutex> lg(m_mutex);
421 auto r = m_frameGrabber_RPC.hasOnePushRPC((int32_t)feature);
423 return r.ret;
424}
425
427{
428 std::lock_guard<std::mutex> lg(m_mutex);
429 auto r = m_frameGrabber_RPC.setModeRPC((int32_t)feature, mode);
430 return r;
431}
432
434{
435 std::lock_guard<std::mutex> lg(m_mutex);
436 auto r = m_frameGrabber_RPC.getModeRPC((int32_t)feature);
437 mode = r.mode;
438 return r.ret;
439}
440
442{
443 std::lock_guard<std::mutex> lg(m_mutex);
444 auto r = m_frameGrabber_RPC.setOnePushRPC((int32_t)feature);
445 return r;
446}
447
448/*
449* IFrameGrabberControlsDC1394 specific interface methods
450*/
452{
453 std::lock_guard<std::mutex> lg(m_mutex);
454 auto r = m_frameGrabber_RPC.getVideoModeMaskDC1394RPC();
455 val = r.val;
456 return r.ret;
457}
458
460{
461 std::lock_guard<std::mutex> lg(m_mutex);
462 auto r = m_frameGrabber_RPC.getVideoModeDC1394RPC();
463 val = r.val;
464 return r.ret;
465}
466
468{
469 std::lock_guard<std::mutex> lg(m_mutex);
470 auto r = m_frameGrabber_RPC.setVideoModeDC1394RPC(video_mode);
471 return r;
472}
473
475{
476 std::lock_guard<std::mutex> lg(m_mutex);
477 auto r = m_frameGrabber_RPC.getFPSMaskDC1394RPC();
478 val = r.val;
479 return r.ret;
480}
481
483{
484 std::lock_guard<std::mutex> lg(m_mutex);
485 auto r = m_frameGrabber_RPC.getFPSDC1394RPC();
486 fps = r.fps;
487 return r.ret;
488}
489
491{
492 std::lock_guard<std::mutex> lg(m_mutex);
493 auto r = m_frameGrabber_RPC.setFPSDC1394RPC(fps);
494 return r;
495}
496
498{
499 std::lock_guard<std::mutex> lg(m_mutex);
500 auto r = m_frameGrabber_RPC.getISOSpeedDC1394RPC();
501 speed = r.speed;
502 return r.ret;
503}
504
506{
507 std::lock_guard<std::mutex> lg(m_mutex);
508 auto r = m_frameGrabber_RPC.setISOSpeedDC1394RPC(speed);
509 return r;
510}
511
512ReturnValue FrameGrabber_nwc_yarp::getColorCodingMaskDC1394(unsigned int video_mode, unsigned int& val)
513{
514 std::lock_guard<std::mutex> lg(m_mutex);
515 auto r = m_frameGrabber_RPC.getColorCodingMaskDC1394RPC(video_mode);
516 val = r.val;
517 return r.ret;
518}
519
521{
522 std::lock_guard<std::mutex> lg(m_mutex);
523 auto r = m_frameGrabber_RPC.getColorCodingDC1394RPC();
524 val = r.val;
525 return r.ret;
526}
527
529{
530 std::lock_guard<std::mutex> lg(m_mutex);
531 auto r = m_frameGrabber_RPC.setColorCodingDC1394RPC(coding);
532 return r;
533}
534
536 unsigned int& ydim,
537 unsigned int& xstep,
538 unsigned int& ystep,
539 unsigned int& xoffstep,
540 unsigned int& yoffstep)
541{
542 std::lock_guard<std::mutex> lg(m_mutex);
543 auto r = m_frameGrabber_RPC.getFormat7MaxWindowDC1394RPC();
544 xdim = r.xdim;
545 ydim = r.ydim;
546 xstep = r.xstep;
547 ystep = r.ystep;
548 xoffstep = r.xoffstep;
549 yoffstep = r.yoffstep;
550 return r.ret;
551}
552
553ReturnValue FrameGrabber_nwc_yarp::getFormat7WindowDC1394(unsigned int& xdim, unsigned int& ydim, int& x0, int& y0)
554{
555 std::lock_guard<std::mutex> lg(m_mutex);
556 auto r = m_frameGrabber_RPC.getFormat7WindowDC1394RPC();
557 xdim = r.xdim;
558 ydim = r.ydim;
559 x0 = r.x0;
560 y0 = r.y0;
561 return r.ret;
562}
563
564ReturnValue FrameGrabber_nwc_yarp::setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0)
565{
566 std::lock_guard<std::mutex> lg(m_mutex);
567 auto r = m_frameGrabber_RPC.setFormat7WindowDC1394RPC(xdim,ydim,x0,y0);
568 return r;
569}
570
572{
573 std::lock_guard<std::mutex> lg(m_mutex);
574 auto r = m_frameGrabber_RPC.setOperationModeDC1394RPC(b1394b);
575 return r;
576}
577
579{
580 std::lock_guard<std::mutex> lg(m_mutex);
581 auto r = m_frameGrabber_RPC.getOperationModeDC1394RPC();
582 b1394b = r.b1394b;
583 return r.ret;
584}
585
587{
588 std::lock_guard<std::mutex> lg(m_mutex);
589 auto r = m_frameGrabber_RPC.setTransmissionDC1394RPC(bTxON);
590 return r;
591}
592
594{
595 std::lock_guard<std::mutex> lg(m_mutex);
596 auto r = m_frameGrabber_RPC.getTransmissionDC1394RPC();
597 bTxON = r.bTxON;
598 return r.ret;
599}
600
602{
603 std::lock_guard<std::mutex> lg(m_mutex);
604 auto r = m_frameGrabber_RPC.setBroadcastDC1394RPC(onoff);
605 return r;
606}
607
609{
610 std::lock_guard<std::mutex> lg(m_mutex);
611 auto r = m_frameGrabber_RPC.setDefaultsDC1394RPC();
612 return r;
613}
614
616{
617 std::lock_guard<std::mutex> lg(m_mutex);
618 auto r = m_frameGrabber_RPC.setResetDC1394RPC();
619 return r;
620}
621
623{
624 std::lock_guard<std::mutex> lg(m_mutex);
625 auto r = m_frameGrabber_RPC.setPowerDC1394RPC(onoff);
626 return r;
627}
628
630{
631 std::lock_guard<std::mutex> lg(m_mutex);
632 auto r = m_frameGrabber_RPC.setCaptureDC1394RPC(bON);
633 return r;
634}
635
637{
638 std::lock_guard<std::mutex> lg(m_mutex);
639 auto r = m_frameGrabber_RPC.getBytesPerPacketDC1394RPC();
640 bpp = r.bpp;
641 return r.ret;
642}
643
645{
646 std::lock_guard<std::mutex> lg(m_mutex);
647 auto r = m_frameGrabber_RPC.setBytesPerPacketDC1394RPC(bpp);
648 return r;
649}
650
651// END FrameGrabber_nwc_yarp
CameraDescriptor camera
FeatureMode mode
bool ret
#define ReturnValue_ok
Definition ReturnValue.h:80
virtual IFrameGrabberControlMsgs_return_getActive getActiveRPC(const std::int32_t feature)
virtual yarp::dev::ReturnValue setColorCodingDC1394RPC(const std::int32_t coding)
virtual yarp::dev::ReturnValue setRgbFOVRPC(const double horizontalFov, const double verticalFov)
virtual yarp::dev::ReturnValue setFeature2RPC(const std::int32_t feature, const double value1, const double value2)
virtual yarp::dev::ReturnValue setOnePushRPC(const std::int32_t feature)
virtual yarp::dev::ReturnValue setFormat7WindowDC1394RPC(const std::int32_t xdim, const std::int32_t ydim, const std::int32_t x0, const std::int32_t y0)
virtual yarp::dev::ReturnValue setVideoModeDC1394RPC(const std::int32_t videomode)
virtual yarp::dev::ReturnValue setBytesPerPacketDC1394RPC(const std::int32_t bpp)
virtual IFrameGrabberControlDC1394Msgs_return_getFormat7MaxWindowDC1394 getFormat7MaxWindowDC1394RPC()
virtual IRGBVisualParamsMsgs_return_getRgbHeight getRgbHeightRPC()
virtual bool checkProtocolVersion()
virtual IFrameGrabberControlDC1394Msgs_return_getOperationModeDC1394 getOperationModeDC1394RPC()
virtual yarp::dev::ReturnValue setFPSDC1394RPC(const std::int32_t fps)
virtual IFrameGrabberControlDC1394Msgs_return_getTransmissionDC1394 getTransmissionDC1394RPC()
virtual yarp::dev::ReturnValue setPowerDC1394RPC(const bool onoff)
virtual IFrameGrabberControlDC1394Msgs_return_getISOSpeedDC1394 getISOSpeedDC1394RPC()
virtual IFrameGrabberControlMsgs_return_getFeature2 getFeature2RPC(const std::int32_t feature)
virtual IFrameGrabberControlMsgs_return_hasFeature hasFeatureRPC(const std::int32_t feature)
virtual yarp::dev::ReturnValue setTransmissionDC1394RPC(const bool bTxON)
virtual IFrameGrabberControlMsgs_return_getFeature1 getFeature1RPC(const std::int32_t feature)
virtual IFrameGrabberControlMsgs_return_getCameraDescription getCameraDescriptionRPC()
virtual yarp::dev::ReturnValue setRgbResolutionRPC(const std::int32_t width, const std::int32_t height)
virtual yarp::dev::ReturnValue setDefaultsDC1394RPC()
virtual IRGBVisualParamsMsgs_return_getRgbResolution getRgbResolutionRPC()
virtual IFrameGrabberControlDC1394Msgs_return_getFPSMaskDC1394 getFPSMaskDC1394RPC()
virtual IFrameGrabberControlDC1394Msgs_return_getVideoModeMaskDC1394 getVideoModeMaskDC1394RPC()
virtual IFrameGrabberControlDC1394Msgs_return_getColorCodingMaskDC1394 getColorCodingMaskDC1394RPC(const std::int32_t videomode)
virtual yarp::dev::ReturnValue setOperationModeDC1394RPC(const bool b1394b)
virtual IRGBVisualParamsMsgs_return_getRgbSupportedCfg getRgbSupportedConfigurationsRPC()
virtual yarp::dev::ReturnValue setISOSpeedDC1394RPC(const std::int32_t speed)
virtual IFrameGrabberControlDC1394Msgs_return_getFPSDC1394 getFPSDC1394RPC()
virtual yarp::dev::ReturnValue setCaptureDC1394RPC(const bool bON)
virtual IFrameGrabberControlMsgs_return_hasAuto hasAutoRPC(const std::int32_t feature)
virtual IRGBVisualParamsMsgs_return_getRgbMirroring getRgbMirroringRPC()
virtual IRGBVisualParamsMsgs_return_getRgbFOV getRgbFOVRPC()
virtual yarp::dev::ReturnValue setFeature1RPC(const std::int32_t feature, const double value)
virtual IFrameGrabberControlMsgs_return_getMode getModeRPC(const std::int32_t feature)
virtual IRGBVisualParamsMsgs_return_getRgbIntrinsicParam getRgbIntrinsicParamRPC()
virtual IRGBVisualParamsMsgs_return_getRgbWidth getRgbWidthRPC()
virtual yarp::dev::ReturnValue setRgbMirroringRPC(const bool mirror)
virtual IFrameGrabberControlDC1394Msgs_return_getVideoModeDC1394 getVideoModeDC1394RPC()
virtual yarp::dev::ReturnValue setBroadcastDC1394RPC(const bool onoff)
virtual IFrameGrabberControlDC1394Msgs_return_getColorCodingDC1394 getColorCodingDC1394RPC()
virtual yarp::dev::ReturnValue setResetDC1394RPC()
virtual IFrameGrabberControlMsgs_return_hasOnOff hasOnOffRPC(const std::int32_t feature)
virtual IFrameGrabberControlDC1394Msgs_return_getFormat7WindowDC1394 getFormat7WindowDC1394RPC()
virtual IFrameGrabberControlMsgs_return_hasManual hasManualRPC(const std::int32_t feature)
virtual IFrameGrabberControlMsgs_return_hasOnePush hasOnePushRPC(const std::int32_t feature)
virtual IFrameGrabberControlDC1394Msgs_return_getBytesPerPacketDC1394 getBytesPerPacketDC1394RPC()
virtual yarp::dev::ReturnValue setModeRPC(const std::int32_t feature, const yarp::dev::FeatureMode mode)
virtual yarp::dev::ReturnValue setActiveRPC(const std::int32_t feature, const bool onoff)
FrameGrabberOf_ForwarderWithStream(FrameGrabberMsgs *thriftClient)
void setStreamReceiver(StreamReceiver *m_streamReceiver)
yarp::dev::ReturnValue getImage(ImageType &image) override
Get an image from the frame grabber.
int width() const override
Return the width of each frame.
yarp::dev::ReturnValue getImageCrop(yarp::dev::cropType_id_t cropType, std::vector< yarp::dev::vertex_t > vertices, ImageType &image) override
Get a crop of the image from the frame grabber.
int height() const override
Return the height of each frame.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
yarp::dev::ReturnValue getColorCodingDC1394(unsigned int &val) override
yarp::dev::ReturnValue setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
yarp::dev::ReturnValue getRgbSupportedConfigurations(std::vector< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
yarp::dev::ReturnValue setMode(yarp::dev::cameraFeature_id_t feature, yarp::dev::FeatureMode mode) override
Set the requested mode for the feature.
yarp::dev::ReturnValue getCameraDescription(yarp::dev::CameraDescriptor &camera) override
Get a basic description of the camera hw.
yarp::dev::ReturnValue getColorCodingMaskDC1394(unsigned int video_mode, unsigned int &val) override
yarp::dev::ReturnValue getISOSpeedDC1394(unsigned int &val) override
yarp::dev::ReturnValue setBroadcastDC1394(bool onoff) override
yarp::dev::ReturnValue getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0) override
yarp::dev::ReturnValue setCaptureDC1394(bool bON) override
yarp::dev::ReturnValue getFPSMaskDC1394(unsigned int &val) override
yarp::dev::ReturnValue setColorCodingDC1394(int coding) override
yarp::dev::ReturnValue getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep) override
yarp::dev::ReturnValue getOperationModeDC1394(bool &b1394b) override
yarp::dev::ReturnValue setISOSpeedDC1394(int speed) override
yarp::dev::ReturnValue setBytesPerPacketDC1394(unsigned int bpp) override
yarp::dev::ReturnValue setVideoModeDC1394(int video_mode) override
yarp::dev::ReturnValue getMode(yarp::dev::cameraFeature_id_t feature, yarp::dev::FeatureMode &mode) override
Get the current mode for the feature.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue setDefaultsDC1394() override
yarp::dev::ReturnValue hasFeature(yarp::dev::cameraFeature_id_t feature, bool &hasFeature) override
Check if camera has the requested feature (saturation, brightness ... )
yarp::dev::ReturnValue setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
int getRgbWidth() override
Return the width of each frame.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getTransmissionDC1394(bool &bTxON) override
yarp::dev::ReturnValue getVideoModeMaskDC1394(unsigned int &val) override
yarp::dev::ReturnValue getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
yarp::dev::ReturnValue hasAuto(yarp::dev::cameraFeature_id_t feature, bool &hasAuto) override
Check if the requested feature has the 'auto' mode.
int getRgbHeight() override
Return the height of each frame.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
yarp::dev::ReturnValue getFPSDC1394(unsigned int &val) override
yarp::dev::ReturnValue setTransmissionDC1394(bool bTxON) override
yarp::dev::ReturnValue getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
yarp::dev::ReturnValue setPowerDC1394(bool onoff) override
yarp::dev::ReturnValue hasOnePush(yarp::dev::cameraFeature_id_t feature, bool &hasOnePush) override
Check if the requested feature has the 'onePush' mode.
yarp::dev::ReturnValue hasOnOff(yarp::dev::cameraFeature_id_t feature, bool &HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
yarp::dev::ReturnValue setFPSDC1394(int fps) override
yarp::dev::ReturnValue getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
yarp::dev::ReturnValue setFeature(yarp::dev::cameraFeature_id_t feature, double value) override
Set the requested feature to a value (saturation, brightness ... )
yarp::dev::ReturnValue setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
yarp::dev::ReturnValue getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
yarp::dev::ReturnValue getVideoModeDC1394(unsigned int &val) override
yarp::dev::ReturnValue getFeature(yarp::dev::cameraFeature_id_t feature, double &value) override
Get the current value for the requested feature.
yarp::dev::ReturnValue getActive(yarp::dev::cameraFeature_id_t feature, bool &isActive) override
Get the current status of the feature, on or off.
yarp::dev::ReturnValue getBytesPerPacketDC1394(unsigned int &bpp) override
yarp::dev::ReturnValue setOnePush(yarp::dev::cameraFeature_id_t feature) override
Set the requested feature to a value (saturation, brightness ... )
yarp::dev::ReturnValue setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0) override
yarp::dev::ReturnValue setActive(yarp::dev::cameraFeature_id_t feature, bool onoff) override
Set the requested feature on or off.
yarp::dev::ReturnValue setOperationModeDC1394(bool b1394b) override
yarp::dev::ReturnValue setResetDC1394() override
yarp::dev::ReturnValue hasManual(yarp::dev::cameraFeature_id_t feature, bool &hasManual) override
Check if the requested feature has the 'manual' mode.
yarp::os::Stamp lastStamp() const
bool open(const std::string &local, const std::string &remote, const std::string &carrier)
A mini-server for performing network communication in the background.
virtual std::string getName() const
Get name of port.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Definition Network.cpp:682
void interrupt() override
Interrupt any current reads or writes attached to the port.
Definition Port.cpp:347
void close() override
Stop port activity.
Definition Port.cpp:330
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Definition Port.cpp:79
A class for storing options and configuration information.
Definition Property.h:33
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
A single value (typically within a Bottle).
Definition Value.h:44
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition Wire.h:28
Image class with user control of representation details.
Definition Image.h:361
size_t width() const
Gets width of image in pixels.
Definition Image.h:171
size_t height() const
Gets height of image in pixels.
Definition Image.h:177
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
bool cropRect(const yarp::sig::Image &inImg, const std::pair< unsigned int, unsigned int > &vertex1, const std::pair< unsigned int, unsigned int > &vertex2, yarp::sig::Image &outImg)
Crop a rectangle area out of an image given two opposite vertices.
The main, catch-all namespace for YARP.
Definition dirs.h:16