ArVizStorage.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 RobotAPI::ArmarXObjects::ArViz
17  * @author Fabian Paus ( fabian dot paus at kit dot edu )
18  * @date 2019
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "ArVizStorage.h"
24 
25 #include <algorithm>
26 #include <optional>
27 
28 #include <SimoxUtility/json/json.hpp>
29 
32 #include <ArmarXCore/core/time.h>
37 
38 namespace armarx
39 {
40  static std::filesystem::path
41  getAbsolutePath(const std::filesystem::path& path)
42  {
43  if (path.is_absolute())
44  {
45  return path;
46  }
47  else
48  {
49  std::string absolute;
50  if (ArmarXDataPath::getAbsolutePath(path.string(), absolute))
51  {
52  return absolute;
53  }
54  else
55  {
56  ARMARX_WARNING_S << "Could not resolve relative file as package data file: "
57  << path;
58  return path;
59  }
60  }
61  }
62 
63  std::string
65  {
66  return "ArVizStorage";
67  }
68 
71  {
74 
75  defs->optional(
76  properties_.topicName, "TopicName", "Layer updates are sent over this topic.");
77 
78  defs->optional(properties_.maxHistorySize,
79  "MaxHistorySize",
80  "How many layer updates are saved in the history until they are compressed")
81  .setMin(0);
82 
83  defs->optional(properties_.historyPath,
84  "HistoryPath",
85  "Destination path where the history is serialized to");
86 
87 
88  defs->optional(properties_.componentWarnFrequency, "ComponentWarnFrequency",
89  "Define a frequency in Hz above which the compnent raises a warning. As you should not send data at a too high rate.");
90 
91  return defs;
92  }
93 
94  void
96  {
97  properties_.historyPath = getAbsolutePath(properties_.historyPath);
98  if (!std::filesystem::exists(properties_.historyPath))
99  {
100  ARMARX_INFO << "Creating history path: " << properties_.historyPath;
101  std::error_code error;
102  std::filesystem::create_directory(properties_.historyPath, error);
103  if (error)
104  {
105  ARMARX_WARNING << "Could not create directory for history: \n" << error.message();
106  }
107  }
108 
109  usingTopic(properties_.topicName);
110  }
111 
112  void
114  {
115  revision = 0;
116  currentState.clear();
117  history.clear();
118  recordingInitialState.clear();
119 
120  recordingBuffer.clear();
121  recordingMetaData.id = "";
122  }
123 
124  void
126  {
127  if (recordingTask)
128  {
129  recordingTask->stop();
130  recordingTask = nullptr;
131  }
132  }
133 
134  void
136  {
137  }
138 
139  void
140  ArVizStorage::updateLayers(viz::data::LayerUpdateSeq const& updates, const Ice::Current&)
141  {
142  std::unique_lock<std::mutex> lock(historyMutex);
143 
144  revision += 1;
145 
146  IceUtil::Time now = IceUtil::Time::now();
147  long nowInMicroSeconds = now.toMicroSeconds();
148 
149  if (not updates.empty())
150  {
151  const std::string& componentName = updates.front().component;
152 
153  auto& history = updateHistoryForComponents[componentName];
154  history.push_back(armarx::Clock::Now());
155 
156  const auto maxHistoryDur = armarx::Duration::SecondsDouble(1);
157 
158  const DateTime referenceNow = Clock::Now();
159  const auto isOutdated = [&referenceNow,
160  &maxHistoryDur](const DateTime& timestamp) -> bool
161  { return (referenceNow - timestamp) > maxHistoryDur; };
162 
163  // trim history
164  history.erase(std::remove_if(history.begin(), history.end(), isOutdated),
165  history.end());
166 
167  ARMARX_VERBOSE << deactivateSpam(1, componentName) << componentName << ": "
168  << history.size() / maxHistoryDur.toSecondsDouble() << " Hz";
169 
170  if (history.size() > properties_.componentWarnFrequency)
171  {
172  ARMARX_WARNING << deactivateSpam(10) << "Component `" << componentName << "`"
173  << "sends data at a too high rate ("
174  << history.size() / maxHistoryDur.toSecondsDouble() << ")"
175  << deactivateSpam(10, componentName);
176  }
177  }
178 
179 
180  for (auto& update : updates)
181  {
182  if (update.component.empty())
183  {
185  << "Discarding ArViz update with empty component name. Check whether "
186  << "you correctly create your ArViz client (`armarx::viz::Client`) "
187  << "in your code.";
188  continue;
189  }
190 
191  auto& historyEntry = history.emplace_back();
192  historyEntry.revision = revision;
193  historyEntry.timestampInMicroseconds = nowInMicroSeconds;
194  historyEntry.update = update;
195 
196  // Insert or create the layer
197  bool found = false;
198  for (auto& layer : currentState)
199  {
200  if (layer.update.component == update.component && layer.update.name == update.name)
201  {
202  layer = historyEntry;
203  found = true;
204  break;
205  }
206  }
207  if (!found)
208  {
209  currentState.push_back(historyEntry);
210  }
211  }
212 
213  long currentHistorySize = history.size();
214  if (currentHistorySize >= properties_.maxHistorySize)
215  {
216  {
217  std::unique_lock<std::mutex> lock(recordingMutex);
218  if (recordingMetaData.id.size() > 0)
219  {
220  auto& newBatch = recordingBuffer.emplace_back();
221  newBatch.initialState = recordingInitialState;
222  newBatch.updates = std::move(history);
223  recordingInitialState = currentState;
224 
225  recordingCondition.notify_one();
226  }
227  }
228  history.clear();
229  }
230  }
231 
232  viz::data::CommitResult
233  ArVizStorage::commitAndReceiveInteractions(viz::data::CommitInput const& input,
234  const Ice::Current&)
235  {
236  viz::data::CommitResult result;
237 
238  {
239  std::unique_lock<std::mutex> lock(historyMutex);
240 
241  revision += 1;
242  result.revision = revision;
243 
244  IceUtil::Time now = IceUtil::Time::now();
245  long nowInMicroSeconds = now.toMicroSeconds();
246 
247  // Insert updates into the history and update the current state
248  for (viz::data::LayerUpdate const& update : input.updates)
249  {
250  viz::data::TimestampedLayerUpdate& historyEntry = history.emplace_back();
251  historyEntry.revision = revision;
252  historyEntry.timestampInMicroseconds = nowInMicroSeconds;
253  historyEntry.update = update;
254 
255  // Insert or create the layer
256  bool found = false;
257  for (viz::data::TimestampedLayerUpdate& layer : currentState)
258  {
259  if (layer.update.component == update.component &&
260  layer.update.name == update.name)
261  {
262  layer = historyEntry;
263  found = true;
264  break;
265  }
266  }
267  if (!found)
268  {
269  currentState.push_back(historyEntry);
270  }
271  }
272 
273  // Trim the history if max size has been exceeded
274  long currentHistorySize = history.size();
275  if (currentHistorySize >= properties_.maxHistorySize)
276  {
277  {
278  std::unique_lock<std::mutex> lock(recordingMutex);
279  if (recordingMetaData.id.size() > 0)
280  {
281  auto& newBatch = recordingBuffer.emplace_back();
282  newBatch.initialState = recordingInitialState;
283  newBatch.updates = std::move(history);
284  recordingInitialState = currentState;
285 
286  recordingCondition.notify_one();
287  }
288  }
289  history.clear();
290  }
291 
292  // Find relevant interactions
293  if (input.interactionComponent.size() > 0)
294  {
295  auto interactionsEnd = interactionBuffer.end();
296  auto foundInteractionsBegin =
297  std::partition(interactionBuffer.begin(),
298  interactionsEnd,
299  [&input](viz::data::InteractionFeedback const& interaction)
300  {
301  if (interaction.component == input.interactionComponent)
302  {
303  for (std::string const& layer : input.interactionLayers)
304  {
305  if (interaction.layer == layer)
306  {
307  return false;
308  }
309  }
310  }
311  return true;
312  });
313 
314  result.interactions.assign(foundInteractionsBegin, interactionsEnd);
315  interactionBuffer.erase(foundInteractionsBegin, interactionsEnd);
316  }
317  }
318 
319  return result;
320  }
321 
322  viz::data::LayerUpdates
323  ArVizStorage::pullUpdatesSince(Ice::Long revision, const Ice::Current&)
324  {
325  viz::data::LayerUpdates result;
326 
327  std::unique_lock<std::mutex> lock(historyMutex);
328 
329  result.updates.reserve(currentState.size());
330  for (auto& layer : currentState)
331  {
332  if (layer.revision > revision)
333  {
334  result.updates.push_back(layer.update);
335  }
336  }
337  result.revision = this->revision;
338 
339  return result;
340  }
341 
342  static const int ALL_TRANSFORM_FLAGS =
343  viz::data::InteractionFeedbackType::TRANSFORM_BEGIN_FLAG |
344  viz::data::InteractionFeedbackType::TRANSFORM_DURING_FLAG |
345  viz::data::InteractionFeedbackType::TRANSFORM_END_FLAG;
346 
347  viz::data::LayerUpdates
348  ArVizStorage::pullUpdatesSinceAndSendInteractions(
349  Ice::Long revision,
350  viz::data::InteractionFeedbackSeq const& interactions,
351  const Ice::Current& c)
352  {
353  viz::data::LayerUpdates result;
354 
355  std::unique_lock<std::mutex> lock(historyMutex);
356 
357  for (viz::data::InteractionFeedback const& interaction : interactions)
358  {
359  for (viz::data::InteractionFeedback& entry : interactionBuffer)
360  {
361  if (entry.component == interaction.component && entry.layer == interaction.layer &&
362  entry.element == interaction.element)
363  {
364  int previousTransformFlags = entry.type & ALL_TRANSFORM_FLAGS;
365  int interactionTransformFlags = interaction.type & ALL_TRANSFORM_FLAGS;
366 
367  entry = interaction;
368  // Keep the previous transform flags.
369  // Blindly overwriting the entry might skip over the begin or during events.
370  if (previousTransformFlags != 0 && interactionTransformFlags != 0)
371  {
372  entry.type |= previousTransformFlags;
373  }
374  goto for_end;
375  }
376  }
377 
378  // Interaction did not exist, add it to the buffer
379  interactionBuffer.push_back(interaction);
380 
381  for_end:;
382  }
383 
384  result.updates.reserve(currentState.size());
385  for (viz::data::TimestampedLayerUpdate& layer : currentState)
386  {
387  if (layer.revision > revision)
388  {
389  result.updates.push_back(layer.update);
390  }
391  }
392  result.revision = this->revision;
393 
394  return result;
395  }
396 
397  void
398  ArVizStorage::record()
399  {
400  while (!recordingTask->isStopped())
401  {
402  std::unique_lock<std::mutex> lock(recordingMutex);
403  while (!recordingTask->isStopped() && recordingBuffer.empty())
404  {
405  recordingCondition.wait_for(lock, std::chrono::milliseconds(10));
406  }
407  for (auto& batch : recordingBuffer)
408  {
409  recordBatch(batch);
410  }
411  recordingBuffer.clear();
412  }
413  }
414 } // namespace armarx
415 
417 {
418 
419  void
420  to_json(nlohmann::json& j, RecordingBatchHeader const& batch)
421  {
422  j["index"] = batch.index;
423  j["firstRevision"] = batch.firstRevision;
424  j["lastRevision"] = batch.lastRevision;
425  j["firstTimestampInMicroSeconds"] = batch.firstTimestampInMicroSeconds;
426  j["lastTimestampInMicroSeconds"] = batch.lastTimestampInMicroSeconds;
427  }
428 
429  void
430  from_json(nlohmann::json const& j, RecordingBatchHeader& batch)
431  {
432  batch.index = j["index"];
433  batch.firstRevision = j["firstRevision"];
434  batch.lastRevision = j["lastRevision"];
435  batch.firstTimestampInMicroSeconds = j["firstTimestampInMicroSeconds"];
436  batch.lastTimestampInMicroSeconds = j["lastTimestampInMicroSeconds"];
437  }
438 
439  void
440  to_json(nlohmann::json& j, Recording const& recording)
441  {
442  j["id"] = recording.id;
443  j["firstRevision"] = recording.firstRevision;
444  j["lastRevision"] = recording.lastRevision;
445  j["firstTimestampInMicroSeconds"] = recording.firstTimestampInMicroSeconds;
446  j["lastTimestampInMicroSeconds"] = recording.lastTimestampInMicroSeconds;
447  j["batchHeaders"] = recording.batchHeaders;
448  }
449 
450  void
451  from_json(nlohmann::json const& j, Recording& recording)
452  {
453  recording.id = j["id"];
454  recording.firstRevision = j["firstRevision"];
455  recording.lastRevision = j["lastRevision"];
456  recording.firstTimestampInMicroSeconds = j["firstTimestampInMicroSeconds"];
457  recording.lastTimestampInMicroSeconds = j["lastTimestampInMicroSeconds"];
458  j["batchHeaders"].get_to(recording.batchHeaders);
459  }
460 
461 } // namespace armarx::viz::data
462 
463 static bool
464 writeCompleteFile(std::string const& filename, const void* data, std::size_t size)
465 {
466  FILE* file = fopen(filename.c_str(), "wb");
467  if (!file)
468  {
469  return false;
470  }
471  std::size_t written = std::fwrite(data, 1, size, file);
472  if (written != size)
473  {
474  return false;
475  }
476  std::fclose(file);
477  return true;
478 }
479 
480 static std::string
481 readCompleteFile(std::filesystem::path const& path)
482 {
483  FILE* f = fopen(path.string().c_str(), "rb");
484  fseek(f, 0, SEEK_END);
485  long fsize = ftell(f);
486  fseek(f, 0, SEEK_SET); /* same as rewind(f); */
487 
488  std::string result(fsize, '\0');
489  std::size_t read = fread(result.data(), 1, fsize, f);
490  result.resize(read);
491  fclose(f);
492 
493  return result;
494 }
495 
496 static std::optional<armarx::viz::data::Recording>
497 readRecordingInfo(std::filesystem::path const& recordingDirectory)
498 {
499  std::optional<::armarx::viz::data::Recording> result;
500 
501  std::filesystem::path recordingFilePath = recordingDirectory / "recording.json";
502  if (!std::filesystem::exists(recordingFilePath))
503  {
504  ARMARX_INFO << "No recording.json found in directory: " << recordingDirectory;
505  return result;
506  }
507 
508  try
509  {
510  std::string recordingString = readCompleteFile(recordingFilePath);
511  nlohmann::json recordingJson = nlohmann::json::parse(recordingString);
512 
514  recordingJson.get_to(recording);
515 
516  result = std::move(recording);
517  return result;
518  }
519  catch (std::exception const& ex)
520  {
521  ARMARX_WARNING << "Could not parse JSON file: " << recordingFilePath
522  << "\nReason: " << ex.what();
523  return result;
524  }
525 }
526 
527 static std::string
528 batchFileName(armarx::viz::data::RecordingBatchHeader const& batchHeader)
529 {
530  return std::to_string(batchHeader.firstRevision) + ".bin";
531 }
532 
533 void
534 armarx::ArVizStorage::recordBatch(armarx::viz::data::RecordingBatch& batch)
535 {
536  if (batch.updates.empty())
537  {
538  return;
539  }
540 
541  auto& first = batch.updates.front();
542  auto& last = batch.updates.back();
543 
544  batch.header.index = -1; // TODO: Should we save the index?
545  batch.header.firstRevision = first.revision;
546  batch.header.lastRevision = last.revision;
547  batch.header.firstTimestampInMicroSeconds = first.timestampInMicroseconds;
548  batch.header.lastTimestampInMicroSeconds = last.timestampInMicroseconds;
549  if (firstBatch)
550  {
551  batch.initialState = currentState;
552  firstBatch = false;
553  }
554 
555 
556  std::string filename = batchFileName(batch.header);
557  std::filesystem::path filePath = recordingPath / filename;
558 
559  ObjectToIceBlobSerializer ser{batch};
560  // Save the batch to a new file
561  if (!writeCompleteFile(filePath.string(), ser.begin(), ser.size()))
562  {
563  ARMARX_WARNING << "Could not write history file: " << filePath;
564  return;
565  }
566 
567  // Update the meta data
568  if (recordingMetaData.firstRevision < 0)
569  {
570  recordingMetaData.firstRevision = first.revision;
571  }
572  recordingMetaData.lastRevision = last.revision;
573 
574  if (recordingMetaData.firstTimestampInMicroSeconds < 0)
575  {
576  recordingMetaData.firstTimestampInMicroSeconds = first.timestampInMicroseconds;
577  }
578  recordingMetaData.lastTimestampInMicroSeconds = last.timestampInMicroseconds;
579 
580  armarx::viz::data::RecordingBatchHeader& newBatch =
581  recordingMetaData.batchHeaders.emplace_back();
582  newBatch.index = recordingMetaData.batchHeaders.size() - 1;
583  newBatch.firstRevision = first.revision;
584  newBatch.lastRevision = last.revision;
585  newBatch.firstTimestampInMicroSeconds = first.timestampInMicroseconds;
586  newBatch.lastTimestampInMicroSeconds = last.timestampInMicroseconds;
587 
588  // Save the meta data to a (potentially existing) json file
589  nlohmann::json j = recordingMetaData;
590  std::string jString = j.dump(2);
591  std::filesystem::path recordingFile = recordingPath / "recording.json";
592  if (!writeCompleteFile(recordingFile.string(), jString.data(), jString.size()))
593  {
594  ARMARX_WARNING << "Could not write recording file: " << recordingFile;
595  return;
596  }
597 
598  ARMARX_INFO << "Recorded ArViz batch to: " << filePath;
599 }
600 
601 std::string
602 armarx::ArVizStorage::startRecording(std::string const& newRecordingPrefix, const Ice::Current&)
603 {
604  {
605  std::unique_lock<std::mutex> lock(recordingMutex);
606  if (recordingMetaData.id.size() > 0)
607  {
609  << "Could not start recording with prefix " << newRecordingPrefix
610  << "\nbecause there is already a recording running for the recording ID: "
611  << recordingMetaData.id;
612  return recordingMetaData.id;
613  }
614 
615  IceUtil::Time now = IceUtil::Time::now();
616  std::ostringstream id;
617  id << newRecordingPrefix << '_' << now.toString("%Y-%m-%d_%H-%M-%S");
618  std::string newRecordingID = id.str();
619 
620  recordingPath = properties_.historyPath / newRecordingID;
621  if (!std::filesystem::exists(recordingPath))
622  {
623  ARMARX_INFO << "Creating directory for recording with ID '" << newRecordingID
624  << "'\nPath: " << recordingPath;
625  std::filesystem::create_directory(recordingPath);
626  }
627 
628  recordingBuffer.clear();
629 
630  recordingMetaData.id = newRecordingID;
631  {
632  std::unique_lock<std::mutex> lock(historyMutex);
633  if (history.size() > 0)
634  {
635  auto& mostRecent = history.back();
636  recordingMetaData.firstRevision = mostRecent.revision;
637  recordingMetaData.firstTimestampInMicroSeconds = mostRecent.timestampInMicroseconds;
638  }
639  }
640  recordingMetaData.lastRevision = 0;
641  recordingMetaData.lastTimestampInMicroSeconds = 0;
642  recordingMetaData.batchHeaders.clear();
643  }
644 
645  firstBatch = true;
646  recordingTask = new RunningTask<ArVizStorage>(this, &ArVizStorage::record);
647  recordingTask->start();
648 
649  return "";
650 }
651 
652 void
654 {
655  if (!recordingTask)
656  {
657  return;
658  }
659 
660  recordingTask->stop();
661  recordingTask = nullptr;
662 
663  std::unique_lock<std::mutex> lock(recordingMutex);
664 
665  viz::data::RecordingBatch lastBatch;
666  lastBatch.initialState = recordingInitialState;
667  lastBatch.updates = std::move(history);
668  recordBatch(lastBatch);
669 
670  recordingMetaData.id = "";
671  recordingMetaData.firstRevision = -1;
672  recordingMetaData.firstTimestampInMicroSeconds = -1;
673 }
674 
675 armarx::viz::data::RecordingsInfo
677 {
678  viz::data::RecordingsInfo recordingsInfo;
679  viz::data::RecordingSeq result;
680 
681  for (std::filesystem::directory_entry const& entry :
682  std::filesystem::directory_iterator(properties_.historyPath))
683  {
684  ARMARX_DEBUG << "Checking: " << entry.path();
685 
686  if (!entry.is_directory())
687  {
688  continue;
689  }
690 
691  std::optional<viz::data::Recording> recording = readRecordingInfo(entry.path());
692  if (recording)
693  {
694  result.push_back(std::move(*recording));
695  }
696  }
697 
698  recordingsInfo.recordings = result;
699  recordingsInfo.recordingsPath = properties_.historyPath;
700 
701  return recordingsInfo;
702 }
703 
704 armarx::viz::data::RecordingBatch
705 armarx::ArVizStorage::getRecordingBatch(std::string const& recordingID,
706  Ice::Long batchIndex,
707  const Ice::Current&)
708 {
709  viz::data::RecordingBatch result;
710  result.header.index = -1;
711 
712  std::filesystem::path recordingPath = properties_.historyPath / recordingID;
713  std::optional<viz::data::Recording> recording = readRecordingInfo(recordingPath);
714  if (!recording)
715  {
716  ARMARX_WARNING << "Could not read recording information for '" << recordingID << "'"
717  << "\nPath: " << recordingPath;
718  return result;
719  }
720 
721  if (batchIndex < 0 || batchIndex >= (long)recording->batchHeaders.size())
722  {
723  ARMARX_WARNING << "Batch index is not valid. Index = " << batchIndex
724  << "Batch count: " << recording->batchHeaders.size();
725  return result;
726  }
727 
728  viz::data::RecordingBatchHeader const& batchHeader = recording->batchHeaders[batchIndex];
729  std::filesystem::path batchFile = recordingPath / batchFileName(batchHeader);
730  if (!std::filesystem::exists(batchFile))
731  {
732  ARMARX_WARNING << "Could not find batch file for recording '" << recordingID
733  << "' with index " << batchIndex << "\nPath: " << batchFile;
734  return result;
735  }
736 
737  iceBlobToObject(result, readCompleteFile(batchFile));
738 
739  result.header.index = batchIndex;
740 
741  return result;
742 }
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::ArVizStorage::stopRecording
void stopRecording(const Ice::Current &) override
Definition: ArVizStorage.cpp:653
armarx::ArVizStorage::onExitComponent
void onExitComponent() override
armarx::ManagedIceObject::onExitComponent()
Definition: ArVizStorage.cpp:135
armarx::viz::interaction
InteractionDescription interaction()
Definition: ElementOps.h:101
DateTime.h
ArVizStorage.h
Duration.h
armarx::ArVizStorage::updateLayers
void updateLayers(viz::data::LayerUpdateSeq const &updates, const Ice::Current &) override
Definition: ArVizStorage.cpp:140
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::ArVizStorage::getAllRecordings
viz::data::RecordingsInfo getAllRecordings(const Ice::Current &) override
Definition: ArVizStorage.cpp:676
armarx::RunningTask
Definition: ArmarXMultipleObjectsScheduler.h:35
armarx::ArVizStorage::startRecording
std::string startRecording(std::string const &prefix, const Ice::Current &) override
Definition: ArVizStorage.cpp:602
armarx::viz::data::from_json
void from_json(nlohmann::json const &j, RecordingBatchHeader &batch)
Definition: ArVizStorage.cpp:430
armarx::ArVizStorage::onConnectComponent
void onConnectComponent() override
armarx::ManagedIceObject::onConnectComponent()
Definition: ArVizStorage.cpp:113
armarx::ArVizStorage::getDefaultName
std::string getDefaultName() const override
armarx::ManagedIceObject::getDefaultName()
Definition: ArVizStorage.cpp:64
armarx::viz::data
Definition: ArVizStorage.cpp:416
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::ArVizStorage::onDisconnectComponent
void onDisconnectComponent() override
armarx::ManagedIceObject::onDisconnectComponent()
Definition: ArVizStorage.cpp:125
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::ArVizStorage::commitAndReceiveInteractions
viz::data::CommitResult commitAndReceiveInteractions(viz::data::CommitInput const &input, const Ice::Current &) override
Definition: ArVizStorage.cpp:233
armarx::read
void read(auto &eigen, auto *table)
Definition: FTSensorCalibrationGuiWidgetController.cpp:462
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::core::time::Duration::SecondsDouble
static Duration SecondsDouble(double seconds)
Constructs a duration in seconds.
Definition: Duration.cpp:90
filename
std::string filename
Definition: VisualizationRobot.cpp:83
armarx::ArVizStorage::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
PropertyUser::createPropertyDefinitions()
Definition: ArVizStorage.cpp:70
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:206
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::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
visionx::imrec::Recording
std::shared_ptr< AbstractRecordingStrategy > Recording
Convenience alias for any recording strategy.
Definition: AbstractRecordingStrategy.h:181
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::iceBlobToObject
void iceBlobToObject(T &result, const std::string_view &sv)
Definition: IceBlobToObject.h:39
ObjectToIceBlob.h
time.h
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
armarx::ArVizStorage::onInitComponent
void onInitComponent() override
armarx::ManagedIceObject::onInitComponent()
Definition: ArVizStorage.cpp:95
armarx::ArmarXDataPath::getAbsolutePath
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
Definition: ArmarXDataPath.cpp:111
Logging.h
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
ArmarXDataPath.h
armarx::ArVizStorage::getRecordingBatch
viz::data::RecordingBatch getRecordingBatch(const std::string &, Ice::Long, const Ice::Current &) override
Definition: ArVizStorage.cpp:705
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
IceBlobToObject.h
armarx::viz::data::to_json
void to_json(nlohmann::json &j, RecordingBatchHeader const &batch)
Definition: ArVizStorage.cpp:420