LaserScannerSimulation.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 ArmarXSimulation::ArmarXObjects::LaserScannerSimulation
17  * @author Fabian Paus ( fabian dot paus at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "LaserScannerSimulation.h"
24 
25 #include <chrono>
26 #include <cmath>
27 #include <cstddef>
28 #include <memory>
29 
30 #include <Eigen/Geometry>
31 
32 #include <SimoxUtility/shapes/AxisAlignedBoundingBox.h>
33 #include <SimoxUtility/shapes/OrientedBox.h>
34 #include <VirtualRobot/BoundingBox.h>
35 #include <VirtualRobot/Robot.h>
36 #include <VirtualRobot/SceneObjectSet.h>
37 #include <VirtualRobot/VirtualRobot.h>
38 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
39 #include <VirtualRobot/Visualization/VisualizationFactory.h>
40 #include <VirtualRobot/CollisionDetection/CollisionModel.h>
41 #include <VirtualRobot/CollisionDetection/CollisionChecker.h>
42 
46 #include "ArmarXCore/core/time.h"
47 
49 
50 #include "ArVizDrawer.h"
51 
52 
54 {
55 
56  static std::size_t nextMultipleOf(std::size_t value, std::size_t multiple)
57  {
58  if (multiple == 0)
59  {
60  return value;
61  }
62 
63  std::size_t remainder = value % multiple;
64  if (remainder == 0)
65  {
66  return value;
67  }
68 
69  return value + multiple - remainder;
70  }
71 
72  static std::vector<std::string> splitProperty(Property<std::string> prop)
73  {
74  std::string propString(prop.getValue());
75  std::vector<std::string> result = Split(propString, ",");
76  return result;
77  }
78 
80 
81  GridDimension LaserScannerSimulation::calculateGridDimension(
82  const std::vector<VirtualRobot::BoundingBox>& boundingBoxes) const
83  {
85  for (const auto& boundingBox : boundingBoxes)
86  {
87  box.expand_to(boundingBox.getMin());
88  box.expand_to(boundingBox.getMax());
89  }
90 
91  const auto extents = box.extents();
92 
93  std::size_t gridSizeX = static_cast<std::size_t>(std::ceil(extents.x() / gridCellSize));
94  gridSizeX = nextMultipleOf(gridSizeX, sizeof(std::size_t) * CHAR_BIT);
95 
96  std::size_t gridSizeY = static_cast<std::size_t>(std::ceil(extents.y() / gridCellSize));
97  gridSizeY = nextMultipleOf(gridSizeY, sizeof(std::size_t) * CHAR_BIT);
98 
99  return {.originX = box.min_x(),
100  .originY = box.min_y(),
101  .sizeX = std::max<std::size_t>(gridSizeX, 1),
102  .sizeY = std::max<std::size_t>(gridSizeY, 1)};
103  }
104 
105  VirtualRobot::SceneObjectSetPtr LaserScannerSimulation::getCollisionObjects(
106  const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects) const
107  {
108  VirtualRobot::SceneObjectSetPtr objects(new VirtualRobot::SceneObjectSet());
109 
110  for (auto& object : sceneObjects)
111  {
112  VirtualRobot::Robot* robot = dynamic_cast<VirtualRobot::Robot*>(object.get());
113  if (robot == nullptr) // standard scene object
114  {
115  objects->addSceneObject(object);
116  }
117  else // passive robot
118  {
119  for (const auto& rns : robot->getRobotNodeSets())
120  {
121  objects->addSceneObjects(rns);
122  }
123  }
124  }
125 
126  return objects;
127  }
128 
129  GridDimension LaserScannerSimulation::calculateGridDimension(
130  const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects) const
131  {
132  VirtualRobot::SceneObjectSetPtr objectSet(new VirtualRobot::SceneObjectSet());
133 
134  for (auto& object : sceneObjects)
135  {
136  VirtualRobot::Robot* robot = dynamic_cast<VirtualRobot::Robot*>(object.get());
137  if (robot == nullptr) // standard scene object
138  {
139  objectSet->addSceneObject(object);
140  }
141  else // passive robot
142  {
143  // for (const auto rns : robot->getRobotNodeSets())
144  // {
145  // objects->addSceneObjects(rns);
146  // }
147  objectSet->addSceneObject(object); // This is not working properly
148  }
149  }
150 
151  // Create a occupancy grid
152  return calculateGridDimension(objectSet);
153  }
154 
155  std::vector<VirtualRobot::BoundingBox>
156  LaserScannerSimulation::boundingBoxes(VirtualRobot::SceneObjectSetPtr const& objects) const
157  {
158  std::vector<VirtualRobot::BoundingBox> objectBoudingBoxes;
159 
160  for (unsigned int objIndex = 0; objIndex < objects->getSize(); ++objIndex)
161  {
162  VirtualRobot::SceneObjectPtr object = objects->getSceneObject(objIndex);
163 
164  VirtualRobot::Robot* robot = dynamic_cast<VirtualRobot::Robot*>(object.get());
165  if (robot == nullptr) // standard scene object
166  {
167  objectBoudingBoxes.push_back(object->getCollisionModel()->getBoundingBox());
168  }
169  else // passive robot
170  {
171  for (const auto& collisionModel : robot->getCollisionModels())
172  {
173  if (collisionModel->getCollisionModelImplementation()->getPQPModel())
174  {
175  objectBoudingBoxes.push_back(collisionModel->getBoundingBox());
176  }
177  }
178  }
179  }
180 
181  return objectBoudingBoxes;
182  }
183 
184  GridDimension
185  LaserScannerSimulation::calculateGridDimension(VirtualRobot::SceneObjectSetPtr const& objects) const
186  {
187  if (objects->getSize() == 0)
188  {
189  return {.originX = 0.0F, .originY = 0.0F, .sizeX = 1, .sizeY = 1};
190  }
191 
192  const auto objectBoundingBoxes = boundingBoxes(objects);
193  ARMARX_INFO << objectBoundingBoxes.size() << " bounding boxes";
194 
195  // arvizDrawer->drawBoundingBoxes(objectBoundingBoxes);
196 
197  return calculateGridDimension(objectBoundingBoxes);
198  }
199 
200  void LaserScannerSimulation::fillOccupancyGrid(std::vector<VirtualRobot::SceneObjectPtr> const& sceneObjects)
201  {
202  // initialize grid
203  const auto gridDim = calculateGridDimension(sceneObjects);
204  grid.init(gridDim.sizeX, gridDim.sizeY, gridDim.originX, gridDim.originY, gridCellSize);
205 
206  ARMARX_INFO_S << "Creating grid with size (" << gridDim.sizeX << ", " << gridDim.sizeY
207  << ")";
208 
209  VirtualRobot::CollisionCheckerPtr collisionChecker =
210  VirtualRobot::CollisionChecker::getGlobalCollisionChecker();
211  VirtualRobot::VisualizationFactoryPtr factory(new VirtualRobot::CoinVisualizationFactory());
212 
213  // collision checking by sliding an object with the grid step size over the grid map
214  float boxSize = 1.1f * gridCellSize;
215  VirtualRobot::VisualizationNodePtr boxVisu =
216  factory->createBox(boxSize, boxSize, boxSize, VirtualRobot::VisualizationFactory::Color::Green());
217  VirtualRobot::CollisionModelPtr boxCollisionModel(
218  new VirtualRobot::CollisionModel(boxVisu, "", collisionChecker));
220  new VirtualRobot::SceneObject("my_box", boxVisu, boxCollisionModel));
221 
222  if (not collisionChecker)
223  {
224  ARMARX_WARNING_S << "No global collision checker found";
225  return;
226  }
227 
228  ARMARX_INFO_S << "Filling occupancy grid";
229  const auto collisionObjects = getCollisionObjects(sceneObjects);
230 
231  for (std::size_t indexY = 0; indexY < grid.sizeY; ++indexY)
232  {
233  for (std::size_t indexX = 0; indexX < grid.sizeX; ++indexX)
234  {
235  const Eigen::Vector2f pos = grid.getCentralPosition(indexX, indexY);
236  const Eigen::Vector3f boxPos(pos.x(), pos.y(), boxPosZ);
237  const Eigen::Matrix4f boxPose =
238  Eigen::Affine3f(Eigen::Translation3f(boxPos)).matrix();
239  box->setGlobalPose(boxPose);
240  // - Check collisions with the other objects
241  const bool collision = collisionChecker->checkCollision(box, collisionObjects);
242  // - Mark each field as occupied or free
243  grid.setOccupied(indexX, indexY, collision);
244  }
245  }
246  }
247 
249  {
250  scanners.clear();
251 
252  // Necessary to initialize SoDB and Qt, SoQt::init (otherwise the application crashes at startup)
253  VirtualRobot::init("SimulatorViewerApp");
254  worldVisu = Component::create<ArmarXPhysicsWorldVisualization>(
255  getIceProperties(), getName() + "_PhysicsWorldVisualization");
256  getArmarXManager()->addObject(worldVisu);
257 
258  enableVisualization = getProperty<bool>("visualization.enable").getValue();
259  ARMARX_INFO << "Visualization will be " << (enableVisualization ? "enabled" : "disabled");
260 
261  topicName = getProperty<std::string>("LaserScannerTopicName").getValue();
262  ARMARX_INFO << "Reporting on topic \"" << topicName << "\"";
263  offeringTopic(topicName);
264 
265  robotStateName = getProperty<std::string>("RobotStateComponentName").getValue();
266  ARMARX_INFO << "Using RobotStateComponent \"" << robotStateName << "\"";
267  usingProxy(robotStateName);
268 
269  debugDrawerName = getProperty<std::string>("DebugDrawerTopicName").getValue();
270  ARMARX_INFO << "Using DebugDrawerTopic \"" << debugDrawerName << "\"";
271  // No usingProxy for the DebugDrawerTopic? or is it a topic?
272 
273  topicReplayerDummy = getProperty<bool>("TopicReplayerDummy").getValue();
274  updatePeriod = getProperty<int>("UpdatePeriod").getValue();
275  visuUpdateFrequency = getProperty<int>("VisuUpdateFrequency").getValue();
276  gridCellSize = getProperty<float>("GridCellSize").getValue();
277 
278  auto framesStrings = splitProperty(getProperty<std::string>("Frames"));
279  auto deviceStrings = splitProperty(getProperty<std::string>("Devices"));
280  auto minAnglesStrings = splitProperty(getProperty<std::string>("MinAngles"));
281  auto maxAnglesStrings = splitProperty(getProperty<std::string>("MaxAngles"));
282  auto stepsStrings = splitProperty(getProperty<std::string>("Steps"));
283  auto noiseStrings = splitProperty(getProperty<std::string>("NoiseStdDev"));
284  std::size_t scannerSize = framesStrings.size();
285  if (deviceStrings.size() == 1)
286  {
287  deviceStrings.resize(scannerSize, deviceStrings.front());
288  }
289  else if (deviceStrings.size() != scannerSize)
290  {
291  ARMARX_WARNING << "Unexpected size of property Devices (expected " << scannerSize
292  << " but got " << deviceStrings.size() << ")";
293  return;
294  }
295  if (minAnglesStrings.size() == 1)
296  {
297  minAnglesStrings.resize(scannerSize, minAnglesStrings.front());
298  }
299  else if (minAnglesStrings.size() != scannerSize)
300  {
301  ARMARX_WARNING << "Unexpected size of property MinAngles (expected " << scannerSize
302  << " but got " << minAnglesStrings.size() << ")";
303  return;
304  }
305  if (maxAnglesStrings.size() == 1)
306  {
307  maxAnglesStrings.resize(scannerSize, maxAnglesStrings.front());
308  }
309  else if (maxAnglesStrings.size() != scannerSize)
310  {
311  ARMARX_WARNING << "Unexpected size of property MaxAngles (expected " << scannerSize
312  << " but got " << maxAnglesStrings.size() << ")";
313  return;
314  }
315  if (stepsStrings.size() == 1)
316  {
317  stepsStrings.resize(scannerSize, stepsStrings.front());
318  }
319  else if (stepsStrings.size() != scannerSize)
320  {
321  ARMARX_WARNING << "Unexpected size of property Steps (expected " << scannerSize
322  << " but got " << stepsStrings.size() << ")";
323  return;
324  }
325  if (noiseStrings.size() == 1)
326  {
327  noiseStrings.resize(scannerSize, noiseStrings.front());
328  }
329  else if (noiseStrings.size() != scannerSize)
330  {
331  ARMARX_WARNING << "Unexpected size of property NoiseStdDev (expected " << scannerSize
332  << " but got " << noiseStrings.size() << ")";
333  return;
334  }
335 
336  scanners.reserve(scannerSize);
337  connectedDevices.clear();
338  for (std::size_t i = 0; i < scannerSize; ++i)
339  {
340  LaserScannerSimUnit scanner;
341  scanner.frame = framesStrings[i];
342  try
343  {
344  scanner.minAngle = std::stof(minAnglesStrings[i]);
345  scanner.maxAngle = std::stof(maxAnglesStrings[i]);
346  scanner.noiseStdDev = std::stof(noiseStrings[i]);
347  scanner.steps = std::stoi(stepsStrings[i]);
348  }
349  catch (std::exception const& ex)
350  {
351  ARMARX_INFO << "Scanner[" << i << "] Config error: " << ex.what();
352  continue;
353  }
354 
355  scanners.push_back(scanner);
356 
357  LaserScannerInfo info;
358  info.device = topicReplayerDummy ? deviceStrings[i] : scanner.frame;
359  info.frame = scanner.frame;
360  info.minAngle = scanner.minAngle;
361  info.maxAngle = scanner.maxAngle;
362  info.stepSize = (info.maxAngle - info.minAngle) / scanner.steps;
363  connectedDevices.push_back(info);
364 
365  ARMARX_INFO << "Scanner[" << i << "]: " << scanner.frame << ", " << scanner.minAngle
366  << ", " << scanner.maxAngle << ", " << scanner.steps;
367  }
368  }
369 
371  {
372  if (topicReplayerDummy)
373  {
374  ARMARX_INFO << "Fake connect (component is used for topic replay)";
375  return;
376  }
377  topic = getTopic<LaserScannerUnitListenerPrx>(topicName);
378  robotState = getProxy<RobotStateComponentInterfacePrx>(robotStateName);
379  sharedRobot = robotState->getSynchronizedRobot();
380  debugDrawer = getTopic<DebugDrawerInterfacePrx>(debugDrawerName);
381 
382  for (LaserScannerSimUnit& scanner : scanners)
383  {
384  try
385  {
386  scanner.frameNode = sharedRobot->getRobotNode(scanner.frame);
387  }
388  catch (std::exception const& ex)
389  {
390  ARMARX_WARNING << "Error while querying robot frame: " << scanner.frame << " "
391  << ex.what();
392  scanner.frameNode = nullptr;
393  }
394 
395  if (!scanner.frameNode)
396  {
397  ARMARX_WARNING << "Tried to use a non-existing robot node as frame for the "
398  "laser scanner simulation: "
399  << scanner.frame;
400  }
401  }
402 
403  if (task)
404  {
405  task->stop();
406  }
407 
408  if (enableVisualization)
409  {
410  arvizDrawer = std::make_unique<ArVizDrawer>(getArvizClient());
411  }
412 
413  // Don't forget to sync the data otherwise there may be no objects
414  std::vector<VirtualRobot::SceneObjectPtr> objects;
415  while (objects.empty())
416  {
417  worldVisu->synchronizeVisualizationData();
418  objects = worldVisu->getObjects();
419  ARMARX_INFO << deactivateSpam(5) << "Got " << objects.size() << " objects from the simulator";
420  if (objects.empty())
421  {
422  ARMARX_VERBOSE << deactivateSpam() << "Could not get any objects from the simulator after syncing";
423  TimeUtil::MSSleep(100);
424  }
425  }
426 
427  std::vector<VirtualRobot::RobotPtr> robots;
428  while (robots.empty())
429  {
430  worldVisu->synchronizeVisualizationData();
431  robots = worldVisu->getRobots();
432 
433  if (robots.empty())
434  {
436  << "Could not get any robots from the simulator after syncing";
437  TimeUtil::MSSleep(100);
438  }
439  }
440 
441  ARMARX_INFO << deactivateSpam(5) << "Got " << robots.size() << " robots from the simulator";
442 
443  // remove active robots as they might move
444  robots.erase(std::remove_if(robots.begin(),
445  robots.end(),
446  [](const auto & r) -> bool { return not r->isPassive(); }),
447  robots.end());
448 
449  ARMARX_INFO << "Got " << objects.size() << " scene objects from the simulator";
450 
451  std::vector<VirtualRobot::SceneObjectPtr> validObjects;
452  for (VirtualRobot::SceneObjectPtr const& o : objects)
453  {
454  VirtualRobot::CollisionModelPtr cm = o->getCollisionModel();
455  if (!cm)
456  {
457  ARMARX_WARNING << "Scene object with no collision model: " << o->getName();
458  continue;
459  }
460 
461  const auto pqpModel = cm->getCollisionModelImplementation()->getPQPModel();
462  if (pqpModel)
463  {
464  validObjects.push_back(o);
465  }
466  else
467  {
468  ARMARX_WARNING << "PQP model is not filled: " << o->getName();
469  }
470  }
471 
472  // robots consist of multiple collision models
473  validObjects.insert(validObjects.end(), robots.begin(), robots.end());
474 
475  fillOccupancyGrid(validObjects);
476 
477  if (arvizDrawer)
478  {
479  arvizDrawer->drawOccupancyGrid(grid, boxPosZ);
480  }
481 
482  visuThrottler = std::make_unique<Throttler>(visuUpdateFrequency);
483 
484  task = new PeriodicTask<LaserScannerSimulation>(this,
485  &LaserScannerSimulation::updateScanData,
486  updatePeriod,
487  false,
488  "LaserScannerSimUpdate");
489  task->start();
490  }
491 
493  {
494  if (task)
495  {
496  task->stop();
497  task = nullptr;
498  }
499  }
500 
502  {
503  if (worldVisu)
504  {
505  getArmarXManager()->removeObjectBlocking(worldVisu);
506  worldVisu = nullptr;
507  }
508  }
509 
511  {
514  }
515 
516  std::string LaserScannerSimulation::getReportTopicName(const Ice::Current&) const
517  {
518  return topicName;
519  }
520 
521  LaserScannerInfoSeq LaserScannerSimulation::getConnectedDevices(const Ice::Current&) const
522  {
523  return connectedDevices;
524  }
525 
526  void LaserScannerSimulation::updateScanData()
527  {
528  auto startTime = armarx::Clock::Now();
530 
531  const bool updateVisu = enableVisualization and visuThrottler->check(TimeUtil::GetTime().toMicroSeconds());
532 
533  for (LaserScannerSimUnit const& scanner : scanners)
534  {
535  if (!scanner.frameNode)
536  {
537  continue;
538  }
539  PosePtr scannerPoseP = PosePtr::dynamicCast(scanner.frameNode->getGlobalPose());
540  Eigen::Matrix4f scannerPose = scannerPoseP->toEigen();
541  Eigen::Vector2f position = scannerPose.col(3).head<2>();
542 
543  Eigen::Matrix3f scannerRot = scannerPose.block<3, 3>(0, 0);
544  Eigen::Vector2f yWorld(0.0f, 1.0f);
545  Eigen::Vector2f yScanner = scannerRot.col(1).head<2>();
546  float theta = acos(yWorld.dot(yScanner));
547  if (yScanner.x() >= 0.0f)
548  {
549  theta = -theta;
550  }
551 
552  float minAngle = scanner.minAngle;
553  float maxAngle = scanner.maxAngle;
554  int scanSteps = scanner.steps;
555 
556  LaserScan scan;
557  scan.reserve(scanSteps);
558 
559  // those scan lines would go through the robot
560  // const Interval skipInterval(M_PI_2f32, M_PIf32);
561  const Interval skipInterval(0.0, M_PI_2);
562 
563  std::normal_distribution<float> dist(0.0f, scanner.noiseStdDev);
564  for (int i = 0; i < scanSteps; ++i)
565  {
566  LaserScanStep step;
567  step.angle = minAngle + i * (maxAngle - minAngle) / (scanSteps - 1);
568 
569  if (skipInterval.contains(step.angle))
570  {
571  continue;
572  }
573 
574  const Eigen::Vector2f scanDirGlobal =
575  Eigen::Rotation2Df(step.angle + theta) * Eigen::Vector2f(0.0f, 1.0f);
576  const float distance = grid.computeDistance(position, scanDirGlobal);
577  if (distance > 0.0f)
578  {
579  step.distance = distance + dist(engine);
580  scan.push_back(step);
581  }
582  }
583 
584  topic->reportSensorValues(scanner.frame, scanner.frame, scan, now);
585 
586  if (updateVisu)
587  {
588  arvizDrawer->prepareScan(scan, scanner.frame, Eigen::Affine3f(scannerPose));
589  }
590  }
591 
592  if (updateVisu)
593  {
594  arvizDrawer->drawScans();
595  }
596 
597  auto endTime = armarx::Clock::Now();
598  auto timeElapsed = endTime - startTime;
599 
601  << "Time to simulate laser scanners: " << timeElapsed.toMilliSecondsDouble()
602  << " ms";
603  }
604 
605 } // namespace armarx::laser_scanner_simulation
armarx::ArVizComponentPluginUser::getArvizClient
armarx::viz::Client & getArvizClient()
Definition: ArVizComponentPlugin.h:45
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::laser_scanner_simulation::LaserScannerSimulation::onInitComponent
void onInitComponent() override
Definition: LaserScannerSimulation.cpp:248
armarx::laser_scanner_simulation::LaserScannerSimulation::onExitComponent
void onExitComponent() override
Definition: LaserScannerSimulation.cpp:501
armarx::laser_scanner_simulation::LaserScannerSimUnit::minAngle
float minAngle
Definition: LaserScannerSimulation.h:88
robots
std::vector< VirtualRobot::RobotPtr > robots
Definition: VisualizationRobot.cpp:85
ArVizDrawer.h
armarx::laser_scanner_simulation::LaserScannerSimUnit::frame
std::string frame
Definition: LaserScannerSimulation.h:87
armarx::TimeUtil::MSSleep
static void MSSleep(int durationMS)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
Definition: TimeUtil.cpp:94
armarx::Split
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelperTemplates.h:35
armarx::ManagedIceObject::getArmarXManager
ArmarXManagerPtr getArmarXManager() const
Returns the ArmarX manager used to add and remove components.
Definition: ManagedIceObject.cpp:348
armarx::TimestampVariant
Definition: TimestampVariant.h:54
armarx::laser_scanner_simulation::LaserScannerSimulation::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: LaserScannerSimulation.cpp:510
Elements.h
armarx::laser_scanner_simulation::LaserScannerSimulation::getConnectedDevices
LaserScannerInfoSeq getConnectedDevices(const Ice::Current &) const override
Definition: LaserScannerSimulation.cpp:521
armarx::aron::simox::arondto::AxisAlignedBoundingBox
::simox::arondto::AxisAlignedBoundingBox AxisAlignedBoundingBox
Definition: simox.h:14
IceInternal::Handle< TimestampVariant >
armarx::laser_scanner_simulation
Definition: ArVizDrawer.cpp:18
armarx::laser_scanner_simulation::LaserScannerSimUnit::noiseStdDev
float noiseStdDev
Definition: LaserScannerSimulation.h:90
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::laser_scanner_simulation::LaserScannerSimulation::onConnectComponent
void onConnectComponent() override
Definition: LaserScannerSimulation.cpp:370
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
armarx::laser_scanner_simulation::LaserScannerSimulationPropertyDefinitions
Definition: LaserScannerSimulation.h:59
TimestampVariant.h
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:206
Throttler.h
armarx::TimeUtil::GetTime
static IceUtil::Time GetTime(TimeMode timeMode=TimeMode::VirtualTime)
Get the current time.
Definition: TimeUtil.cpp:42
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::laser_scanner_simulation::LaserScannerSimulation::getReportTopicName
std::string getReportTopicName(const Ice::Current &) const override
Definition: LaserScannerSimulation.cpp:516
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::laser_scanner_simulation::LaserScannerSimulation::onDisconnectComponent
void onDisconnectComponent() override
Definition: LaserScannerSimulation.cpp:492
scene3D::SceneObjectPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
Definition: PointerDefinitions.h:40
armarx::laser_scanner_simulation::LaserScannerSimUnit
Definition: LaserScannerSimulation.h:85
time.h
armarx::laser_scanner_simulation::LaserScannerSimUnit::steps
int steps
Definition: LaserScannerSimulation.h:91
armarx::laser_scanner_simulation::LaserScannerSimulation::~LaserScannerSimulation
virtual ~LaserScannerSimulation() override
armarx::core::time::Clock::Now
static DateTime Now()
Current time on the virtual clock.
Definition: Clock.cpp:97
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
distance
double distance(const Point &a, const Point &b)
Definition: point.hpp:88
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:195
armarx::PropertyUser::getIceProperties
Ice::PropertiesPtr getIceProperties() const
Returns the set of Ice properties.
Definition: PropertyUser.cpp:229
armarx::PeriodicTask
Definition: ArmarXManager.h:70
Logging.h
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
LaserScannerSimulation.h
armarx::laser_scanner_simulation::LaserScannerSimUnit::maxAngle
float maxAngle
Definition: LaserScannerSimulation.h:89
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