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 Navigation::ArmarXObjects::NavigationMemory
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 <cstddef>
27 #include <cstdint>
28 #include <filesystem>
29 #include <fstream>
30 #include <iomanip>
31 #include <iterator>
32 #include <map>
33 #include <memory>
34 #include <mutex>
35 #include <string>
36 #include <utility>
37 #include <vector>
38 
39 #include <Ice/Current.h>
40 
41 #include <SimoxUtility/algorithm/string/string_tools.h>
42 #include <VirtualRobot/Primitive.h>
43 #include <VirtualRobot/Robot.h> // IWYU pragma: keep
44 #include <VirtualRobot/VirtualRobot.h>
45 #include <VirtualRobot/XML/RobotIO.h>
46 
57 #include <ArmarXCore/interface/core/PackagePath.h>
60 
62 
73 #include <RobotAPI/libraries/armem_locations/aron/Location.aron.generated.h>
74 #include <RobotAPI/libraries/aron/common/aron_conversions.h> // IWYU pragma: keep
75 #include <RobotAPI/libraries/aron/common/aron_conversions/names.h> // IWYU pragma: keep
77 
78 #include <armarx/navigation/algorithms/aron/Costmap.aron.generated.h>
79 #include <armarx/navigation/algorithms/aron/Room.aron.generated.h>
82 #include <armarx/navigation/core/aron/Graph.aron.generated.h>
83 #include <armarx/navigation/core/aron/Trajectory.aron.generated.h>
85 #include <armarx/navigation/human/aron/Human.aron.generated.h>
87 #include <armarx/navigation/memory/aron/LaserScannerFeatures.aron.generated.h>
90 
91 #include "Visu.h"
92 #include <nlohmann/json_fwd.hpp>
93 
95 {
96 
98 
101  {
104 
105  // Publish to a topic (passing the TopicListenerPrx).
106  // def->topic(myTopicListener);
107 
108  // Subscribe to a topic (passing the topic name).
109  // def->topic<PlatformUnitListener>("MyTopic");
110 
111  // Use (and depend on) another component (passing the ComponentInterfacePrx).
112  // def->component(myComponentProxy)
113 
114 
115  def->optional(properties.snapshotToLoad,
116  "p.snapshotToLoad",
117  "Snapshot to load at start up \n"
118  "(e.g. 'R003' to load 'PriorKnowledgeData/navigation-graphs/R003').");
119 
120  def->optional(properties.packageToLoad,
121  "p.packageToLoad",
122  "Package to load snapshot at start up \n"
123  "(e.g. 'PriorKnowledgeData').");
124 
125  def->optional(properties.locationGraph.visuLocations,
126  "p.locationGraph.visuLocation",
127  "Enable visualization of locations.");
128 
129  def->optional(
130  properties.locationGraph.visuRelativeLocations,
131  "p.locationGraph.visuRelativeLocation",
132  "Enable visualization of relative locations (currently supported: robots, objects).");
133 
134  def->optional(properties.locationGraph.visuGraphEdges,
135  "p.locationGraph.visuGraphEdges",
136  "Enable visualization of navigation graph edges.");
137 
138  def->optional(
139  properties.visuCostmaps, "p.visuCostmaps", "Enable visualization of costmaps.");
140  def->optional(properties.zOffsetCostmap,
141  "p.zOffsetCostmap",
142  "Adjust the height of the visualized costmap.");
143 
144  def->optional(properties.visuHumans, "p.visuHumans", "Enable visualization of humans.");
145 
146  def->optional(properties.visuTransparent,
147  "p.visuTransparent",
148  "Enable visualization of humans a bit transparent.");
149 
150  def->optional(properties.visuHumanMaxAgeMs,
151  "p.visuHumanMaxAgeMs",
152  "The maximum age of humans to be drawn in ms.");
153 
154  def->optional(properties.visuRooms, "p.visuRooms", "Enable visualization of rooms.");
155 
156  def->optional(properties.visuFrequency,
157  "p.visuFrequency",
158  "Visualization frequeny of locations and graph edges [Hz].");
159 
160  // Core segments (max history size)
161  {
162  def->optional(
163  properties.coreSeg.parameterization.maxHistorySize,
164  "p.coreSeg.parameterization.maxHistorySize",
165  "Max history size of the " +
167  " core segment.");
168 
169  def->optional(properties.coreSeg.costmap.maxHistorySize,
170  "p.coreSeg.costmap.maxHistorySize",
171  "Max history size of the " +
173  " core segment.");
174 
175  def->optional(
176  properties.coreSeg.resultsGlobalPlanner.maxHistorySize,
177  "p.coreSeg.resultsGlobalPlanner.maxHistorySize",
178  "Max history size of the " +
180  " core segment.");
181 
182  def->optional(properties.coreSeg.resultsLocalPlanner.maxHistorySize,
183  "p.coreSeg.resultsLocalPlanner.maxHistorySize",
184  "Max history size of the " +
186  " core segment.");
187 
188  def->optional(properties.coreSeg.events.maxHistorySize,
189  "p.coreSeg.events.maxHistorySize",
190  "Max history size of the " +
192  " core segment.");
193 
194  def->optional(properties.coreSeg.exceptions.maxHistorySize,
195  "p.coreSeg.exceptions.maxHistorySize",
196  "Max history size of the " +
198  " core segment.");
199 
200  def->optional(properties.coreSeg.location.maxHistorySize,
201  "p.coreSeg.location.maxHistorySize",
202  "Max history size of the " +
204  " core segment.");
205 
206  def->optional(properties.coreSeg.graph.maxHistorySize,
207  "p.coreSeg.graph.maxHistorySize",
208  "Max history size of the " +
209  QUOTED(navigation::graph::coreSegmentID.coreSegmentName) +
210  " core segment.");
211 
212  def->optional(properties.coreSeg.human.maxHistorySize,
213  "p.coreSeg.human.maxHistorySize",
214  "Max history size of the " +
216  " core segment.");
217 
218  def->optional(
219  properties.coreSeg.laserScannerFeatures.maxHistorySize,
220  "p.coreSeg.laserScannerFeatures.maxHistorySize",
221  "Max history size of the " +
223  " core segment.");
224 
225  def->optional(properties.coreSeg.rooms.maxHistorySize,
226  "p.coreSeg.rooms.maxHistorySize",
227  "Max history size of the " +
228  QUOTED(navigation::rooms::coreSegmentID.coreSegmentName) +
229  " core segment.");
230  }
231 
232  return def;
233  }
234 
236  {
237  workingMemory().setName("Navigation");
238  }
239 
240  void
242  {
243  // Topics and properties defined above are automagically registered.
244 
245  // Keep debug observer data until calling `sendDebugObserverBatch()`.
246  // (Requies the armarx::DebugObserverComponentPluginUser.)
247  // setDebugObserverBatchModeEnabled(true);
248 
249  workingMemory()
251  .setMaxHistorySize(properties.coreSeg.parameterization.maxHistorySize);
252 
253  workingMemory()
255  algorithms::arondto::Costmap::ToAronType())
256  .setMaxHistorySize(properties.coreSeg.costmap.maxHistorySize);
257 
258  workingMemory()
260  navigation::core::arondto::GlobalTrajectory::ToAronType())
261  .setMaxHistorySize(properties.coreSeg.resultsGlobalPlanner.maxHistorySize);
262 
263  workingMemory()
265  navigation::core::arondto::LocalTrajectory::ToAronType())
266  .setMaxHistorySize(properties.coreSeg.resultsLocalPlanner.maxHistorySize);
267  // workingMemory().addCoreSegment("Results_TrajectoryController",
268  // navigation::core::arondto::Twist::ToAronType());
269  // workingMemory().addCoreSegment("Results_SafetyGuard",
270  // navigation::core::arondto::Twist::ToAronType());
271 
272  workingMemory()
274  .setMaxHistorySize(properties.coreSeg.events
275  .maxHistorySize); //, armem::example::ExampleData::ToAronType());
276 
277  workingMemory()
279  .setMaxHistorySize(properties.coreSeg.exceptions
280  .maxHistorySize); //, armem::example::ExampleData::ToAronType());
281 
282  workingMemory()
284  navigation::location::arondto::Location::ToAronType())
285  .setMaxHistorySize(properties.coreSeg.location.maxHistorySize);
286  workingMemory()
288  navigation::core::arondto::Graph::ToAronType())
289  .setMaxHistorySize(properties.coreSeg.graph.maxHistorySize);
290 
291  workingMemory()
293  navigation::human::arondto::Human::ToAronType())
294  .setMaxHistorySize(properties.coreSeg.human.maxHistorySize);
295 
296  workingMemory()
298  navigation::memory::arondto::LaserScannerFeatures::ToAronType())
299  .setMaxHistorySize(properties.coreSeg.laserScannerFeatures.maxHistorySize);
300 
301  // workingMemory().addCoreSegment(memory::constants::HumanGroupCoreSegmentName,
302  // navigation::human::arondto::Human::ToAronType());
303  workingMemory()
305  navigation::algorithms::arondto::Room::ToAronType())
306  .setMaxHistorySize(properties.coreSeg.rooms.maxHistorySize);
307 
308  loadSnapshot();
309  }
310 
311  void
313  {
314  // connect readers if enabled
315  // if (properties.locationGraph.visuRelativeLocations)
316  {
318  loadSpecialRooms();
319  }
320 
321  // Setup the remote GUI.
322  {
325  }
326 
327  tasks.visuTask = new SimpleRunningTask<>([this]() { this->visuRun(); }, "Visualization");
328  tasks.visuTask->start();
329  }
330 
331  void
333  {
334  }
335 
336  void
338  {
339  }
340 
341  std::string
343  {
344  return GetDefaultName();
345  }
346 
347  std::string
349  {
350  return "navigation_memory";
351  }
352 
353  void
355  {
358 
359  // Setup the widgets.
360  tab.locationGraph.setup(*this);
361 
362  // Setup the layout.
363  VBoxLayout root = {tab.locationGraph.group, VSpacer()};
364  RemoteGui_createTab(getName(), root, &tab);
365  }
366 
367  void
369  {
370  tab.locationGraph.update(*this);
371  }
372 
373  void
375  {
380 
381  GridLayout grid;
382  int row = 0;
383  {
385  reloadSnapshot.setLabel("Reload from Snapshot '" + owner.properties.snapshotToLoad +
386  "'");
387 
388  visuLocations.setValue(owner.properties.locationGraph.visuLocations);
389  visuGraphEdges.setValue(owner.properties.locationGraph.visuLocations);
390 
391  grid.add(reloadSnapshot, {.row = row, .column = 0}, {.rows = 1, .columns = 2});
392  ++row;
393 
394  grid.add(Label("Visualize Locations"), {.row = row, .column = 0})
395  .add(visuLocations, {.row = row, .column = 1});
396  ++row;
397 
398  grid.add(Label("Visualize Graph Edges"), {.row = row, .column = 0})
399  .add(visuGraphEdges, {.row = row, .column = 1});
400  ++row;
401  }
402 
403  group = GroupBox({grid});
404  group.setLabel("Locations");
405  }
406 
407  void
409  {
410  if (reloadSnapshot.wasClicked())
411  {
412  owner.loadSnapshot();
413  }
414  if (visuLocations.hasValueChanged() or visuGraphEdges.hasValueChanged())
415  {
416  std::scoped_lock lock(owner.propertiesMutex);
417  owner.properties.locationGraph.visuLocations = visuLocations.getValue();
418  owner.properties.locationGraph.visuGraphEdges = visuGraphEdges.getValue();
419  }
420  }
421 
422  void
423  Component::visuRun()
424  {
425  memory::Visu visu{arviz,
431 
433  Properties p;
434  {
435  std::scoped_lock lock(propertiesMutex);
436  pp = properties.locationGraph;
437  p = properties;
438  }
439 
440  Metronome metronome(Frequency::HertzDouble(p.visuFrequency));
441  while (tasks.visuTask and not tasks.visuTask->isStopped())
442  {
443  ARMARX_TRACE;
444 
445  {
446  std::scoped_lock lock(propertiesMutex);
447  pp = properties.locationGraph;
448  }
449 
450  std::vector<viz::Layer> layers;
451 
452  // Locations
453  if (properties.locationGraph.visuRelativeLocations)
454  {
455  ARMARX_TRACE;
456  visu.drawLocations(objClient, layers, pp.visuLocations);
457  }
458  else
459  {
460  ARMARX_TRACE;
461  visu.drawLocations(layers, pp.visuLocations);
462  }
463 
464  // Graph Edges
465  if (properties.locationGraph.visuRelativeLocations)
466  {
467  ARMARX_TRACE;
468  visu.drawGraphs(objClient, layers, pp.visuGraphEdges);
469  }
470  else
471  {
472  ARMARX_TRACE;
473  visu.drawGraphs(layers, pp.visuGraphEdges);
474  }
475 
476  // Costmaps
477  ARMARX_TRACE;
478  visu.drawCostmaps(layers, p.visuCostmaps, p.zOffsetCostmap);
479 
480  // Humans
481  ARMARX_TRACE;
482  visu.drawHumans(layers,
483  p.visuHumans,
484  p.visuTransparent,
485  Duration::MilliSeconds(p.visuHumanMaxAgeMs));
486  // Rooms
487  ARMARX_TRACE;
488  visu.drawRooms(layers, p.visuRooms);
489 
490  arviz.commit(layers);
491 
492  metronome.waitForNextTick();
493  }
494  }
495 
496  void
497  Component::loadSnapshot()
498  {
499  if (properties.snapshotToLoad.empty())
500  {
502  << "Not loading any predefined locations or graphs as the params was empty ...";
503  return;
504  }
505 
506  const std::vector<std::string> snapshotsToLoad =
507  simox::alg::split(properties.snapshotToLoad, ";", true);
508 
509  for (const auto& snapshotToLoad : snapshotsToLoad)
510  {
511 
512  ARMARX_INFO << "Loading snapshots from snapshot '" << snapshotToLoad << "' in package '"
513  << properties.packageToLoad << "' ...";
514 
516  properties.packageToLoad,
518  DEFAULT_DIR_TO_IDS);
519 
520  if (auto graph = f.find(snapshotToLoad); graph.has_value())
521  {
522  const std::string graphId = graph->getID();
523  ARMARX_DEBUG << "Found graph " << graphId << " with path: " << graph->getFullPath();
524 
525  // Sometimes, we use the date before the snapshotname.
526  // In this case a symlink to the real data should be used (e.g. R003 and 2022-03-01_R003)
527 
528  // This loads the location. All locations are stored in a single locations.json file
529  // The file contains json with the framed poses (frame, agent, 4x4 matrix)
530  {
531  std::filesystem::path locationsFilePath =
532  graph->getFullPath() / "locations.json";
533  if (not std::filesystem::is_regular_file(locationsFilePath))
534  {
535  ARMARX_WARNING << "Found no locations file for graph '" << graphId << "'.";
536  }
537  else
538  {
539 
540  ARMARX_DEBUG << "Found the locations file";
542  armem::MemoryID providerID = workingMemory().id();
543  providerID.coreSegmentName = "Location";
544  providerID.providerSegmentName = graphId;
545 
546  const auto now = armem::Time::Now();
547  ARMARX_DEBUG << "Loading " << locationsFilePath;
548 
549  std::ifstream ifs(locationsFilePath);
550  const std::string content((std::istreambuf_iterator<char>(ifs)),
551  (std::istreambuf_iterator<char>()));
552 
553  // parse location as json. All files in Location folder must be valid json objects!
554  nlohmann::json js = nlohmann::json::parse(content);
555 
556  auto locations =
558  js);
559 
560  for (const auto& location : locations)
561  {
562  // we assert that only framedLocations are allowed. Everything else will be rejected!
563  if (location->type !=
565  {
567  << "Navigation memory received location '" + location->id.name +
568  "' which is not of type "
569  "'armarx::priorknowledge::util::LocationType:"
570  ":FRAMED_LOCATION' (e.g. you specified a "
571  "FRAMED_BOXED_LOCATION?). Only FramedLocations (i.e. "
572  "poses in 3D space) are navigatable. Ignoring this "
573  "location "
574  "but please check the location.json file.";
575  continue;
576  }
577 
578  auto& framedLocation =
580  *location);
581 
582  navigation::location::arondto::Location loc;
583 
584  // set members of loc
585  loc.framedPose.header.frame = framedLocation.frame;
586  loc.framedPose.header.agent = framedLocation.agent;
587  loc.framedPose.pose = framedLocation.pose;
588  toAron(loc.names, framedLocation.names);
589 
590  // send commit to memory
591  auto& up = c.add();
592  up.confidence = 1.0;
593  up.referencedTime = now;
594  up.sentTime = now;
595  up.arrivedTime = now;
596  up.entityID = providerID.withEntityName(framedLocation.id.name);
597  up.instancesData = {loc.toAron()};
598  }
599 
600  ARMARX_DEBUG << "Sending locations to memory";
602  }
603  }
604 
605  {
606  // Next we load the graphs. The graph folder may contain several graphs, represented by different json files.
607  // Each of those graphs contains a list of files representing the vertices. The filename is the vertice id (ideally starting at 0).
608  // The file contains a json with the corresponding location name (as path) and the adjacent vertives (representing the directed outgoing edges).
609  std::filesystem::path graphFilesPath = graph->getFullPath() / "Graph";
610 
611  if (not std::filesystem::is_directory(graphFilesPath))
612  {
613  ARMARX_INFO << "Found no `Graph/` folder for graph '" << graphId << "'.";
614  ARMARX_INFO << "Creating empty graph.";
615 
617  armem::MemoryID providerID = workingMemory().id();
619  providerID.providerSegmentName = graphId;
620 
621  const auto now = armem::Time::Now();
622 
624 
625  auto& up = c.add();
626  up.confidence = 1.0;
627  up.referencedTime = now;
628  up.arrivedTime = now;
629  up.sentTime = now;
630  up.entityID = providerID.withEntityName(snapshotToLoad);
631  up.instancesData = {g.toAron()};
632 
633  ARMARX_DEBUG << "Sending empty graph `" << snapshotToLoad << "` to memory.";
634  iceAdapter().commit(c);
635  }
636  else
637  {
638  ARMARX_DEBUG << "Loading graphs from " << graphFilesPath;
639 
641  armem::MemoryID providerID = workingMemory().id();
643  providerID.providerSegmentName = graphId;
644 
645  const auto now = armem::Time::Now();
646 
647  for (const auto& graphFile : std::filesystem::directory_iterator(
648  graphFilesPath)) // iterate over the different graphs (json files)
649  {
650  if (std::filesystem::is_regular_file(graphFile.path()) and
651  simox::alg::ends_with(graphFile.path().filename(),
652  ".json")) // assure that its a json file
653  {
654  const std::string graphName = graphFile.path().stem();
655 
656 
657  ARMARX_DEBUG << "Loading graph `" << graphName << " `from file `"
658  << graphFile.path() << "`.";
659 
661 
662  std::ifstream ifs(graphFile.path());
663  const std::string content((std::istreambuf_iterator<char>(ifs)),
664  (std::istreambuf_iterator<char>()));
665 
666  const nlohmann::json j = nlohmann::json::parse(content);
667 
668  const auto& jEdges = j.at("edges");
669  const auto& jVertices = j.at("vertices");
670 
671  for (const auto& jVertex : jVertices)
672  {
673  const armarx::armem::MemoryID vertexLocationMemoryId(
674  jVertex.at("locationID"));
675 
676  armarx::navigation::core::arondto::Vertex v;
677  v.vertexID = jVertex.at("vertexID");
678  toAron(v.locationID, vertexLocationMemoryId);
679  toAron(v.locationID.timestamp, armem::Time::Invalid());
680  v.locationID.instanceIndex = 0;
681 
682  g.vertices.push_back(v);
683  }
684 
685  for (const auto& jEdge : jEdges)
686  {
687  std::pair<std::int64_t, std::int64_t> edgeSourceTargetPair;
688  jEdge.get_to(edgeSourceTargetPair);
689 
690  armarx::navigation::core::arondto::Edge e;
691  e.sourceVertexID = edgeSourceTargetPair.first;
692  e.targetVertexID = edgeSourceTargetPair.second;
693  g.edges.push_back(e);
694  }
695 
696  auto& up = c.add();
697  up.confidence = 1.0;
698  up.referencedTime = now;
699  up.arrivedTime = now;
700  up.sentTime = now;
701  up.entityID = providerID.withEntityName(graphName);
702  up.instancesData = {g.toAron()};
703  }
704  }
705 
706  ARMARX_DEBUG << "Sending graphs to memory";
707  iceAdapter().commit(c);
708  }
709  }
710 
711  {
712  // Next we load the rooms.
713  std::filesystem::path roomsFilePath = graph->getFullPath() / "rooms.json";
714  if (not std::filesystem::is_regular_file(roomsFilePath))
715  {
716  ARMARX_INFO << "Found no rooms file for graph '" << graphId << "'.";
717  }
718  else
719  {
720  ARMARX_DEBUG << "Found the rooms file";
721 
723  armem::MemoryID providerID = workingMemory().id();
724  providerID.coreSegmentName =
726  providerID.providerSegmentName = graphId;
727 
728  const auto now = armem::Time::Now();
729  ARMARX_VERBOSE << "Loading " << roomsFilePath;
730 
731  std::ifstream ifs(roomsFilePath);
732  const std::string content((std::istreambuf_iterator<char>(ifs)),
733  (std::istreambuf_iterator<char>()));
734 
735  // parse room. TODO: Move into PriorKnowledge similar to locations
736  const nlohmann::json js = nlohmann::json::parse(content);
737 
738  const auto rooms =
739  js.at("rooms").get<std::map<std::string, nlohmann::json>>();
740  ARMARX_INFO << "Found " << rooms.size() << " rooms.";
741  for (const auto& [roomId, j] : rooms)
742  {
743  auto roomMemoryId = providerID;
744  roomMemoryId.entityName = roomId;
745 
746  const std::string roomMemoryIdStr = roomMemoryId.str();
747 
748  if (j.find("polygon") == j.end())
749  {
750  ARMARX_WARNING << "The element '" << roomMemoryIdStr
751  << "' has no 'polygon' member. Skipping "
752  "this entity.";
753  continue;
754  }
755 
756  if (j.find("height") == j.end())
757  {
758  ARMARX_WARNING << "The element '" << roomMemoryIdStr
759  << "' has no 'height' member. "
760  "Skipping this entity.";
761  continue;
762  }
763 
764  navigation::algorithms::arondto::Room room;
765  j.at("polygon").get_to(room.polygon);
766  j.at("height").get_to(room.height);
767  room.name = roomId;
768 
769  // set the polygon to z=0
770  for (auto& point : room.polygon)
771  {
772  point.z() = 0;
773  }
774 
775  // send commit to memory
776  auto& up = c.add();
777  up.confidence = 1.0;
778  up.referencedTime = now;
779  up.sentTime = now;
780  up.arrivedTime = now;
781  up.entityID = armarx::armem::MemoryID(roomMemoryIdStr);
782  up.instancesData = {room.toAron()};
783  }
784 
785  ARMARX_DEBUG << "Sending rooms to memory";
786  iceAdapter().commit(c);
787  }
788  }
789  ARMARX_INFO << "Loaded NavigationMemory '" << snapshotToLoad << "' --> graph: '"
790  << graphId << "'";
791  }
792  else
793  {
794  ARMARX_WARNING << "Could not load NavigationMemory '" << snapshotToLoad
795  << "'. Continue with empty memory.";
796  }
797  }
798  }
799 
800  namespace
801  {
802 
803  [[maybe_unused]]
804  bool
805  store(const std::map<armem::MemoryID, core::Graph>& graphs,
806  const std::filesystem::path& baseDirectory)
807  {
808  ARMARX_INFO << "Creating export directory `" << baseDirectory << "`.";
809  std::filesystem::create_directories(baseDirectory);
810 
811  for (const auto& [memoryId, graph] : graphs)
812  {
813  const std::filesystem::path nestedSubDir =
814  std::filesystem::path(memoryId.providerSegmentName) / memoryId.coreSegmentName;
815  const std::filesystem::path dir = baseDirectory / nestedSubDir;
816 
817  std::filesystem::create_directories(dir);
818 
819  nlohmann::json j;
820 
821  // source -> target
822  std::vector<std::pair<std::size_t, std::size_t>> outgoingEdges;
823  std::transform(graph.m_edges.begin(),
824  graph.m_edges.end(),
825  std::back_inserter(outgoingEdges),
826  [](const auto& edge)
827  { return std::make_pair(edge.m_source, edge.m_target); });
828 
829  j["edges"] = outgoingEdges;
830  j["vertices"] = {};
831 
832  for (const auto& vertex : graph.m_vertices)
833  {
834 
835  armarx::armem::MemoryID locationId;
836  fromAron(vertex.m_property.aron.locationID, locationId);
837 
838  nlohmann::json jVertex;
839  jVertex["locationID"] = locationId.getEntityID().str();
840  jVertex["vertexID"] = vertex.m_property.aron.vertexID;
841 
842  j["vertices"].push_back(jVertex);
843  }
844 
845  // save to disk
846  const std::filesystem::path filename = dir / (memoryId.entityName + ".json");
847  ARMARX_VERBOSE << "Saving file `" << filename << "`.";
848  std::ofstream ofs(filename);
849  ofs << std::setw(4) << j;
850  }
851 
852  return true;
853  }
854 
855  bool
856  store(const std::map<armem::MemoryID, location::arondto::Location>& locations,
857  const std::filesystem::path& baseDirectory)
858  {
859  ARMARX_INFO << "Creating export directory `" << baseDirectory << "`.";
860  std::filesystem::create_directories(baseDirectory);
861 
862  // key: provider id
863  std::map<std::string, nlohmann::json> js;
864 
865  for (const auto& [memoryId, location] : locations)
866  {
867  auto& j = js[memoryId.providerSegmentName];
868 
869  if (j.count("locations") == 0)
870  {
871  j["locations"] = {};
872  }
873 
874  nlohmann::json jLoc;
875  nlohmann::json framedPose;
876 
877  framedPose["agent"] = location.framedPose.header.agent;
878  framedPose["frame"] = location.framedPose.header.frame;
879 
880  // utilize ice conversion of eigen
881  std::vector<std::vector<float>> poseAsVec;
882  armarx::core::eigen::toIce(location.framedPose.pose, poseAsVec);
883  framedPose["pose"] = poseAsVec;
884 
885  jLoc["framedPose"] = framedPose;
886 
887  auto entityId = memoryId.getEntityID();
888  j["locations"][entityId.entityName] = jLoc;
889  }
890 
891  // save to disk
892  for (const auto& [providerId, j] : js)
893  {
894  const std::filesystem::path subDir = std::filesystem::path(providerId);
895  const std::filesystem::path dir = baseDirectory / subDir;
896 
897  if (not std::filesystem::exists(dir))
898  {
899  std::filesystem::create_directories(dir);
900  }
901 
902  const std::filesystem::path filename = dir / "locations.json";
903  ARMARX_VERBOSE << "Saving file `" << filename << "`.";
904  std::ofstream ofs(filename);
905  ofs << std::setw(4) << j;
906  }
907 
908 
909  return true;
910  }
911 
912  } // namespace
913 
914  bool
915  Component::storeLocationGraph(const armarx::data::PackagePath& packagePath,
916  const Ice::Current& /*current*/)
917  {
918  armem::server::wm::CoreSegment& locationCoreSegment =
920  armem::server::wm::CoreSegment& graphCoreSegment =
922 
923  // obtain locations and graphs
924 
925  const std::map<armem::MemoryID, location::arondto::Location> locations =
926  [&locationCoreSegment]()
927  {
928  std::map<armem::MemoryID, location::arondto::Location> locations;
929  locationCoreSegment.doLocked(
930  [&]()
931  {
932  locationCoreSegment.forEachEntity(
933  [&](const armarx::armem::server::wm::Entity& entity) -> bool
934  {
935  if (const armarx::armem::server::wm::EntityInstance* instance =
936  entity.findLatestInstance())
937  {
938  locations[entity.id()].fromAron(instance->data());
939  }
940 
941  return true;
942  });
943 
944  return true;
945  });
946 
947  return locations;
948  }();
949 
950  const auto graphs = [&graphCoreSegment]()
951  {
952  std::map<armem::MemoryID, core::Graph> graphs;
953  graphCoreSegment.doLocked(
954  [&]()
955  {
956  graphCoreSegment.forEachEntity(
957  [&](const armarx::armem::server::wm::Entity& entity) -> bool
958  {
959  core::Graph& graph = graphs[entity.id()];
960  if (const armarx::armem::server::wm::EntityInstance* instance =
961  entity.findLatestInstance())
962  {
964  aron.fromAron(instance->data());
965  fromAron(aron, graph);
966  }
967 
968  return true;
969  });
970  });
971 
972  return graphs;
973  }();
974 
975 
976  // store on disk
977 
978  const std::filesystem::path baseDirectory = armarx::PackagePath(packagePath).toSystemPath();
979 
980  store(locations, baseDirectory);
981 
982  // The graph is no longer relevant.
983  // store(graphs, baseDirectory);
984 
985  return true;
986  }
987 
988  void
989  Component::loadSpecialRooms()
990  {
991  armem::Commit c; // will be populated and sent to the memory at the end
992 
993  // special handling of object affordances that are actually rooms
994  {
995  const auto objectFinder = objClient.getObjectFinder();
996  const auto objectPoseMap = objClient.fetchObjectPosesAsMap();
997 
998  for (const auto& [providerName, objectPose] : objectPoseMap)
999  {
1000  const auto objectInfoOpt = objectFinder.findObject(objectPose.objectID);
1001  if (not objectInfoOpt)
1002  {
1003  ARMARX_WARNING << "Could not find object with id '" << objectPose.objectID
1004  << "'.";
1005  continue;
1006  }
1007 
1008  const auto& objectInfo = *objectInfoOpt;
1009 
1010  // TODO: handle non-articulated model similar to articulated model below
1011 
1012  // load the articulated model and extract the room affordances (type: containable, name: room)
1013 
1014  const auto articulatedModelPathOpt = objectInfo.getArticulatedModel();
1015  if (not articulatedModelPathOpt)
1016  {
1017  ARMARX_VERBOSE << "Object '" << objectPose.objectID
1018  << "' is not an articulated model.";
1019  continue;
1020  }
1021 
1022  const auto& articulatedModelPath = *articulatedModelPathOpt;
1023  if (not std::filesystem::is_regular_file(articulatedModelPath.absolutePath))
1024  {
1025  ARMARX_VERBOSE << "Object '" << objectPose.objectID
1026  << "' has no articulated model.";
1027  continue;
1028  }
1029 
1030  // load the model
1031  VirtualRobot::RobotPtr articulatedObject = VirtualRobot::RobotIO::loadRobot(
1032  articulatedModelPath.absolutePath.string(), VirtualRobot::RobotIO::eStructure);
1033  ARMARX_CHECK_NOT_NULL(articulatedObject)
1034  << QUOTED(articulatedModelPath.absolutePath.string());
1035 
1036  // synchronize state
1037  articulatedObject->setJointValues(objectPose.objectJointValues);
1038  articulatedObject->setGlobalPose(objectPose.objectPoseGlobal);
1039 
1040  // extract the room affordances
1041  const auto affordances = articulatedObject->getAffordances();
1042  for (const auto& affordanceLocation : affordances)
1043  {
1044  for (const auto affordance : affordanceLocation.affordances)
1045  {
1046  if (simox::alg::to_lower(affordance.type) == "containable")
1047  {
1048  // check if the affordance is a room
1049  // if (simox::alg::to_lower(affordanceLocation.name) == "room")
1050  {
1051  for (const std::shared_ptr<VirtualRobot::Primitive::Primitive>&
1052  primitive : affordance.primitiveRepresentation)
1053  {
1054  if (primitive->type == VirtualRobot::Primitive::Box::TYPE)
1055  {
1056  VirtualRobot::Primitive::Box* box =
1057  std::dynamic_pointer_cast<VirtualRobot::Primitive::Box>(
1058  primitive)
1059  .get();
1060 
1061  ARMARX_CHECK_NOT_NULL(box);
1062 
1063  const Eigen::Isometry3f& root_T_prim =
1064  affordanceLocation.pose.pose;
1065  const Eigen::Isometry3f global_T_prim =
1066  Eigen::Isometry3f{articulatedObject->getGlobalPose()} *
1067  root_T_prim;
1068 
1069  const Eigen::Isometry3f prim_T_affordance{
1070  primitive->transform};
1071  const Eigen::Isometry3f global_T_affordance =
1072  global_T_prim * prim_T_affordance;
1073 
1074  const Eigen::Vector3f boxSize{
1075  box->width, box->height, box->depth};
1076 
1077  // we want to extract the polygon in the xy-plane
1078 
1079  // Local corner points (clock-wise)
1080  const Eigen::Vector3f corner1 = Eigen::Vector3f{
1081  boxSize.x() / 2, boxSize.y() / 2, -boxSize.z() / 2};
1082  const Eigen::Vector3f corner2 = Eigen::Vector3f{
1083  -boxSize.x() / 2, boxSize.y() / 2, -boxSize.z() / 2};
1084  const Eigen::Vector3f corner3 = Eigen::Vector3f{
1085  -boxSize.x() / 2, -boxSize.y() / 2, -boxSize.z() / 2};
1086  const Eigen::Vector3f corner4 = Eigen::Vector3f{
1087  boxSize.x() / 2, -boxSize.y() / 2, -boxSize.z() / 2};
1088 
1089  // FIXME: strong assumption: the box is axis aligned. relax
1090  // obtain the corner points of the box in the xy-plane
1091  std::vector<Eigen::Vector3f> polygon;
1092  polygon.reserve(4);
1093  polygon.emplace_back(global_T_affordance * corner1);
1094  polygon.emplace_back(global_T_affordance * corner2);
1095  polygon.emplace_back(global_T_affordance * corner3);
1096  polygon.emplace_back(global_T_affordance * corner4);
1097 
1098  // create a room object
1099  navigation::algorithms::arondto::Room room;
1100  room.name = "inside";
1101  room.polygon = polygon;
1102  room.height = boxSize.z();
1103 
1104  // send commit to memory
1105  armem::MemoryID providerID = workingMemory().id();
1106  providerID.coreSegmentName =
1108  providerID.providerSegmentName =
1109  objectPose.objectID.dataset() +
1110  "::" + objectPose.objectID.className();
1111 
1112  const auto now = armem::Time::Now();
1113 
1114  auto& up = c.add();
1115  up.confidence = 1.0;
1116  up.referencedTime = now;
1117  up.sentTime = now;
1118  up.arrivedTime = now;
1119  up.entityID = providerID.withEntityName(room.name);
1120  up.instancesData = {room.toAron()};
1121  }
1122  else
1123  {
1124  ARMARX_INFO << "Not handling affordance of type "
1125  << primitive->type;
1126  continue;
1127  }
1128  }
1129  }
1130  }
1131  }
1132  }
1133 
1134  // check whether a specific areas.json exists
1135  const auto areas = objectInfo.file(".json", "_areas", true);
1136  ARMARX_VERBOSE << "Checking for areas.json file at " << areas.absolutePath;
1137  if (std::filesystem::exists(areas.absolutePath))
1138  {
1139  ARMARX_INFO << "Found areas.json file for object '" << objectPose.objectID
1140  << "'.";
1141 
1142  // load json
1143  std::ifstream ifs(areas.absolutePath);
1144  const auto json = nlohmann::json::parse(ifs);
1145 
1146  const std::map<std::string, nlohmann::json> jAreas = json.at("areas");
1147  ARMARX_INFO << "Found " << jAreas.size() << " areas.";
1148 
1149  for (const auto& [areaName, jArea] : jAreas)
1150  {
1151  const std::vector<Eigen::Vector2f> polygon =
1152  jArea.at("polygon").get<std::vector<Eigen::Vector2f>>();
1153  const float height = jArea.at("height").get<float>();
1154 
1155  // send commit to memory
1156  armem::MemoryID providerID = workingMemory().id();
1157  providerID.coreSegmentName =
1159  providerID.providerSegmentName =
1160  objectPose.objectID.dataset() + "::" + objectPose.objectID.className();
1161 
1162  const auto now = armem::Time::Now();
1163 
1164  // create a room object
1165  navigation::algorithms::arondto::Room room;
1166  room.name = objectPose.objectID.getClassID().withInstanceName(areaName).str();
1167  room.polygon = conv::to3D(polygon); // at this point relative to the object
1168  room.height = height;
1169 
1170  // change the room to the global coordinate system
1171  const Eigen::Isometry3f global_T_object{objectPose.objectPoseGlobal};
1172  for (auto& point : room.polygon)
1173  {
1174  // see comment below: point = global_T_object * point;
1175  point = global_T_object * point;
1176  }
1177 
1178  // If you want to convert globalliy-defined rooms to local coordinates,
1179  // change the for loop above (comment it out) and uncomment the line below:
1180  // point = global_T_object.inverse() * point;
1181  // Then, comment in the lines below and read out the local cooredinates in the
1182  // ArmarX log.
1183 
1184  // nlohmann::json jj;
1185  // jj["polygon"] = conv::to2D(room.polygon);
1186  // ARMARX_INFO << areaName << " " << jj.dump(4);
1187 
1188  auto& up = c.add();
1189  up.confidence = 1.0;
1190  up.referencedTime = now;
1191  up.sentTime = now;
1192  up.arrivedTime = now;
1193  up.entityID = providerID.withEntityName(areaName);
1194  up.instancesData = {room.toAron()};
1195  }
1196  }
1197  }
1198  }
1199 
1200  if (c.updates.empty())
1201  {
1202  ARMARX_INFO << "No special rooms found.";
1203  return;
1204  }
1205 
1206  ARMARX_INFO << "Sending " << c.updates.size() << " special rooms to memory";
1207  iceAdapter().commit(c);
1208  }
1209 } // namespace armarx::navigation::components::navigation_memory
armarx::view_selection::skills::direction::state::up
state::Type up(state::Type previous)
Definition: LookDirection.cpp:240
Visu.h
armarx::SimpleRunningTask
Usage:
Definition: TaskUtil.h:85
armarx::viz::Client::commit
CommitResult commit(StagedCommit const &commit)
Definition: Client.cpp:89
armarx::navigation::graph::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:30
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:187
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph
Definition: Component.h:122
armarx::navigation::components::navigation_memory::Component::storeLocationGraph
bool storeLocationGraph(const armarx::data::PackagePath &packagePath, const Ice::Current &current) override
Definition: Component.cpp:915
armarx::armem::server::wm::detail::MaxHistorySizeParent::setMaxHistorySize
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
Definition: MaxHistorySize.h:41
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:190
armarx::navigation::memory::constants::CostmapCoreSegmentName
const std::string CostmapCoreSegmentName
Definition: constants.h:36
armarx::armem::MemoryID::providerSegmentName
std::string providerSegmentName
Definition: MemoryID.h:52
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
QUOTED
#define QUOTED(x)
Definition: StringHelpers.h:199
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition: memory_definitions.h:32
armarx::priorknowledge::util::FramedLocation::frame
std::string frame
Definition: Location.h:50
armarx::RemoteGui::Client::VBoxLayout
Definition: Widgets.h:167
ObjectPoseClientPlugin.h
armarx::core::time::DateTime::Now
static DateTime Now()
Definition: DateTime.cpp:51
armarx::navigation::components::navigation_memory::Component::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:100
armarx::navigation::rooms::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:10
MemoryID.h
armarx::armem::base::MemoryBase::getCoreSegment
CoreSegmentT & getCoreSegment(const std::string &name)
Definition: MemoryBase.h:134
ARMARX_CHECK_NOT_NULL
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
Definition: ExpressionException.h:206
armarx::navigation::components::navigation_memory::Component::RemoteGui_update
void RemoteGui_update() override
Definition: Component.cpp:368
armarx::RemoteGui::Client::GridLayout::add
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
Definition: Widgets.cpp:438
constants.h
forward_declarations.h
ice_conversions.h
armarx::armem::MemoryID::str
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
Definition: MemoryID.cpp:102
trace.h
armarx::navigation::components::navigation_memory::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:337
Layer.h
armarx::navigation::components::navigation_memory::Component
Definition: Component.h:62
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::navigation::components::navigation_memory::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:332
aron_conversions.h
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::visuLocations
armarx::RemoteGui::Client::CheckBox visuLocations
Definition: Component.h:170
httplib::detail::case_ignore::to_lower
unsigned char to_lower(int c)
Definition: httplib.h:346
armarx::armem::server::wm::Entity
Definition: memory_definitions.h:27
armarx::armem::server::plugins::ReadWritePluginUser::workingMemory
server::wm::Memory & workingMemory()
Definition: ReadWritePluginUser.cpp:128
armarx::armem::MemoryID::coreSegmentName
std::string coreSegmentName
Definition: MemoryID.h:51
armarx::RemoteGui::Client::VSpacer
Definition: Widgets.h:204
armarx::armem::base::detail::ForEachEntityMixin::forEachEntity
bool forEachEntity(FunctionT &&func)
Definition: iteration_mixins.h:259
armarx::navigation::components::navigation_memory::ARMARX_REGISTER_COMPONENT_EXECUTABLE
ARMARX_REGISTER_COMPONENT_EXECUTABLE(Component, Component::GetDefaultName())
StringHelpers.h
constants.h
armarx::navigation::memory::constants::ExceptionsCoreSegmentName
const std::string ExceptionsCoreSegmentName
Definition: constants.h:39
armarx::navigation::components::navigation_memory::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:241
memory_definitions.h
visionx::voxelgrid::Label
uint32_t Label
Type of an object label.
Definition: types.h:6
LocationLoader.h
armarx::navigation::memory::Visu
Definition: Visu.h:54
armarx::armem::server::ltm::mongodb::util::store
void store(const mongocxx::database &db, const armem::wm::Memory &m)
Definition: operations.cpp:260
armarx::RemoteGui::Client::GridLayout
Definition: Widgets.h:186
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::reloadSnapshot
armarx::RemoteGui::Client::Button reloadSnapshot
Definition: Component.h:169
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:77
armarx::navigation::components::navigation_memory::Component::Component
Component()
Definition: Component.cpp:235
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::PackagePath::toSystemPath
static std::filesystem::path toSystemPath(const data::PackagePath &pp)
Definition: PackagePath.cpp:47
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:184
armarx::navigation::core::Graph
Definition: Graph.h:89
armarx::core::time::Frequency::HertzDouble
static Frequency HertzDouble(double hertz)
Definition: Frequency.cpp:30
armarx::navigation::components::navigation_memory
Definition: Component.cpp:94
armarx::RemoteGui::Client::GroupBox
Definition: Widgets.h:193
armarx::navigation::components::navigation_memory::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:342
filename
std::string filename
Definition: VisualizationRobot.cpp:86
armarx::navigation::memory::constants::GraphCoreSegmentName
const std::string GraphCoreSegmentName
Definition: constants.h:34
Metronome.h
armarx::armem::server::plugins::ReadWritePluginUser::iceAdapter
MemoryToIceAdapter & iceAdapter()
Definition: ReadWritePluginUser.cpp:134
armarx::Graph
boost::subgraph< CloudGraph > Graph
Definition: Common.h:58
armarx::armem::base::EntityBase::findLatestInstance
auto * findLatestInstance(int instanceIndex=0)
Definition: EntityBase.h:356
TaskUtil.h
armarx::core::eigen::toIce
void toIce(const Eigen::Vector2f &e, Ice::FloatSeq &ice)
Definition: ice_conversions.cpp:17
armarx::armem::base::detail::MemoryItem::id
MemoryID & id()
Definition: MemoryItem.h:25
armarx::RemoteGui::Client::Button::setLabel
void setLabel(std::string const &label)
Definition: Widgets.cpp:123
armarx::armem::server::wm::CoreSegment::doLocked
auto doLocked(FunctionT &&function) const
Definition: memory_definitions.h:110
armarx::armem::MemoryID::entityName
std::string entityName
Definition: MemoryID.h:53
armarx::navigation::memory::constants::HumanCoreSegmentName
const std::string HumanCoreSegmentName
Definition: constants.h:37
aron_conversions.h
armarx::navigation::memory::constants::EventsCoreSegmentName
const std::string EventsCoreSegmentName
Definition: constants.h:33
forward_declarations.h
armarx::RemoteGui::Client::GroupBox::setLabel
void setLabel(std::string const &text)
Definition: Widgets.cpp:420
Component.h
aron_conversions.h
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:351
armarx::LightweightRemoteGuiComponentPluginUser::RemoteGui_startRunningTask
void RemoteGui_startRunningTask()
Definition: LightweightRemoteGuiComponentPlugin.cpp:119
ExpressionException.h
Commit.h
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:75
armarx::priorknowledge::util::FramedLocation
Definition: Location.h:48
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
Decoupled.h
armarx::armem::MemoryID::getEntityID
MemoryID getEntityID() const
Definition: MemoryID.cpp:310
Graph.h
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::armem::MemoryID::withEntityName
MemoryID withEntityName(const std::string &name) const
Definition: MemoryID.cpp:425
armarx::navigation::components::navigation_memory::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:312
armarx::priorknowledge::util::LocationLoader::LoadLocations
static std::vector< LocationPtr > LoadLocations(const std::string &dataset, const nlohmann::json &)
Definition: LocationLoader.cpp:143
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
Location.h
PropertyDefinitionContainer.h
armarx::ArVizComponentPluginUser::arviz
armarx::viz::Client arviz
Definition: ArVizComponentPlugin.h:42
armarx::RemoteGui::Client::CheckBox::setValue
void setValue(bool newValue)
Definition: Widgets.cpp:252
armarx::navigation::components::navigation_memory::Component::GetDefaultName
static std::string GetDefaultName()
Definition: Component.cpp:348
armarx::LightweightRemoteGuiComponentPluginUser::RemoteGui_createTab
void RemoteGui_createTab(std::string const &name, RemoteGui::Client::Widget const &rootWidget, RemoteGui::Client::Tab *tab)
Definition: LightweightRemoteGuiComponentPlugin.cpp:103
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::core::time::Metronome
Simple rate limiter for use in loops to maintain a certain frequency given a clock.
Definition: Metronome.h:34
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::visuGraphEdges
armarx::RemoteGui::Client::CheckBox visuGraphEdges
Definition: Component.h:171
armarx::navigation::memory::constants::GlobalPlannerResultCoreSegment
const std::string GlobalPlannerResultCoreSegment
Definition: constants.h:41
NavigationGraphFinder.h
armarx::ends_with
bool ends_with(const std::string &haystack, const std::string &needle)
Definition: StringHelpers.cpp:53
armarx::navigation::conv::to3D
std::vector< Eigen::Vector3f > to3D(const std::vector< Eigen::Vector2f > &v)
Definition: eigen.cpp:14
armarx::fromAron
void fromAron(const arondto::PackagePath &dto, PackageFileLocation &bo)
armarx::navigation::memory::constants::ParameterizationCoreSegmentName
const std::string ParameterizationCoreSegmentName
Definition: constants.h:32
constants.h
Widgets.h
armarx::navigation::location::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:30
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:108
armarx::RemoteGui::Client::Button
Definition: Widgets.h:120
eigen.h
Logging.h
armarx::toAron
void toAron(arondto::PackagePath &dto, const PackageFileLocation &bo)
names.h
armarx::ObjectPoseClientPluginUser::getClient
objpose::ObjectPoseClient getClient() const
Definition: ObjectPoseClientPlugin.cpp:70
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:193
armarx::priorknowledge::navigation_graphs::NavigationGraphFinder
Definition: NavigationGraphFinder.h:7
armarx::navigation::memory::constants::LocalPlannerResultCoreSegment
const std::string LocalPlannerResultCoreSegment
Definition: constants.h:42
armarx::PackagePath
Definition: PackagePath.h:52
armarx::armem::server::wm::Memory::addCoreSegment
CoreSegment & addCoreSegment(const std::string &name, Args... args)
Definition: memory_definitions.h:151
armarx::priorknowledge::util::LocationType::FRAMED_LOCATION
@ FRAMED_LOCATION
armarx::navigation::components::navigation_memory::Component::createRemoteGuiTab
void createRemoteGuiTab()
Definition: Component.cpp:354
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph::visuGraphEdges
bool visuGraphEdges
Definition: Component.h:125
armarx::navigation::memory::constants::LaserScannerFeaturesCoreSegment
const std::string LaserScannerFeaturesCoreSegment
Definition: constants.h:38
armarx::core::time::DateTime::Invalid
static DateTime Invalid()
Definition: DateTime.cpp:57
armarx::armem::base::MemoryBase::setName
void setName(const std::string &name)
Definition: MemoryBase.h:248
armarx::armem::server::MemoryToIceAdapter::commitLocking
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:170
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::update
void update(Component &owner) const
Definition: Component.cpp:408
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::group
armarx::RemoteGui::Client::GroupBox group
Definition: Component.h:167
armarx::armem::server::MemoryToIceAdapter::commit
data::CommitResult commit(const data::Commit &commitIce, Time timeArrived)
Definition: MemoryToIceAdapter.cpp:119
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:48
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
armarx::navigation::components::navigation_memory::Component::RemoteGuiTab::LocationGraph::setup
void setup(Component &owner)
Definition: Component.cpp:374
constants.h
armarx::navigation::components::navigation_memory::Component::Properties::LocationGraph::visuLocations
bool visuLocations
Definition: Component.h:124
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelpers.cpp:38
PackagePath.h
armarx::human::MemoryID
const armem::MemoryID MemoryID
Definition: memory_ids.cpp:28