Component.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 RobotComponents::ArmarXObjects::LaserScannerFeatureExtraction
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "Component.h"
24 
25 #include <algorithm>
26 #include <cmath>
27 #include <iterator>
28 #include <utility>
29 
30 #include <Eigen/Core>
31 #include <Eigen/Geometry>
32 
33 #include <IceUtil/Time.h>
34 
35 #include <SimoxUtility/color/Color.h>
36 #include <VirtualRobot/BoundingBox.h>
37 #include <VirtualRobot/MathTools.h>
38 
42 
44 
48 
49 #include "ArVizDrawer.h"
50 #include "FeatureExtractor.h"
51 #include "conversions/eigen.h"
52 #include "conversions/pcl_eigen.h"
53 
55 {
56 
57  const std::string LaserScannerFeatureExtraction::defaultName = "LaserScannerFeatureExtraction";
58 
61  {
64 
65  // Publish to a topic (passing the TopicListenerPrx).
66  def->topic(featuresTopic);
67 
68  // // Add an optionalproperty.
69  def->optional(
70  properties.taskPeriodMs, "p.taskPeriodMs", "Update rate of the running task.");
71 
72  def->optional(properties.robotHull.shape, "p.robotHull.shape", "Shape of the robot area.")
73  .map({std::make_pair("Rectangle", Properties::RobotHull::RECTANGLE),
74  std::make_pair("Circle", Properties::RobotHull::CIRCLE)});
75  def->optional(properties.robotHull.radius,
76  "p.robotHull.radius",
77  "The radius of the robot when using the circle shape.");
78  def->optional(
79  properties.robotHull.robotConvexHullMargin,
80  "p.robotHull.robotConvexHullMargin",
81  "Parameter to increase the robot's convex hull when using the rectangle shape.");
82 
83  def->optional(properties.cableFix.enabled,
84  "p.cableFix.enabled",
85  "Try to supress clusters belonging to the power supply cable.");
86  def->optional(properties.cableFix.cableAreaWidth,
87  "p.cableFix.cableAreaWidth",
88  "Width of the area where to search for the cable.");
89 
90  def->optional(
91  properties.cableFix.maxAreaTh,
92  "p.cableFix.maxAreaTh",
93  "The cable will only be removed if the cluster area is below this threshold.");
94 
95  def->optional(
96  properties.chainApproximationParams.distanceTh, "p.chainApproximation.distanceTh", "");
97  def->optional(properties.chainApproximationParams.maxIterations,
98  "p.chainApproximation.maxIterations",
99  "");
100 
101  def->optional(properties.scanClusteringParams.angleThreshold,
102  "p.scanClustering.angleThreshold",
103  "Angular distance between consecutive points in laser scan for clustering.");
104  def->optional(properties.scanClusteringParams.distanceThreshold,
105  "p.scanClustering.distanceThreshold",
106  "Radial distance between consecutive points in laser scan for clustering.");
107  def->optional(properties.scanClusteringParams.maxDistance,
108  "p.scanClustering.maxDistance",
109  "Maximum radius around sensors to detect clusters.");
110 
111  def->optional(properties.arviz.drawRawPoints,
112  "p.arviz.drawRawPoints",
113  "If true, the laser scans will be drawn.");
114 
115  def->optional(properties.arviz.visualizeSeparateFeatures,
116  "p.arviz.visualizeSeparateFeatures",
117  "If true, the features from each sensor will be drawn.");
118 
119  def->optional(properties.arviz.visualizeMergedFeatures,
120  "p.arviz.visualizeMergedFeatures",
121  "If true, the merged features from all sensors will be drawn.");
122 
123  return def;
124  }
125 
127  {
128  addPlugin(laserScannerReaderPlugin);
129  addPlugin(laserScannerFeatureWriterPlugin);
130  }
131 
132  void
134  {
135  // Topics and properties defined above are automagically registered.
136 
137  // Keep debug observer data until calling `sendDebugObserverBatch()`.
138  // (Requies the armarx::DebugObserverComponentPluginUser.)
139  // setDebugObserverBatchModeEnabled(true);
140  }
141 
142  void
144  {
145  ARMARX_INFO << "Connecting";
146 
147  frequencyReporterPublish = std::make_unique<FrequencyReporter>(
148  getDebugObserver(), "LaserScannerFeatureExtraction_publish");
149  frequencyReporterRun = std::make_unique<FrequencyReporter>(
150  getDebugObserver(), "LaserScannerFeatureExtraction_run");
151 
152  arVizDrawer = std::make_unique<ArVizDrawer>(getArvizClient());
153 
154  featureExtractor = std::make_unique<FeatureExtractor>(properties.scanClusteringParams,
155  properties.chainApproximationParams);
156 
157  ARMARX_INFO << "Connected";
158 
161  switch (properties.robotHull.shape)
162  {
164  {
165  // initialize robot platform convex hull
166  const Eigen::Vector2f ptFrontLeft = conversions::to2D(
167  robot->getRobotNode("PlatformCornerFrontLeft")->getPositionInRootFrame());
168  const Eigen::Vector2f ptFrontRight = conversions::to2D(
169  robot->getRobotNode("PlatformCornerFrontRight")->getPositionInRootFrame());
170  const Eigen::Vector2f ptBackRight = conversions::to2D(
171  robot->getRobotNode("PlatformCornerBackRight")->getPositionInRootFrame());
172  const Eigen::Vector2f ptBackLeft = conversions::to2D(
173  robot->getRobotNode("PlatformCornerBackLeft")->getPositionInRootFrame());
174 
175  const auto addMargin = [&](const Eigen::Vector2f& pt) -> Eigen::Vector2f
176  {
177  Eigen::Vector2f ptWithMargin = pt;
178  ptWithMargin.x() +=
179  std::copysignf(properties.robotHull.robotConvexHullMargin, pt.x());
180  ptWithMargin.y() +=
181  std::copysignf(properties.robotHull.robotConvexHullMargin, pt.y());
182 
183  return ptWithMargin;
184  };
185 
186  {
187  std::vector<Eigen::Vector2f> hullPoints;
188  hullPoints.push_back(addMargin(ptFrontLeft));
189  hullPoints.push_back(addMargin(ptFrontRight));
190  hullPoints.push_back(addMargin(ptBackRight));
191  hullPoints.push_back(addMargin(ptBackLeft));
192 
193  robotHull = VirtualRobot::MathTools::createConvexHull2D(hullPoints);
194  }
195 
196  // cable fix is only applicable when the robot shape is a rectangle
197  if (properties.cableFix.enabled)
198  {
199  // the cable area and the robot hull overlap slightly. as all points must be within one region,
200  // the cable area should start at approx. the position of the wheels
201 
202  std::vector<Eigen::Vector2f> cableAreaPoints;
203  cableAreaPoints.emplace_back(addMargin(ptBackRight) +
204  100 * Eigen::Vector2f::UnitY());
205  cableAreaPoints.emplace_back(addMargin(ptBackLeft) +
206  100 * Eigen::Vector2f::UnitY());
207  cableAreaPoints.emplace_back(addMargin(ptBackRight) -
208  properties.cableFix.cableAreaWidth *
209  Eigen::Vector2f::UnitY());
210  cableAreaPoints.emplace_back(addMargin(ptBackLeft) -
211  properties.cableFix.cableAreaWidth *
212  Eigen::Vector2f::UnitY());
213 
214  cableArea = VirtualRobot::MathTools::createConvexHull2D(cableAreaPoints);
215  }
216 
217  break;
218  }
220  {
221  // cable fix is not supported for circular robots
222  if (properties.cableFix.enabled)
223  {
224  ARMARX_ERROR << "Cable fix is not supported for circular robots!";
225  }
226  const Eigen::Vector2f root =
227  conversions::to2D(robot->getRootNode()->getPositionInRootFrame());
228  robotHull = root;
229  break;
230  }
231  }
232 
233 
235  this,
236  &LaserScannerFeatureExtraction::runPeriodically,
237  properties.taskPeriodMs,
238  false,
239  "runningTask");
240  task->start();
241  }
242 
244  toArmemFeature(const Features& features)
245  {
246  memory::LaserScannerFeature armemFeature;
247 
248  if (features.chain)
249  {
250  armemFeature.chain = features.chain.value();
251  }
252 
253  if (features.circle)
254  {
255  armemFeature.circle = features.circle.value();
256  }
257 
258  if (features.convexHull)
259  {
260  armemFeature.convexHull = features.convexHull->vertices;
261  }
262 
263  if (features.ellipsoid)
264  {
265  armemFeature.ellipsoid = features.ellipsoid.value();
266  }
267 
268  armemFeature.points = features.points;
269 
270  return armemFeature;
271  }
272 
274  toArmemFeatures(const std::vector<Features>& features,
275  const Eigen::Isometry3f& global_T_sensor,
276  const std::string& sensorFrame)
277  {
278  memory::LaserScannerFeatures armemFeatures;
279  armemFeatures.frame = sensorFrame;
280  armemFeatures.frameGlobalPose = global_T_sensor;
281 
282 
283  armemFeatures.features = simox::alg::apply(features, toArmemFeature);
284 
285  return armemFeatures;
286  }
287 
288  std::vector<Features>
289  removeInvalidFeatures(std::vector<Features> features)
290  {
291  const auto isInvalid = [](const Features& features) -> bool
292  {
293  if (features.points.size() < 2)
294  {
295  return true;
296  }
297 
298  if (not features.convexHull.has_value())
299  {
300  return true;
301  }
302 
303  // if(not features.circle.has_value())
304  // {
305  // return true;
306  // }
307 
308  // if(not features.ellipsoid.has_value())
309  // {
310  // return true;
311  // }
312 
313  return false;
314  };
315 
316 
317  features.erase(std::remove_if(features.begin(), features.end(), isInvalid), features.end());
318 
319  return features;
320  }
321 
322  std::vector<Features>
323  LaserScannerFeatureExtraction::onFeatures(const armem::laser_scans::LaserScanStamped& data,
324  const std::vector<Features>& featuresFromExtractor)
325  {
326  ARMARX_DEBUG << "Publishing data";
327 
328  // obtain sensor pose
330  robot, getRobotStateComponent(), data.header.timestamp.toMicroSecondsSinceEpoch());
331  const Eigen::Isometry3f global_T_sensor(
332  robot->getRobotNode(data.header.frame)->getGlobalPose());
333  const Eigen::Isometry3f robot_T_sensor(
334  robot->getRobotNode(data.header.frame)->getPoseInRootFrame());
335 
336  //Eigen::AlignedBox2f box;
337  //box.extend(pt1).extend(pt2).extend(pt3).extend(pt4);
338 
339  const auto transformPoints =
340  [](const std::vector<Eigen::Vector2f>& points, const Eigen::Isometry3f& tf)
341  {
342  std::vector<Eigen::Vector2f> out;
343  out.reserve(points.size());
344 
345  std::transform(points.begin(),
346  points.end(),
347  std::back_inserter(out),
348  [&tf](const auto& pt)
349  { return conversions::to2D(tf * conversions::to3D(pt)); });
350 
351  return out;
352  };
353 
354  const auto isPointInsideRobot = [&](const Eigen::Vector2f& pt) -> bool
355  {
356  if (std::holds_alternative<VirtualRobot::MathTools::ConvexHull2DPtr>(robotHull))
357  {
358  return VirtualRobot::MathTools::isInside(
359  pt, std::get<VirtualRobot::MathTools::ConvexHull2DPtr>(robotHull));
360  }
361  else if (std::holds_alternative<Eigen::Vector2f>(robotHull))
362  {
363  return (std::get<Eigen::Vector2f>(robotHull) - pt).norm() <
364  properties.robotHull.radius;
365  }
366  return false;
367  };
368  const auto isPointInsideCableArea = [&](const Eigen::Vector2f& pt) -> bool
369  { return VirtualRobot::MathTools::isInside(pt, cableArea); };
370  const auto isClusterInvalid = [&](const Features& features) -> bool
371  {
372  // either use convex hull (compact representation) or raw points as fallbacck
373  const auto points = [&]()
374  {
375  if (features.convexHull)
376  {
377  return transformPoints(features.convexHull->vertices, robot_T_sensor);
378  }
379 
380  return transformPoints(features.points, robot_T_sensor);
381  }();
382 
383  const bool allPointsInsideRobot =
384  std::all_of(points.begin(), points.end(), isPointInsideRobot);
385  if (allPointsInsideRobot)
386  {
387  return true;
388  }
389 
390  if (properties.cableFix.enabled)
391  {
392 
393  const bool allPointsInCableArea =
394  std::all_of(points.begin(), points.end(), isPointInsideCableArea);
395  if (allPointsInCableArea)
396  {
397  if (geometry::ConvexHull(points).area() < properties.cableFix.maxAreaTh)
398  {
399  return true;
400  }
401  }
402  }
403 
404  return false;
405  };
406 
407  const auto removeFeaturesOnRobotOrCable = [&](std::vector<Features> features)
408  {
409  features.erase(std::remove_if(features.begin(), features.end(), isClusterInvalid),
410  features.end());
411  return features;
412  };
413 
414  ARMARX_VERBOSE << featuresFromExtractor.size() << " features from extractor";
415 
416  const auto features = removeFeaturesOnRobotOrCable(featuresFromExtractor);
417  ARMARX_VERBOSE << features.size() << " features without cable region";
418 
419  const auto validFeatures = removeInvalidFeatures(features);
420  ARMARX_VERBOSE << validFeatures.size() << " valid features without cable region";
421 
422  const auto armemFeatures =
423  toArmemFeatures(validFeatures, global_T_sensor, data.header.frame);
424 
425  ARMARX_VERBOSE << "Reporting " << armemFeatures.features.size() << " features";
426 
427  // report the features
428  publishFeatures(armemFeatures, data.header.timestamp);
429 
430  if (properties.arviz.visualizeSeparateFeatures)
431  {
432  drawFeatures(
433  features, &data, data.header.frame, data.header.timestamp, global_T_sensor);
434  }
435 
436  return validFeatures;
437  }
438 
439  Throttler&
440  LaserScannerFeatureExtraction::getOrCreateThrottler(std::string frame)
441  {
442  const auto it = throttlers.find(frame);
443  if (it == throttlers.end())
444  {
445  throttlers.emplace(frame, Throttler(10.F));
446  }
447 
448  return throttlers.at(frame);
449  }
450 
451  void
452  LaserScannerFeatureExtraction::drawRobot(const armem::Time& timestamp)
453  {
454  // check if arviz should be triggered
455  if (getOrCreateThrottler(robot->getName()).check(timestamp))
456  {
457  const Eigen::Isometry3f global_T_robot(robot->getRootNode()->getGlobalPose());
458 
459  if (std::holds_alternative<VirtualRobot::MathTools::ConvexHull2DPtr>(robotHull))
460  {
461  VirtualRobot::MathTools::ConvexHull2DPtr& convexHullPtr =
462  std::get<VirtualRobot::MathTools::ConvexHull2DPtr>(robotHull);
463  if (convexHullPtr != nullptr)
464  {
465  arVizDrawer->draw("robot_convex_hull",
466  *convexHullPtr,
467  global_T_robot,
468  simox::Color::azure(255, 80));
469  }
470  }
471  else if (std::holds_alternative<Eigen::Vector2f>(robotHull))
472  {
473  Eigen::Vector2f& root = std::get<Eigen::Vector2f>(robotHull);
474  arVizDrawer->draw("robot_circle_hull",
475  Circle{root, properties.robotHull.radius},
476  global_T_robot,
477  simox::Color::azure(255, 80));
478  }
479 
480  if (cableArea != nullptr)
481  {
482  arVizDrawer->draw(
483  "cable_area", *cableArea, global_T_robot, simox::Color::blue(255, 80));
484  }
485  }
486  }
487 
488  void
489  LaserScannerFeatureExtraction::drawFeatures(
490  const std::vector<Features>& features,
491  const armem::laser_scans::LaserScanStamped* laserPoints,
492  const std::string frame,
493  const armem::Time& timestamp,
494  const Eigen::Isometry3f& global_T_sensor)
495  {
496  // check if arviz should be triggered
497  if (getOrCreateThrottler(frame).check(timestamp))
498  {
499  arVizDrawer->draw(features, frame, global_T_sensor);
500 
501  if (properties.arviz.drawRawPoints && laserPoints != nullptr)
502  {
503  arVizDrawer->draw(*laserPoints, global_T_sensor, simox::Color::magenta(255, 100));
504  }
505  }
506  }
507 
508  void
509  LaserScannerFeatureExtraction::publishFeatures(const memory::LaserScannerFeatures& features,
510  const armem::Time& timestamp)
511  {
512 
513  // store in memory
514  laserScannerFeatureWriterPlugin->get().store(features, getName(), timestamp);
515 
516  // legacy - topic
517  LineSegment2DChainSeq chains;
518  for (const auto& feature : features.features)
519  {
520  if (not feature.chain.empty())
521  {
522  LineSegment2DChain chain;
523  for (const auto& pt : feature.chain)
524  {
525  chain.push_back(
526  conversions::to2D(features.frameGlobalPose * conversions::to3D(pt)));
527  }
528  chains.push_back(chain);
529  }
530  }
531 
532  featuresTopic->reportExtractedLineSegments(chains);
533  }
534 
535  void
537  {
538  task->stop();
539  }
540 
541  void
543  {
544  }
545 
546  std::string
548  {
549  return defaultName;
550  }
551 
552  std::string
554  {
555  return defaultName;
556  }
557 
558  void
559  LaserScannerFeatureExtraction::runPeriodically()
560  {
561  const armem::laser_scans::client::Reader::Query laserScanQuery{
562  .agent = robot->getName(), .timeRange = std::nullopt, .sensorList = {}};
563 
564  const armem::laser_scans::client::Reader::Result laserScanResult =
565  laserScannerReaderPlugin->get().queryData(laserScanQuery);
566  ARMARX_CHECK_EQUAL(laserScanResult.status,
568  << laserScanResult.errorMessage;
569 
570  ARMARX_DEBUG << "Received laser scan data from " << laserScanResult.laserScans.size()
571  << " sensors";
572 
573  frequencyReporterRun->add(IceUtil::Time::now().toMicroSeconds());
574 
575  std::vector<FramedFeatures> allFeatures;
576  allFeatures.reserve(laserScanResult.laserScans.size());
577  armem::Time mostRecentTimestamp{0};
578 
579  for (const auto& scan : laserScanResult.laserScans)
580  {
581  mostRecentTimestamp = std::max(mostRecentTimestamp, scan.header.timestamp);
582 
583  // run clustering for every sensor
584  setDebugObserverDatafield(getDefaultName() + scan.header.frame, scan.data.size());
585  const auto features = featureExtractor->onData(scan);
586 
587  auto& framedFeatures = allFeatures.emplace_back();
588 
589  // onFeatures filters out some clusters (cable area, inside robot hull etc.), we only want to keep the filtered points
590  framedFeatures.features = onFeatures(scan, features);
591  framedFeatures.frame = scan.header.frame;
592  }
593 
594  if (!allFeatures.empty())
595  {
596  mergeFeatures(allFeatures, mostRecentTimestamp);
597  }
598 
599  // visualize robot with bounding box/cable area etc.
600  drawRobot(mostRecentTimestamp);
601 
602  // some debugobserver reporting
603  frequencyReporterPublish->add(IceUtil::Time::now().toMicroSeconds());
604  }
605 
606  void
607  LaserScannerFeatureExtraction::mergeFeatures(const std::vector<FramedFeatures>& framedFeatures,
608  const armem::Time& timestamp)
609  {
610  // convert features to global coordinate system
611  std::vector<Features> converted;
612  for (const auto& features : framedFeatures)
613  {
614  converted.reserve(converted.size() + features.features.size());
615  Eigen::Isometry3f global_T_frame(robot->getRobotNode(features.frame)->getGlobalPose());
616 
617  for (const auto& singleFeature : features.features)
618  {
619  converted.push_back(conversions::transformFeature(singleFeature, global_T_frame));
620  }
621  }
622 
623  // merge overlapping features
624  FeatureMerger merger{std::move(converted), properties.chainApproximationParams};
625  std::vector<Features> merged = merger.merge();
626 
627  // save merged features in another entity with name 'global'
628  std::string frame = "global";
629  const Eigen::Isometry3f global_T_global = Eigen::Isometry3f::Identity();
630 
631  const auto armemFeatures = toArmemFeatures(merged, global_T_global, frame);
632 
633  laserScannerFeatureWriterPlugin->get().store(armemFeatures, getName(), timestamp);
634 
635  setDebugObserverDatafield("numMergedClusters", merged.size());
636 
637  if (properties.arviz.visualizeMergedFeatures)
638  {
639  // visualize the features above the floor
640  auto global_T_vis = global_T_global;
641  global_T_vis.translation() = Eigen::Vector3f{0, 0, 20};
642  drawFeatures(merged, nullptr, frame, timestamp, global_T_vis);
643  }
644  }
645 
646  ARMARX_REGISTER_COMPONENT_EXECUTABLE(LaserScannerFeatureExtraction,
648 
649 } // namespace armarx::navigation::components::laser_scanner_feature_extraction
armarx::armem::laser_scans::client::Reader::Result::Success
@ Success
Definition: Reader.h:90
armarx::armem::laser_scans::LaserScanStamped
Definition: types.h:40
RemoteRobot.h
armarx::ArVizComponentPluginUser::getArvizClient
armarx::viz::Client & getArvizClient()
Definition: ArVizComponentPlugin.h:45
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
features.h
armarx::conversions::to3D
std::vector< Eigen::Vector3f > to3D(const std::vector< Eigen::Vector2f > &v)
Definition: eigen.cpp:8
armarx::navigation::memory::LaserScannerFeatures
Definition: types.h:62
armarx::armem::laser_scans::client::Reader::Result
Definition: Reader.h:80
geometry.h
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:553
armarx::navigation::components::laser_scanner_feature_extraction::Features
Definition: FeatureExtractor.h:44
armarx::RemoteRobot::synchronizeLocalClone
static bool synchronizeLocalClone(VirtualRobot::RobotPtr robot, RobotStateComponentInterfacePrx robotStatePrx)
Definition: RemoteRobot.cpp:448
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:547
DateTime.h
armarx::Throttler::check
bool check(const armarx::DateTime &timestamp) noexcept
Check if enough time has passed since this function last returned true.
Definition: Throttler.cpp:9
armarx::navigation::memory::LaserScannerFeature::ellipsoid
Ellipsoid ellipsoid
Definition: types.h:55
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::Properties::RobotHull::RECTANGLE
@ RECTANGLE
Definition: Component.h:167
Duration.h
armarx::navigation::components::laser_scanner_feature_extraction::Circle
memory::Circle Circle
Definition: FeatureExtractor.h:42
armarx::navigation::memory::LaserScannerFeature::points
Points points
Definition: types.h:59
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::DebugObserverComponentPluginUser::getDebugObserver
const DebugObserverInterfacePrx & getDebugObserver() const
Definition: DebugObserverComponentPlugin.cpp:113
armarx::RobotStateComponentPluginUser::getRobotStateComponent
const RobotStateComponentInterfacePrx & getRobotStateComponent() const
Definition: RobotStateComponentPlugin.cpp:317
FeatureMerger.h
armarx::navigation::components::laser_scanner_feature_extraction::Features::ellipsoid
std::optional< Ellipsoid > ellipsoid
Definition: FeatureExtractor.h:52
armarx::navigation::memory::LaserScannerFeatures::features
std::vector< LaserScannerFeature > features
Definition: types.h:68
armarx::navigation::components::laser_scanner_feature_extraction::toArmemFeatures
memory::LaserScannerFeatures toArmemFeatures(const std::vector< Features > &features, const Eigen::Isometry3f &global_T_sensor, const std::string &sensorFrame)
Definition: Component.cpp:274
armarx::navigation::components::laser_scanner_feature_extraction::Features::chain
std::optional< Chain > chain
Definition: FeatureExtractor.h:54
FeatureExtractor.h
armarx::navigation::memory::LaserScannerFeatures::frameGlobalPose
Eigen::Isometry3f frameGlobalPose
Definition: types.h:66
Component.h
armarx::navigation::memory::LaserScannerFeature::chain
Chain chain
Definition: types.h:57
armarx::navigation::components::laser_scanner_feature_extraction::ARMARX_REGISTER_COMPONENT_EXECUTABLE
ARMARX_REGISTER_COMPONENT_EXECUTABLE(LaserScannerFeatureExtraction, LaserScannerFeatureExtraction::GetDefaultName())
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:143
armarx::armem::laser_scans::client::Reader::Result::errorMessage
std::string errorMessage
Definition: Reader.h:93
armarx::conversions::to2D
Eigen::Vector2f to2D(const Eigen::Vector3f &v2)
Definition: eigen.h:32
armarx::conversions::transformFeature
Features transformFeature(const Features &feature, const Eigen::Isometry3f &transformation)
Definition: features.cpp:12
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::Properties::RobotHull::CIRCLE
@ CIRCLE
Definition: Component.h:168
pcl_eigen.h
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::LaserScannerFeatureExtraction
LaserScannerFeatureExtraction()
Definition: Component.cpp:126
armarx::armem::laser_scans::client::Reader::Query
Definition: Reader.h:69
armarx::armem::laser_scans::client::Reader::Result::status
enum armarx::armem::laser_scans::client::Reader::Result::Status status
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::onInitComponent
void onInitComponent() override
Definition: Component.cpp:133
max
T max(T t1, T t2)
Definition: gdiam.h:48
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::navigation::components::laser_scanner_feature_extraction::Features::convexHull
std::optional< VirtualRobot::MathTools::ConvexHull2D > convexHull
Definition: FeatureExtractor.h:49
armarx::navigation::components::laser_scanner_feature_extraction::LineSegment2DChainSeq
armarx::laser_scanner_feature_extraction::LineSegment2DChainSeq LineSegment2DChainSeq
Definition: Component.h:56
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:536
armarx::navigation::memory::LaserScannerFeature::circle
Circle circle
Definition: types.h:54
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::navigation::components::laser_scanner_feature_extraction::toArmemFeature
memory::LaserScannerFeature toArmemFeature(const Features &features)
Definition: Component.cpp:244
Decoupled.h
armarx::conversions::Features
armarx::navigation::components::laser_scanner_feature_extraction::Features Features
Definition: features.cpp:9
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::navigation::components::laser_scanner_feature_extraction::Features::points
Points points
Definition: FeatureExtractor.h:56
armarx::RemoteRobot::createLocalClone
VirtualRobot::RobotPtr createLocalClone()
Clones the structure of this remote robot to a local instance.
Definition: RemoteRobot.cpp:328
IceUtil::Handle
Definition: forward_declarations.h:29
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::navigation::memory::LaserScannerFeatures::frame
std::string frame
Definition: types.h:65
F
Definition: ExportDialogControllerTest.cpp:16
armarx::armem::laser_scans::client::Reader::Result::laserScans
std::vector< LaserScanStamped > laserScans
Definition: Reader.h:83
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::navigation::components::laser_scanner_feature_extraction::removeInvalidFeatures
std::vector< Features > removeInvalidFeatures(std::vector< Features > features)
Definition: Component.cpp:289
armarx::navigation::components::laser_scanner_feature_extraction::Features::circle
std::optional< Circle > circle
Definition: FeatureExtractor.h:51
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:60
armarx::navigation::memory::LaserScannerFeature
Definition: types.h:47
armarx::PeriodicTask
Definition: ArmarXManager.h:70
armarx::navigation::components::laser_scanner_feature_extraction::LineSegment2DChain
armarx::laser_scanner_feature_extraction::LineSegment2DChain LineSegment2DChain
Definition: Component.h:55
ArVizDrawer.h
ARMARX_CHECK_EQUAL
#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...
Definition: ExpressionException.h:130
armarx::navigation::components::laser_scanner_feature_extraction::LaserScannerFeatureExtraction::onExitComponent
void onExitComponent() override
Definition: Component.cpp:542
armarx::navigation::components::laser_scanner_feature_extraction
Definition: ArVizDrawer.cpp:28
armarx::armem::laser_scans::client::Reader::Query::agent
std::string agent
Definition: Reader.h:71
armarx::DebugObserverComponentPluginUser::setDebugObserverDatafield
void setDebugObserverDatafield(Ts &&...ts) const
Definition: DebugObserverComponentPlugin.h:97
armarx::navigation::memory::LaserScannerFeature::convexHull
Points convexHull
Definition: types.h:52