MaskFilterPointCloudProcessor.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::ArmarXObjects::MaskFilterPointCloudProcessor
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23
25
27
28#include <pcl/common/transforms.h>
29#include <pcl/point_types.h>
30
32
35
36#include <VisionX/interface/components/Calibration.h>
38
39static constexpr auto InMaskSuff = "_in_mask";
40static constexpr auto OutOfMaskSuff = "_out_of_mask";
41static constexpr auto OutOfMaskImgSuff = "_out_of_image";
42static constexpr auto MaskVisuSuff = "_mask_visu";
43static constexpr auto MaskAsCloudSuff = "_mask_as_cloud";
44
45#define call_template_function(F) \
46 switch (_pointCloudProviderInfo.pointCloudFormat->type) \
47 { \
48 /*case visionx::PointContentType::ePoints : F<pcl::PointXYZ>(); break; */ \
49 case visionx::PointContentType::eColoredPoints: \
50 F<pcl::PointXYZRGBA>(); \
51 break; \
52 case visionx::PointContentType::eColoredOrientedPoints: \
53 F<pcl::PointXYZRGBNormal>(); \
54 break; \
55 /*case visionx::PointContentType::eLabeledPoints : F<pcl::PointXYZL>(); break; */ \
56 case visionx::PointContentType::eColoredLabeledPoints: \
57 F<pcl::PointXYZRGBL>(); \
58 break; \
59 /*case visionx::PointContentType::eIntensity : F<pcl::PointXYZI>(); break; */ \
60 case visionx::PointContentType::eOrientedPoints: \
61 ARMARX_ERROR << "eOrientedPoints NOT HANDLED IN VISIONX"; /*no break*/ \
62 [[fallthrough]]; \
63 default: \
64 ARMARX_ERROR << "Could not process point cloud, because format '" \
65 << _pointCloudProviderInfo.pointCloudFormat->type << "' is unknown"; \
66 } \
67 do \
68 { \
69 } while (false)
70
71using namespace armarx;
72
73void
78
79void
81{
83 _debugDrawerTopicName = getProperty<std::string>("DebugDrawerTopicName");
85 _robotStateComponentName = getProperty<std::string>("RobotStateComponentName");
87
90
94
95 _redHi = static_cast<std::uint8_t>(getProperty<int>("MaskRedHi"));
96 _redLo = static_cast<std::uint8_t>(getProperty<int>("MaskRedLo"));
97 _greenHi = static_cast<std::uint8_t>(getProperty<int>("MaskGreenHi"));
98 _greenLo = static_cast<std::uint8_t>(getProperty<int>("MaskGreenLo"));
99 _blueHi = static_cast<std::uint8_t>(getProperty<int>("MaskBlueHi"));
100 _blueLo = static_cast<std::uint8_t>(getProperty<int>("MaskBlueLo"));
101
102 _pointCloudReportFrame = getProperty<std::string>("PointCloudReportFrame");
103}
104
105void
107{
108 //sync
109 {
112 VirtualRobot::RobotIO::eStructure);
113 }
114 //debug visu
115 {
117 }
118 //point cloud provider
119 {
125
129 getProperty<std::string>("PointCloudProviderReferenceFrameOverride");
130 if (_pointCloudProviderRefFrame.empty())
131 {
133 auto frameprov = visionx::ReferenceFrameInterfacePrx::checkedCast(_pointCloudProvider);
134 if (frameprov)
135 {
136 _pointCloudProviderRefFrame = frameprov->getReferenceFrame();
137 }
138 }
140 }
141 //guess some config params
142 {
143 _maskZRotation = -180;
144 if (_pointCloudProviderRefFrame.size() >= 3 &&
145 (_pointCloudProviderRefFrame.substr(_pointCloudProviderRefFrame.size() - 3) == "Sim" ||
146 _pointCloudProviderRefFrame.substr(_pointCloudProviderRefFrame.size() - 3) == "sim"))
147 {
148 _maskZRotation = -90;
149 }
150 }
151 //image provider
152 {
155 ARMARX_CHECK_EQUAL(_maskImageProviderInfo.imageFormat.type, visionx::ImageType::eRgb);
161 for (int i = 0; i < _maskImageProviderInfo.numberImages; ++i)
162 {
163 _maskImageProviderImageOwner.emplace_back(
165 _maskImageProviderImages.emplace_back(
166 static_cast<void*>(_maskImageProviderImageOwner.back()->pixels));
167 }
168
169
170 {
172 getProperty<std::string>("MaskImageProviderReferenceFrameOverride");
173 if (_maskImageProviderRefFrame.empty())
174 {
176 auto frameprov =
177 visionx::ReferenceFrameInterfacePrx::checkedCast(_maskImageProvider);
178 if (frameprov)
179 {
180 _maskImageProviderRefFrame = frameprov->getReferenceFrame();
181 }
182 }
184 }
185
186 const std::string calibProviderName = getProperty<std::string>("CalibrationProviderName");
187 if (calibProviderName.empty())
188 {
189 auto mcalibprov =
190 visionx::MonocularCalibrationCapturingProviderInterfacePrx::checkedCast(
192 auto scalibprov =
193 visionx::StereoCalibrationInterfacePrx::checkedCast(_maskImageProvider);
194 ARMARX_CHECK_EXPRESSION(mcalibprov || scalibprov);
195 if (scalibprov)
196 {
198 scalibprov->getStereoCalibration().calibrationLeft.cameraParam.focalLength.at(
199 0);
201 scalibprov->getStereoCalibration().calibrationLeft.cameraParam.focalLength.at(
202 1);
203 }
204 else if (mcalibprov)
205 {
207 mcalibprov->getCalibration().cameraParam.focalLength.at(0);
209 mcalibprov->getCalibration().cameraParam.focalLength.at(1);
210 }
211 }
212 else
213 {
214 auto calibProvider = getProxy<Ice::ObjectPrx>(calibProviderName);
215 auto mcalibprov =
216 visionx::MonocularCalibrationCapturingProviderInterfacePrx::checkedCast(
217 calibProvider);
218 auto scalibprov = visionx::StereoCalibrationInterfacePrx::checkedCast(calibProvider);
219 ARMARX_CHECK_EXPRESSION(mcalibprov || scalibprov);
220 if (scalibprov)
221 {
223 scalibprov->getStereoCalibration().calibrationLeft.cameraParam.focalLength.at(
224 0);
226 scalibprov->getStereoCalibration().calibrationLeft.cameraParam.focalLength.at(
227 1);
228 }
229 else if (mcalibprov)
230 {
232 mcalibprov->getCalibration().cameraParam.focalLength.at(0);
234 mcalibprov->getCalibration().cameraParam.focalLength.at(1);
235 }
236 }
237 }
238 //gui
239 {
242
243 auto makeSlider = [&](std::string name, int val, int min = 0, int max = 255)
244 {
245 rootLayoutBuilder.addChild(
247 .addChild(RemoteGui::makeTextLabel(name))
248 .addChild(RemoteGui::makeIntSlider(name).min(min).max(max).value(val))
249 .addChild(
250 RemoteGui::makeIntSpinBox(name + "_spin").min(min).max(max).value(val)));
251 };
252 auto makeFSlider = [&](std::string name, int min, int max, float val)
253 {
254 rootLayoutBuilder.addChild(
256 .addChild(RemoteGui::makeTextLabel(name))
257 .addChild(RemoteGui::makeFloatSlider(name).min(min).max(max).value(val).steps(
258 static_cast<int>(max - min)))
259 .addChild(
260 RemoteGui::makeFloatSpinBox(name + "_spin").min(min).max(max).value(val)));
261 };
262
263 // ValueProxy<float> x1Slider = makeSlider ...
264 makeSlider("red lo", _redLo);
265 makeSlider("red hi", _redHi);
266 makeSlider("green lo", _greenLo);
267 makeSlider("green hi", _greenHi);
268 makeSlider("blue lo", _blueLo);
269 makeSlider("blue hi", _blueHi);
270
271
272 rootLayoutBuilder.addChild(
274 .addChild(RemoteGui::makeTextLabel("mask match one color range"))
276 .addChild(RemoteGui::makeTextLabel("flip x"))
277 .addChild(RemoteGui::makeCheckBox("flip x").value(_flipX))
278 .addChild(RemoteGui::makeTextLabel("flip y"))
279 .addChild(RemoteGui::makeCheckBox("flip y").value(_flipY)));
280
281 rootLayoutBuilder.addChild(
283 .addChild(RemoteGui::makeTextLabel("offset x"))
284 .addChild(
285 RemoteGui::makeIntSpinBox("offset x").min(-2000).max(2000).value(_offsetX))
286 .addChild(RemoteGui::makeTextLabel("offset y"))
287 .addChild(
288 RemoteGui::makeIntSpinBox("offset y").min(-2000).max(2000).value(_offsetY)));
289
291 const int focaladjrange = 10000;
292 makeFSlider(
293 "focal length adjustment", -focaladjrange, focaladjrange, _focalLengthAdjustment);
294 makeFSlider("Mask z rotation", -180, 180, _maskZRotation);
295
296 rootLayoutBuilder.addChild(RemoteGui::makeHBoxLayout()
297 .addChild(RemoteGui::makeTextLabel("report frame"))
298 .addChild(RemoteGui::makeComboBox("report frame")
299 .options(_localRobot->getRobotNodeNames())
300 .addOptions({"Global", "root"})
301 .value("root")));
302
303
304 auto checkboxBuilder = RemoteGui::makeCheckBox("Sync using timestamp");
305 checkboxBuilder.value(_syncRobotWithTimestamp);
306 checkboxBuilder.widget().label = "Sync using timestamp";
307 rootLayoutBuilder.addChild(checkboxBuilder);
308 rootLayoutBuilder.addChild(new RemoteGui::VSpacer());
309
311 [this]()
312 {
313 _guiTab.receiveUpdates();
314
315 _redLo = static_cast<std::uint8_t>(_guiTab.getValue<int>("red lo").get());
316 _guiTab.getValue<int>("red lo_spin").set(_redLo);
317
318 _redHi = static_cast<std::uint8_t>(_guiTab.getValue<int>("red hi").get());
319 _guiTab.getValue<int>("red hi_spin").set(_redHi);
320
321 _greenLo = static_cast<std::uint8_t>(_guiTab.getValue<int>("green lo").get());
322 _guiTab.getValue<int>("green lo_spin").set(_greenLo);
323
324 _greenHi = static_cast<std::uint8_t>(_guiTab.getValue<int>("green hi").get());
325 _guiTab.getValue<int>("green hi_spin").set(_greenHi);
326
327 _blueLo = static_cast<std::uint8_t>(_guiTab.getValue<int>("blue lo").get());
328 _guiTab.getValue<int>("blue lo_spin").set(_blueLo);
329
330 _blueHi = static_cast<std::uint8_t>(_guiTab.getValue<int>("blue hi").get());
331 _guiTab.getValue<int>("blue hi_spin").set(_blueHi);
332
333 _offsetX = _guiTab.getValue<int>("offset x").get();
334 _offsetY = _guiTab.getValue<int>("offset y").get();
335
336 _maskZRotation = _guiTab.getValue<float>("Mask z rotation").get();
337 _guiTab.getValue<float>("Mask z rotation_spin").set(_maskZRotation);
338
339 _focalLengthAdjustment = _guiTab.getValue<float>("focal length adjustment").get();
340 _guiTab.getValue<float>("focal length adjustment_spin").set(_focalLengthAdjustment);
341
342 _flipX = _guiTab.getValue<bool>("flip x").get();
343 _flipY = _guiTab.getValue<bool>("flip y").get();
344 _maskMatchOneRangeInsteadOfAll = _guiTab.getValue<bool>("ormode").get();
345
346 _guiTab.sendUpdates();
347
348 std::lock_guard<std::mutex> guard{_pointCloudReportFrameMutex};
349 _pointCloudReportFrame = _guiTab.getValue<std::string>("report frame").get();
350 _guiParamUpdated = true;
351 _syncRobotWithTimestamp = _guiTab.getValue<bool>("Sync using timestamp").get();
352 },
353 10);
354
355 RemoteGui::WidgetPtr rootLayout = rootLayoutBuilder;
356
357 _remoteGui->createTab(getName(), rootLayout);
359
360 _guiTask->start();
361 }
362}
363
364void
371
372std::pair<float, float>
378
379std::array<float, 3>
380MaskFilterPointCloudProcessor::uvz2xyz(int u, int v, float z, float /*fx*/, float /*fy*/) const
381{
382 const float alpha = -_maskZRotation / 180.0 * M_PI;
383 const float s = std::sin(alpha);
384 const float c = std::cos(alpha);
385
386 const auto width = _maskImageProviderInfo.imageFormat.dimension.width;
387 const auto height = _maskImageProviderInfo.imageFormat.dimension.height;
388
389 //middle to 0/0 and add offset
390 const float ushifted = u - +width / 2.f + _offsetX;
391 const float vshifted = v - +height / 2.f + _offsetY;
392
393 const float rotatedU = c * ushifted + s * vshifted;
394 const float rotatedV = -s * ushifted + c * vshifted;
395
396 const float x = (_flipX ? 1 : -1) * rotatedU;
397 const float y = (_flipY ? 1 : -1) * rotatedV;
398
399 return {x, y, z};
400}
401
402std::array<std::int64_t, 2>
403MaskFilterPointCloudProcessor::xyz2uv(float x, float y, float z, float fx, float fy) const
404{
405 const float alpha = _maskZRotation / 180.0 * M_PI;
406 const float s = std::sin(alpha);
407 const float c = std::cos(alpha);
408
409 //transform to uv
410 const float u = (_flipX ? 1 : -1) * (x / z) * fx;
411 const float v = (_flipY ? 1 : -1) * (y / z) * fy;
412
413 const float rotatedU = c * u + -s * v;
414 const float rotatedV = s * u + c * v;
415
416 const auto width = _maskImageProviderInfo.imageFormat.dimension.width;
417 const auto height = _maskImageProviderInfo.imageFormat.dimension.height;
418
419 // 0/0 is currently the middle of the image -> shift it and sub offsets
420 const std::int64_t imgx = static_cast<std::int64_t>(rotatedU + width / 2.f) - _offsetX;
421 const std::int64_t imgy = static_cast<std::int64_t>(rotatedV + height / 2.f) - _offsetY;
422
423 return {imgx, imgy};
424}
425
432
433template <typename PointType>
434void
436{
437 //something new to do?
438 {
440 {
441 _newPointCloud = true;
442 }
444 {
445 _newMaskImage = true;
446 }
447
449 {
450 return;
451 }
452 _newMaskImage = false;
453 _newPointCloud = false;
454 }
455
456 std::lock_guard<std::mutex> guard{_cloudMutex};
457
458 //working data
459 typename pcl::PointCloud<PointType>::Ptr inputCloud(new pcl::PointCloud<PointType>());
460 //get new data
461 {
463
465
467
469 {
471 _localRobot, _robotStateComponent, format->timeProvided);
472 }
473 else
474 {
476 }
477 }
478 Eigen::Matrix4f pclInCamFrame = Eigen::Matrix4f::Identity();
479 Eigen::Matrix4f camInReportFrame = Eigen::Matrix4f::Identity();
480 {
481 {
482 std::lock_guard<std::mutex> guard{_pointCloudReportFrameMutex};
483 if (_pointCloudReportFrame == "root")
484 {
485 _pointCloudReportFrame = _localRobot->getRootNode()->getName();
486 }
487 FramedPose fp{
488 Eigen::Matrix4f::Identity(), _maskImageProviderRefFrame, _localRobot->getName()};
490 camInReportFrame = fp.toEigen();
491 }
492 {
493 FramedPose fp{
494 Eigen::Matrix4f::Identity(), _pointCloudProviderRefFrame, _localRobot->getName()};
496 pclInCamFrame = fp.toEigen();
497 }
498 }
499
500 {
501 typename pcl::PointCloud<PointType>::Ptr tmpCloud(new pcl::PointCloud<PointType>());
502 pcl::transformPointCloud(*inputCloud, *tmpCloud, pclInCamFrame);
503 tmpCloud.swap(inputCloud);
504 }
505
506 const auto r = std::minmax(_redLo, _redHi);
507 const auto g = std::minmax(_greenLo, _greenHi);
508 const auto b = std::minmax(_blueLo, _blueHi);
509 const CByteImage& img = *_maskImageProviderImageOwner.front();
510 std::uint64_t pointsInImage = 0;
511 std::uint64_t pointsOutOfImage = 0;
512 _maskedCloud.reset(new pcl::PointCloud<pcl::PointXYZRGBA>());
513 _inputCloud.reset(new pcl::PointCloud<pcl::PointXYZRGBA>());
514 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr unmaskedCloud(new pcl::PointCloud<pcl::PointXYZRGBA>());
515 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr outOfImageCloud(
516 new pcl::PointCloud<pcl::PointXYZRGBA>());
517 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr visuCloud(new pcl::PointCloud<pcl::PointXYZRGBA>());
518
519 float fx, fy;
520 std::tie(fx, fy) = maskImageProviderFocalLength();
521 for (const auto& point : inputCloud->points)
522 {
523 pcl::PointXYZRGBA p;
524 p.x = point.x;
525 p.y = point.y;
526 p.z = point.z;
527 p.a = 255;
528
529 static_assert(std::is_same<PointType, pcl::PointXYZRGBA>::value ||
530 std::is_same<PointType, pcl::PointXYZRGB>::value ||
531 std::is_same<PointType, pcl::PointXYZRGBL>::value ||
532 std::is_same<PointType, pcl::PointXYZRGBNormal>::value,
533 "");
534 // if constexpr(
535 // std::is_same_v<PointType, pcl::PointXYZRGBA> ||
536 // std::is_same_v<PointType, pcl::PointXYZRGB> ||
537 // std::is_same_v<PointType, pcl::PointXYZRGBL> ||
538 // std::is_same_v<PointType, pcl::PointXYZRGBNormal>
539 // )
540 {
541 p.r = point.r;
542 p.g = point.g;
543 p.b = point.b;
544 }
545 // else
546 // {
547 // p.r = p.g = p.b = 0;
548 // }
549 const auto uv = xyz2uv(p.x, p.y, p.z, fx, fy);
550 const std::int64_t u = uv.at(0);
551 const std::int64_t v = uv.at(1);
552 if (u < 0 || u >= img.width || v < 0 || v >= img.height)
553 {
554 ++pointsOutOfImage;
555 _inputCloud->push_back(p);
556 p.r = p.b = p.a = 255;
557 p.g = 0;
558 outOfImageCloud->push_back(p);
559 continue; // point out of image
560 }
561 ++pointsInImage;
562
563 p.r = img.pixels[(u + v * img.width) * 3 + 0];
564 p.g = img.pixels[(u + v * img.width) * 3 + 1];
565 p.b = img.pixels[(u + v * img.width) * 3 + 2];
566
567 _inputCloud->push_back(p);
568
569 const bool okR = r.first <= p.r && r.second >= p.r;
570 const bool okG = g.first <= p.g && g.second >= p.g;
571 const bool okB = b.first <= p.b && b.second >= p.b;
572
573 if (_maskMatchOneRangeInsteadOfAll ? okR || okG || okB : okR && okG && okB)
574 {
575 _maskedCloud->push_back(p);
576 }
577 else
578 {
579 unmaskedCloud->push_back(p);
580 }
581 visuCloud->push_back(p);
582 }
583
584 {
585 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr tmpCloud(new pcl::PointCloud<pcl::PointXYZRGBA>());
586
587 pcl::transformPointCloud(*_maskedCloud, *tmpCloud, camInReportFrame);
588 provideResultPointClouds(tmpCloud, getName() + InMaskSuff);
589
590 pcl::transformPointCloud(*unmaskedCloud, *tmpCloud, camInReportFrame);
591 provideResultPointClouds(tmpCloud, getName() + OutOfMaskSuff);
592
593 pcl::transformPointCloud(*outOfImageCloud, *tmpCloud, camInReportFrame);
594 provideResultPointClouds(tmpCloud, getName() + OutOfMaskImgSuff);
595
596 pcl::transformPointCloud(*visuCloud, *tmpCloud, camInReportFrame);
597 provideResultPointClouds(tmpCloud, getName() + MaskVisuSuff);
598
599 //reuse visuCloud
600 visuCloud->clear();
601 for (int u = 0; u < img.width; ++u)
602 {
603 for (int v = 0; v < img.height; ++v)
604 {
605 //visu the mastk at the image plane
606 auto xyz = uvz2xyz(u, v, (fx + fy) / 2, fx, fy);
607 pcl::PointXYZRGBA p;
608 p.x = xyz.at(0);
609 p.y = xyz.at(1);
610 p.z = xyz.at(2);
611 p.a = 255;
612 p.r = img.pixels[(u + v * img.width) * 3 + 0];
613 p.g = img.pixels[(u + v * img.width) * 3 + 1];
614 p.b = img.pixels[(u + v * img.width) * 3 + 2];
615 visuCloud->push_back(p);
616 }
617 }
618 pcl::transformPointCloud(*visuCloud, *tmpCloud, camInReportFrame);
619 provideResultPointClouds(tmpCloud, getName() + MaskAsCloudSuff);
620 }
621}
622
623namespace armarx
624{
625 std::string
627 {
628 return "MaskFilterPointCloudProcessor";
629 }
630
634} // namespace armarx
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Definition Decoupled.h:29
#define call_template_function(F)
#define M_PI
Definition MathTools.h:17
#define VAROUT(x)
constexpr T c
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
The FramedPose class.
Definition FramedPose.h:281
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
std::string getName() const
Retrieve name of object.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Brief description of class MaskFilterPointCloudProcessor.
visionx::PointCloudProviderInterfacePrx _pointCloudProvider
visionx::ImageProviderInterfacePrx _maskImageProvider
void onDisconnectPointCloudAndImageProcessor() override
Implement this method in the PointCloudAndImageProcessor in order to execute parts when the component...
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr _maskedCloud
void onConnectPointCloudAndImageProcessor() override
Implement this method in your PointCloudAndImageProcessor in order execute parts when the component i...
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
std::array< float, 3 > uvz2xyz(int u, int v, float z, float fx, float fy) const
std::vector< visionx::CByteImageUPtr > _maskImageProviderImageOwner
RobotStateComponentInterfacePrx _robotStateComponent
void onInitPointCloudAndImageProcessor() override
Setup the vision component.
visionx::PointCloudProviderInfo _pointCloudProviderInfo
std::pair< float, float > maskImageProviderFocalLength() const
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr _inputCloud
std::array< std::int64_t, 2 > xyz2uv(float x, float y, float z, float fx, float fy) const
static VirtualRobot::RobotPtr createLocalCloneFromFile(RobotStateComponentInterfacePrx robotStatePrx, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
This is a convenience function for createLocalClone, which automatically gets the filename from the R...
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
static bool synchronizeLocalCloneToTimestamp(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
Synchronizes a local robot to a robot state at timestamp.
void usingImageProvider(std::string name)
Registers a delayed topic subscription and a delayed provider proxy retrieval which all will be avail...
bool waitForImages(int milliseconds=1000)
Wait for new images.
ImageProviderInfo getImageProvider(std::string name, ImageType destinationImageType=eRgb, bool waitForProxy=false)
Select an ImageProvider.
int getImages(CByteImage **ppImages)
Poll images from provider.
void enableResultPointClouds(std::string resultProviderName="")
Enables visualization.
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
MetaPointCloudFormatPtr getPointCloudFormat(std::string providerName)
void usingPointCloudProvider(std::string providerName)
Registers a delayed topic subscription and a delayed provider proxy retrieval which will be available...
PointCloudProviderInfo getPointCloudProvider(std::string name, bool waitForProxy=false)
Select an PointCloudProvider.
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
void provideResultPointClouds(const PointCloudPtrT &pointClouds, std::string providerName="")
sends result PointClouds for visualization
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_CHECK_GREATER_EQUAL(lhs, rhs)
This macro evaluates whether lhs is greater or equal (>=) rhs and if it turns out to be false it will...
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
detail::IntSpinBoxBuilder makeIntSpinBox(std::string const &name)
detail::CheckBoxBuilder makeCheckBox(std::string const &name)
Definition BoolWidgets.h:27
detail::ComboBoxBuilder makeComboBox(std::string const &name)
detail::FloatSliderBuilder makeFloatSlider(std::string const &name)
detail::VBoxLayoutBuilder makeVBoxLayout(std::string const &name="")
detail::FloatSpinBoxBuilder makeFloatSpinBox(std::string const &name)
detail::LabelBuilder makeTextLabel(std::string const &text)
detail::HBoxLayoutBuilder makeHBoxLayout(std::string const &name="")
detail::IntSliderBuilder makeIntSlider(std::string const &name)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
SimplePeriodicTask(Ts...) -> SimplePeriodicTask< std::function< void(void)> >
std::vector< T > min(const std::vector< T > &v1, const std::vector< T > &v2)
CByteImage * createByteImage(const ImageFormatInfo &imageFormat, const ImageType imageType)
Creates a ByteImage for the destination type specified in the given imageProviderInfo.
Derived & addChild(WidgetPtr const &child)