FakePointCloudProvider.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package VisionX::ArmarXObjects::FakePointCloudProvider
19  * @author Markus Grotz ( markus-grotz at web dot de )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #include "FakePointCloudProvider.h"
26 
27 // IVT
28 #include <Image/ByteImage.h>
29 #include <Image/ImageProcessor.h>
30 #include <Calibration/Calibration.h>
31 
32 #include <opencv2/opencv.hpp>
33 
34 
38 
40 
43 
46 
48 
49 #include <SimoxUtility/algorithm/string/string_tools.h>
50 
51 
52 using namespace armarx;
53 using namespace pcl;
54 
55 namespace visionx
56 {
57  FakePointCloudProviderPropertyDefinitions::FakePointCloudProviderPropertyDefinitions(std::string prefix) :
59  {
60  defineOptionalProperty<std::string>("pointCloudFileName", "VisionX/examples/point_clouds/",
61  "The point cloud to read. If directory, all *.pcd files of this and all subdirectories are read. \n"
62  "All point clouds are read in before the pointcloud providing starts.");
63 
64  defineOptionalProperty<bool>("rewind", true, "loop through the point clouds");
65  defineOptionalProperty<float>("scaleFactor", -1.0f, "scale point cloud. only applied if value is larger than zero");
66  defineOptionalProperty<Eigen::Vector2i>("dimensions", Eigen::Vector2i(640, 480), "")
67  .map("320x240", Eigen::Vector2i(320, 240))
68  .map("640x480", Eigen::Vector2i(640, 480))
69  .map("320x240", Eigen::Vector2i(320, 240))
70  .map("640x480", Eigen::Vector2i(640, 480))
71  .map("800x600", Eigen::Vector2i(800, 600))
72  .map("768x576", Eigen::Vector2i(768, 576))
73  .map("1024x768", Eigen::Vector2i(1024, 768))
74  .map("1024x1024", Eigen::Vector2i(1024, 1024))
75  .map("1280x960", Eigen::Vector2i(1280, 960))
76  .map("1600x1200", Eigen::Vector2i(1600, 1200));
77 
78  defineOptionalProperty<std::string>("depthCameraCalibrationFile", "", "Camera depth calibration file (YAML)");
79  defineOptionalProperty<std::string>("RGBCameraCalibrationFile", "", "Camera RGB calibration file (YAML)");
80 
81  defineOptionalProperty<std::string>("sourceFrameName", "",
82  "Assume point cloud was stored in this frame.");
83  defineOptionalProperty<std::string>("TargetFrameName", armarx::GlobalFrame,
84  "Coordinate frame in which point cloud will be transformed and provided.\n"
85  "If left empty, no transformation will be applied and source frame name\n"
86  "will be returned as reference frame.");
87 
88  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent",
89  "Name of the robot state component to use.");
90  defineOptionalProperty<bool>("RemoveNAN", true, "Remove NAN from point cloud");
91  defineOptionalProperty<std::string>("ProvidedPointCloudFormat", "XYZRGBA", "Format of the provided point cloud (XYZRGBA, XYZL, XYZRGBL)");
92  }
93 
95  {
96  return "FakePointCloudProvider";
97  }
98 
100  {
103  }
104 
106  {
109  //gui
110  createOrUpdateRemoteGuiTab(buildGui(), [this](RemoteGui::TabProxy & prx)
111  {
112  ARMARX_TRACE;
113  processGui(prx);
114  });
115  }
116 
118  {
121  }
122 
124  {
127  }
128 
130  {
131  getProperty(rewind, "rewind");
132  getProperty(pointCloudFileName, "pointCloudFileName");
133  getProperty(scaleFactor, "scaleFactor");
134  getProperty(sourceFrameName, "sourceFrameName");
135  getProperty(targetFrameName, "TargetFrameName");
136  getProperty(removeNAN, "RemoveNAN");
137 
138  getProperty(providedPointCloudFormat, "ProvidedPointCloudFormat");
139  ARMARX_INFO << "Providing point clouds in format " << providedPointCloudFormat << ".";
140 
141  getProperty(robotStateComponentName, "RobotStateComponentName");
142  if (!robotStateComponentName.empty())
143  {
144  usingProxy(robotStateComponentName);
145  }
146 
147  // Check invalid or dangerous configurations and warn early.
148  if (!(sourceFrameName.empty() && targetFrameName.empty()))
149  {
150  if (!sourceFrameName.empty() && !targetFrameName.empty() && robotStateComponentName.empty())
151  {
152  ARMARX_ERROR << "Source and target frames specified, but no RobotStateComponent is specified.\n"
153  "No transformation will be applied.";
154  }
155  else if (sourceFrameName.empty() && !targetFrameName.empty())
156  {
157  ARMARX_WARNING << "Target frame was specified (" << targetFrameName << "), but no source frame is specified.\n"
158  << "Did you set the property `sourceFrameName`? (No transformation will be applied.)";
159  }
160  else if (!sourceFrameName.empty() && targetFrameName.empty())
161  {
162  ARMARX_INFO << "Source frame was specified (" << sourceFrameName << "), but no target frame is specified.\n"
163  << "No transformation will be applied and source frame is returned as reference frame.";
164  }
165  }
166 
167 
168  if (!ArmarXDataPath::getAbsolutePath(pointCloudFileName, pointCloudFileName))
169  {
170  ARMARX_ERROR << "Could not find point cloud file in ArmarXDataPath: " << pointCloudFileName;
171  }
172 
173  // Loading each file
174  if (std::filesystem::is_directory(pointCloudFileName))
175  {
176  loadPointCloudDirectory(pointCloudFileName);
177  }
178  else
179  {
180  loadPointCloud(pointCloudFileName);
181  }
182 
183  if (pointClouds.empty())
184  {
185  ARMARX_FATAL << "Unable to load point cloud: " << pointCloudFileName;
186  throw LocalException("Unable to load point cloud");
187  }
188 
189  ARMARX_INFO << "Loaded " << pointClouds.size() << " point clouds.";
190 
191 
192  visionx::CameraParameters RGBCameraIntrinsics;
193  RGBCameraIntrinsics.focalLength.resize(2);
194  RGBCameraIntrinsics.principalPoint.resize(2);
195 
196  if (!getProperty<std::string>("RGBCameraCalibrationFile").getValue().empty() && !loadCalibrationFile(getProperty<std::string>("RGBCameraCalibrationFile").getValue(), RGBCameraIntrinsics))
197  {
198  ARMARX_WARNING << "Could not load rgb camera parameter file " << getProperty<std::string>("RGBCameraCalibrationFile").getValue() << " - using camera uncalibrated";
199  }
200 
201  visionx::CameraParameters depthCameraIntrinsics;
202  depthCameraIntrinsics.focalLength.resize(2);
203  depthCameraIntrinsics.principalPoint.resize(2);
204 
205  if (!getProperty<std::string>("depthCameraCalibrationFile").getValue().empty() && !loadCalibrationFile(getProperty<std::string>("depthCameraCalibrationFile").getValue(), depthCameraIntrinsics))
206  {
207  ARMARX_WARNING << "Could not load depth camera parameter file " << getProperty<std::string>("depthCameraCalibrationFile").getValue() << " - using camera uncalibrated";
208  }
209 
210  calibration.calibrationLeft = visionx::tools::createDefaultMonocularCalibration();
211  calibration.calibrationRight = visionx::tools::createDefaultMonocularCalibration();
212  calibration.calibrationLeft.cameraParam = RGBCameraIntrinsics;
213  calibration.calibrationRight.cameraParam = depthCameraIntrinsics;
214  }
215 
216  bool FakePointCloudProvider::loadPointCloud(const std::string& fileName)
217  {
218  if (simox::alg::ends_with(fileName, ".pcd") && std::filesystem::is_regular_file(fileName))
219  {
220  pcl::PCLPointCloud2Ptr cloudptr(new pcl::PCLPointCloud2());
221  ARMARX_INFO << "Loading: " << fileName;
222 
223  if (io::loadPCDFile(fileName.c_str(), *cloudptr) == -1)
224  {
225  ARMARX_WARNING << "Unable to load point cloud from file " << fileName;
226  return false;
227  }
228  else
229  {
230  pointClouds.push_back(cloudptr);
231  return true;
232  }
233  }
234 
235  return false;
236  }
237 
238  bool FakePointCloudProvider::loadPointCloudDirectory(const std::string& directoryName)
239  {
240  // reading file names
241  std::vector<std::string> fileNames;
242 
243  for (std::filesystem::recursive_directory_iterator dir(directoryName), end;
244  dir != end && getState() < eManagedIceObjectExiting; ++dir)
245  {
246  // Search for all *.pcd files
247  if (dir->path().extension() == ".pcd")
248  {
249  fileNames.push_back(dir->path().string());
250  }
251  }
252 
253  ARMARX_INFO << "In total " << fileNames.size() << " point clouds found.";
254 
255  // Sorting file names and loading them.
256  std::sort(fileNames.begin(), fileNames.end());
257 
258  for (std::size_t f = 0; f < fileNames.size(); f++)
259  {
260  ARMARX_INFO << " File " << f << " / " << fileNames.size() << " is being loaded... " << fileNames[f];
261  try
262  {
263  loadPointCloud(fileNames[f]);
264  }
265  catch (...)
266  {
267  ARMARX_WARNING << "Loading pointcloud '" << fileNames[f] << "' failed: " << armarx::GetHandledExceptionString();
268  }
269  }
270 
271  return true;
272  }
273 
275  {
276  pointClouds.clear();
277  }
278 
280  {
281  MetaPointCloudFormatPtr format = new MetaPointCloudFormat();
282 
283  if (providedPointCloudFormat == "XYZL")
284  {
285  format->type = PointContentType::eLabeledPoints;
286  }
287  else if (providedPointCloudFormat == "XYZRGBL")
288  {
289  format->type = PointContentType::eColoredLabeledPoints;
290  }
291  else
292  {
293  format->type = PointContentType::eColoredPoints;
294  }
295 
296  format->capacity = static_cast<Ice::Int>(
297  640 * 480 * visionx::tools::getBytesPerPoint(format->type) * 50);
298  format->size = format->capacity;
299  return format;
300  }
301 
303  {
304  Eigen::Vector2i dimensions = getProperty<Eigen::Vector2i>("dimensions");
305  setImageFormat(visionx::ImageDimension(dimensions(0), dimensions(1)), visionx::eRgb);
306  setNumberImages(1);
307  rgbImages = new CByteImage*[1];
308  rgbImages[0] = new CByteImage(dimensions(0), dimensions(1), CByteImage::eRGB24);
309  ::ImageProcessor::Zero(rgbImages[0]);
310 
311  counter = 0;
312  }
313 
315  {
316  (void) _frameRate; // Unused.
317  if (!robotStateComponentName.empty())
318  {
319  getProxy(robotStateComponent, robotStateComponentName);
320  if (!robotStateComponent)
321  {
322  ARMARX_ERROR << "Failed to obtain robot state component.";
323  return;
324  }
325 
326  localRobot = armarx::RemoteRobot::createLocalClone(robotStateComponent);
327  }
328  }
329 
331  {
332  }
333 
335  {
336  pcl::PCLPointCloud2Ptr cloudptr;
337 
338  {
339  std::scoped_lock lock(pointCloudMutex);
340 
341  if (rewind && static_cast<size_t>(counter.load()) >= pointClouds.size())
342  {
343  counter = 0;
344  }
345 
346  cloudptr = pointClouds.at(counter);
347  }
348 
349  // Provide point cloud in configured format
350  if (providedPointCloudFormat == "XYZRGBA")
351  {
352  return processAndProvide<pcl::PointXYZRGBA>(cloudptr);
353  }
354  else if (providedPointCloudFormat == "XYZL")
355  {
356  return processAndProvide<pcl::PointXYZL>(cloudptr);
357  }
358  else if (providedPointCloudFormat == "XYZRGBL")
359  {
360  return processAndProvide<pcl::PointXYZRGBL>(cloudptr);
361  }
362  else
363  {
364  ARMARX_ERROR << "Could not provide point cloud, because format '" << providedPointCloudFormat << "' is unknown";
365  return false;
366  }
367  }
368 
369  bool FakePointCloudProvider::loadCalibrationFile(std::string fileName, visionx::CameraParameters& calibration)
370  {
371  ArmarXDataPath::getAbsolutePath(fileName, fileName, {}, false);
372  cv::FileStorage fs(fileName, cv::FileStorage::READ);
373 
374  if (!fs.isOpened())
375  {
376  return false;
377  }
378 
379  std::string cameraName = fs["camera_name"];
380  ARMARX_LOG << "loading calibration file for " << cameraName;
381 
382 
383  Eigen::Vector2i dimensions = getProperty<Eigen::Vector2i>("dimensions").getValue();
384  int imageWidth = fs["image_width"];
385  int imageHeight = fs["image_height"];
386 
387  if (imageWidth != dimensions(0) || imageHeight != dimensions(1))
388  {
389  ARMARX_ERROR << "invalid camera size";
390  return false;
391  }
392 
393  cv::Mat cameraMatrix, distCoeffs;
394 
395  fs["camera_matrix"] >> cameraMatrix;
396  fs["distortion_coefficients:"] >> distCoeffs;
397 
398  for (int i = 0; i < 5; i++)
399  {
400  calibration.distortion[static_cast<std::size_t>(i)] = distCoeffs.at<float>(0, i);
401  }
402 
403  calibration.focalLength[0] = cameraMatrix.at<float>(0, 0);
404  calibration.focalLength[1] = cameraMatrix.at<float>(1, 1);
405 
406  calibration.principalPoint[0] = cameraMatrix.at<float>(2, 1);
407  calibration.principalPoint[1] = cameraMatrix.at<float>(2, 2);
408 
409  return true;
410  }
411 
413  {
415  }
416 
417  void FakePointCloudProvider::setPointCloudFilename(const std::string& filename, const Ice::Current&)
418  {
419  std::scoped_lock lock(pointCloudMutex);
420 
421  ARMARX_INFO << "Changing point cloud filename to: " << filename;
422 
423  pointClouds.clear();
424  loadPointCloud(filename);
425  }
426 
428  {
429  return true;
430  }
431 
432  template<typename PointT>
433  bool FakePointCloudProvider::processAndProvide(const PCLPointCloud2Ptr& pointCloud)
434  {
435  using PointCloudPtrT = typename pcl::PointCloud<PointT>::Ptr;
436 
437  PointCloudPtrT cloudptr(new pcl::PointCloud<PointT>());
438  pcl::fromPCLPointCloud2(*pointCloud, *cloudptr);
439 
440  if (cloudptr->isOrganized())
441  {
442  processRGBImage(pointCloud);
443  }
444 
445  PointCloudPtrT resultCloudPtr(new pcl::PointCloud<PointT>());
446 
447  if (scaleFactor > 0)
448  {
449  Eigen::Affine3f transform(Eigen::Scaling(scaleFactor));
450  pcl::transformPointCloud(*cloudptr, *resultCloudPtr, transform);
451  }
452  else
453  {
454  // Copy initial point cloud for possibly applying a second transformation
455  pcl::copyPointCloud(*cloudptr, *resultCloudPtr);
456  }
457 
458  const IceUtil::Time time = TimeUtil::GetTime();
459  resultCloudPtr->header.stamp = static_cast<uint64_t>(time.toMicroSeconds());
460 
461  if (!sourceFrameName.empty() || !targetFrameName.empty())
462  {
463  if (!sourceFrameName.empty() && !targetFrameName.empty())
464  {
465  // Assume point cloud was stored in source frame and transform to target frame.
466  if (localRobot)
467  {
469  localRobot, robotStateComponent, time.toMicroSeconds());
470  FramedPointCloud framedPointCloud(resultCloudPtr, sourceFrameName);
471  framedPointCloud.changeFrame(targetFrameName, localRobot);
472  }
473  else
474  {
475  // This was already logged in the onInit().
476  // ARMARX_ERROR << "Source and target frames specified, but no RobotStateComponent available.\n"
477  // "No transformation is applied.";
478  }
479  }
480  else if (sourceFrameName.empty())
481  {
482  // This was already logged in the onInit().
483  // ARMARX_WARNING << "Target frame was specified (" << targetFrameName << "), but no source frame is specified.\n"
484  // << "Did you set the property `sourceFrameName`? (No transformation is applied.)";
485  }
486  else if (targetFrameName.empty())
487  {
488  // This was already logged in the onInit().
489  // ARMARX_INFO << "Source frame was specified (" << sourceFrameName << "), but no target frame is specified.\n"
490  // << "No transformation is applied and source frame is returned as reference frame.";
491  }
492  }
493 
494 
495  if (removeNAN)
496  {
497  std::vector<int> indices;
498  pcl::removeNaNFromPointCloud(*resultCloudPtr, *resultCloudPtr, indices);
499  }
500 
501  ARMARX_VERBOSE << deactivateSpam() << "Providing point cloud of size " << resultCloudPtr->points.size();
502  providePointCloud(resultCloudPtr);
503  provideImages(rgbImages);
504 
505  if (freezeImage)
506  {
507  counter = freezeImageIdx.load();
508  }
509  else
510  {
511  ++counter;
512  }
513  return true;
514  }
515 
516  bool FakePointCloudProvider::processRGBImage(const PCLPointCloud2Ptr& pointCloud)
517  {
518  pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudptr(new pcl::PointCloud<pcl::PointXYZRGB>());
519  pcl::fromPCLPointCloud2(*pointCloud, *cloudptr);
520 
521  if (!cloudptr->isOrganized())
522  {
523  ARMARX_WARNING << deactivateSpam(10) << "The point cloud is not organized, so no RGB image is generated";
524  return false;
525  }
526 
527  if (static_cast<int>(cloudptr->width) != rgbImages[0]->width
528  || static_cast<int>(cloudptr->height) != rgbImages[0]->height)
529  {
530  ARMARX_WARNING << "Dimensions of point cloud and image do not match, so no RGB image is generated";
531  return false;
532  }
533 
534  ::ImageProcessor::Zero(rgbImages[0]);
535  const int width = static_cast<int>(cloudptr->width);
536  const int height = static_cast<int>(cloudptr->height);
537 
538  for (int i = 0; i < height; i++)
539  {
540  for (int j = 0; j < width; j++)
541  {
542  pcl::PointXYZRGB& point = cloudptr->at(static_cast<std::size_t>(i * width + j));
543  rgbImages[0]->pixels[3 * (i * width + j) + 0] = point.r;
544  rgbImages[0]->pixels[3 * (i * width + j) + 1] = point.g;
545  rgbImages[0]->pixels[3 * (i * width + j) + 2] = point.b;
546  }
547  }
548 
549  return true;
550  }
551 
553  {
554  for (std::size_t i = 0; i < 1; i++)
555  {
556  delete rgbImages[i];
557  }
558 
559  delete [] rgbImages;
560  }
561 
562  StereoCalibration FakePointCloudProvider::getStereoCalibration(const Ice::Current&)
563  {
564  return calibration;
565  }
566 
568  {
569  return true;
570  }
571 
572  std::string FakePointCloudProvider::getReferenceFrame(const Ice::Current&)
573  {
574  return !targetFrameName.empty() ? targetFrameName : sourceFrameName;
575  }
576 
577  RemoteGui::WidgetPtr FakePointCloudProvider::buildGui()
578  {
579  ARMARX_TRACE;
581  .addChild(RemoteGui::makeCheckBox("rewind").value(rewind).label("rewind"), 3)
582 
583  .addChild(RemoteGui::makeCheckBox("removeNAN").value(removeNAN).label("removeNAN"), 3)
584 
585  .addTextLabel("scaleFactor")
586  .addChild(RemoteGui::makeFloatSpinBox("scaleFactor").minmax(0, 10000).steps(10000).decimals(3), 2)
587 
588  .addChild(RemoteGui::makeCheckBox("freezeImage").value(freezeImage).label("freezeImage"))
589  .addChild(RemoteGui::makeIntSpinBox("freezeImageIdx").minmax(0, pointClouds.size() - 1))
590  .addTextLabel(" / " + std::to_string(pointClouds.size() - 1));
591  }
592 
593  void FakePointCloudProvider::processGui(armarx::RemoteGui::TabProxy& prx)
594  {
595  ARMARX_TRACE;
596  prx.receiveUpdates();
597  prx.getValue(rewind, "rewind");
598  prx.getValue(removeNAN, "removeNAN");
599  prx.getValue(scaleFactor, "scaleFactor");
600  prx.getValue(freezeImage, "freezeImage");
601  if (freezeImage)
602  {
603  prx.getValue(freezeImageIdx, "freezeImageIdx");
604  }
605  else
606  {
607  prx.setValue(counter, "freezeImageIdx");
608  }
609  prx.sendUpdates();
610  }
611 }
visionx::FakePointCloudProvider::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: FakePointCloudProvider.cpp:123
RemoteRobot.h
pcl
Definition: pcl_point_operators.cpp:4
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
visionx::PointCloudProvider::onConnectComponent
void onConnectComponent() override
Definition: PointCloudProvider.cpp:77
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::FakePointCloudProviderPropertyDefinitions
Definition: FakePointCloudProvider.h:56
armarx::GlobalFrame
const std::string GlobalFrame
Definition: FramedPose.h:62
FramedPointCloud.h
visionx::FakePointCloudProvider::onExitImageProvider
void onExitImageProvider() override
Definition: FakePointCloudProvider.cpp:552
armarx::ManagedIceObject::getState
int getState() const
Retrieve current state of the ManagedIceObject.
Definition: ManagedIceObject.cpp:725
visionx::ImageProvider::onExitComponent
void onExitComponent() override
Definition: ImageProvider.cpp:152
visionx::FakePointCloudProvider::onInitImageProvider
void onInitImageProvider() override
Definition: FakePointCloudProvider.cpp:302
armarx::RemoteGui::detail::SimpleGridLayoutBuilder::addChild
SimpleGridLayoutBuilder & addChild(WidgetPtr const &child, int colspan)
Definition: LayoutWidgets.h:121
visionx::ImageProvider::setImageFormat
void setImageFormat(ImageDimension imageDimension, ImageType imageType, BayerPatternType bayerPatternType=visionx::eBayerPatternRg)
Sets the image basic format data.
Definition: ImageProvider.cpp:275
visionx::FakePointCloudProvider::onStopCapture
void onStopCapture() override
Definition: FakePointCloudProvider.cpp:330
visionx::FakePointCloudProvider::onExitCapturingPointCloudProvider
void onExitCapturingPointCloudProvider() override
Definition: FakePointCloudProvider.cpp:274
armarx::RemoteGui::makeSimpleGridLayout
detail::SimpleGridLayoutBuilder makeSimpleGridLayout(std::string const &name="")
Definition: LayoutWidgets.h:235
visionx::PointCloudProvider::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: PointCloudProvider.cpp:95
visionx::PointCloudProvider::onExitComponent
void onExitComponent() override
Definition: PointCloudProvider.cpp:106
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
ARMARX_FATAL
#define ARMARX_FATAL
Definition: Logging.h:192
armarx::WidgetDescription::makeFloatSpinBox
FloatSpinBoxPtr makeFloatSpinBox(std::string name, float min, float max, float defaultValue, int steps, int decimals)
Definition: DefaultWidgetDescriptions.cpp:172
visionx::ImageProvider::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ImageProvider.cpp:141
armarx::RemoteGui::TabProxy::setValue
void setValue(const T &val, std::string const &name)
Definition: WidgetProxy.h:180
visionx::FakePointCloudProvider::setPointCloudFilename
void setPointCloudFilename(const std::string &filename, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FakePointCloudProvider.cpp:417
armarx::RemoteGui::TabProxy
Definition: WidgetProxy.h:17
armarx::GetHandledExceptionString
std::string GetHandledExceptionString()
Definition: Exception.cpp:147
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::RemoteGui::TabProxy::receiveUpdates
void receiveUpdates()
Definition: WidgetProxy.h:131
visionx::FakePointCloudProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: FakePointCloudProvider.cpp:412
pcl::graph::indices
pcl::PointIndices::Ptr indices(const PCG &g)
Retrieve the indices of the points of the point cloud stored in a point cloud graph that actually bel...
Definition: point_cloud_graph.h:737
visionx::FakePointCloudProvider::hasSharedMemorySupport
bool hasSharedMemorySupport(const Ice::Current &=Ice::emptyCurrent) override
Definition: FakePointCloudProvider.cpp:427
FramedPose.h
visionx::FakePointCloudProvider::getStereoCalibration
StereoCalibration getStereoCalibration(const Ice::Current &=Ice::emptyCurrent) override
Definition: FakePointCloudProvider.cpp:562
visionx::CapturingPointCloudProviderPropertyDefinitions
Definition: CapturingPointCloudProvider.h:38
RemoteGui.h
visionx::PointCloudProvider::onInitComponent
void onInitComponent() override
Definition: PointCloudProvider.cpp:59
filename
std::string filename
Definition: VisualizationRobot.cpp:83
FakePointCloudProvider.h
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::RemoteGui::detail::SimpleGridLayoutBuilder::addTextLabel
SimpleGridLayoutBuilder & addTextLabel(std::string const &text, int colspan)
Definition: LayoutWidgets.h:130
visionx::FramedPointCloud::changeFrame
void changeFrame(const std::string &newFrame, const VirtualRobot::RobotPtr &robot)
Transform the point cloud from the current frame to the new frame using the given reference robot.
Definition: FramedPointCloud.h:92
visionx::ImageProvider::provideImages
void provideImages(void **inputBuffers, const IceUtil::Time &imageTimestamp=IceUtil::Time())
send images raw.
Definition: ImageProvider.cpp:319
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
ARMARX_LOG
#define ARMARX_LOG
Definition: Logging.h:163
armarx::WidgetDescription::makeIntSpinBox
IntSpinBoxPtr makeIntSpinBox(std::string name, int min, int max, int defaultValue)
Definition: DefaultWidgetDescriptions.cpp:162
visionx::FramedPointCloud
A point cloud which keeps track of its reference coordinate frame and allows changing frames using ar...
Definition: PointCloudFilter.h:59
armarx::WidgetDescription::WidgetPtr
::IceInternal::Handle<::armarx::WidgetDescription::Widget > WidgetPtr
Definition: NJointControllerBase.h:66
visionx::ImageProvider::setNumberImages
void setNumberImages(int numberImages)
Sets the number of images on each capture.
Definition: ImageProvider.cpp:313
armarx::RemoteGui::TabProxy::getValue
ValueProxy< T > getValue(std::string const &name)
Definition: WidgetProxy.h:161
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
CMakePackageFinder.h
visionx::PointCloudProvider::providePointCloud
void providePointCloud(PointCloudPtrT pointCloudPtr)
offer the new point cloud.
Definition: PointCloudProvider.h:122
visionx::ImageProvider::onConnectComponent
void onConnectComponent() override
Definition: ImageProvider.cpp:104
TimeUtil.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::PropertyUser::getProperty
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
Definition: PropertyUser.h:179
armarx::RemoteRobot::createLocalClone
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
Definition: RemoteRobot.cpp:328
visionx::FakePointCloudProvider::onStartCapture
void onStartCapture(float frameRate) override
Definition: FakePointCloudProvider.cpp:314
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::RemoteGui::detail::SimpleGridLayoutBuilder::cols
SimpleGridLayoutBuilder & cols(int n)
Definition: LayoutWidgets.h:108
visionx::ImageProvider::onInitComponent
void onInitComponent() override
Definition: ImageProvider.cpp:88
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:315
armarx::RemoteRobot::synchronizeLocalCloneToTimestamp
static bool synchronizeLocalCloneToTimestamp(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx, Ice::Long timestamp)
Synchronizes a local robot to a robot state at timestamp.
Definition: RemoteRobot.cpp:487
armarx::WidgetDescription::makeCheckBox
CheckBoxPtr makeCheckBox(std::string name, bool defaultValue, std::string label)
Definition: DefaultWidgetDescriptions.cpp:145
armarx::ends_with
bool ends_with(const std::string &haystack, const std::string &needle)
Definition: StringHelpers.cpp:50
visionx::FakePointCloudProvider::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: FakePointCloudProvider.cpp:105
ImageUtil.h
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
armarx::RemoteGui::TabProxy::sendUpdates
void sendUpdates()
Definition: WidgetProxy.h:146
visionx::tools::getBytesPerPoint
size_t getBytesPerPoint(visionx::PointContentType pointContent)
Definition: PointCloudConversions.cpp:64
visionx::FakePointCloudProvider::onInitCapturingPointCloudProvider
void onInitCapturingPointCloudProvider() override
Definition: FakePointCloudProvider.cpp:129
armarx::Logging::deactivateSpam
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
Definition: Logging.cpp:92
visionx::FakePointCloudProvider::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: FakePointCloudProvider.cpp:117
visionx::FakePointCloudProvider::getDefaultPointCloudFormat
MetaPointCloudFormatPtr getDefaultPointCloudFormat() override
default point cloud format used to initialize shared memory
Definition: FakePointCloudProvider.cpp:279
TypeMapping.h
armarx::RemoteGuiComponentPluginUser::createOrUpdateRemoteGuiTab
void createOrUpdateRemoteGuiTab(Ts &&...ts)
Definition: RemoteGuiComponentPlugin.h:255
visionx::FakePointCloudProvider::getImagesAreUndistorted
bool getImagesAreUndistorted(const Ice::Current &=Ice::emptyCurrent) override
Definition: FakePointCloudProvider.cpp:567
visionx::FakePointCloudProvider::getReferenceFrame
std::string getReferenceFrame(const Ice::Current &=Ice::emptyCurrent) override
Definition: FakePointCloudProvider.cpp:572
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
visionx::FakePointCloudProvider::getDefaultName
std::string getDefaultName() const override
Definition: FakePointCloudProvider.cpp:94
visionx::FakePointCloudProvider::doCapture
bool doCapture() override
Definition: FakePointCloudProvider.cpp:334
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::ManagedIceObject::getProxy
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Definition: ManagedIceObject.cpp:393
ArmarXDataPath.h
visionx::tools::createDefaultMonocularCalibration
MonocularCalibration createDefaultMonocularCalibration()
Creates a MonocularCalibration with all parameters set to a neutral value.
Definition: ImageUtil.cpp:237
visionx::FakePointCloudProvider::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: FakePointCloudProvider.cpp:99
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28