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