SimpleEpisodicMemory.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 MemoryX::ArmarXObjects::SimpleEpisodicMemory
17  * @author fabian.peller-konrad@kit.edu ( fabian dot peller-konrad at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "SimpleEpisodicMemory.h"
24 
25 
26 // OpenCV
27 #include <opencv2/opencv.hpp>
28 
29 #include <filesystem>
30 
31 namespace memoryx
32 {
33 
34  // In one of the implementation files
35  const std::string SimpleEpisodicMemory::NO_EPISODE = "NO_EPISODE";
36 
37  const std::map<EpisodeStatus, std::string> SimpleEpisodicMemory::episode_status_descriptor =
38  {
39  {EpisodeStatus::EPISODE_STARTED, "started"},
40  {EpisodeStatus::EPISODE_COMPLETED_SUCCESS, "success"},
41  {EpisodeStatus::EPISODE_COMPLETED_FAILURE, "failure"},
42  {EpisodeStatus::EPISODE_COMPLETED_ABORT, "abort"},
43  };
44 
45  const std::map<ActionStatus, std::string> SimpleEpisodicMemory::action_status_descriptor =
46  {
47  {ActionStatus::ACTION_STARTED, "started"},
48  {ActionStatus::ACTION_RUNNING, "running"},
49  {ActionStatus::ACTION_REPEATED, "repeated"},
50  {ActionStatus::ACTION_COMPLETED_SUCCESS, "success"},
51  {ActionStatus::ACTION_COMPLETED_FAILURE, "failure"},
52  };
53 
54  const std::map<ObjectPoseEventType, std::string> SimpleEpisodicMemory::object_type_descriptor =
55  {
56  {ObjectPoseEventType::NEW_OBJECT_RECOGNIZED, "newly detected"},
57  {ObjectPoseEventType::OBJECT_POSE_UPDATE, "updated"},
58  };
59 
61  {
62  return "SimpleEpisodicMemory";
63  }
64 
66  {
67  m_enable_export = true; //getProperty<bool>("EnableExport");
68  m_export_folder = "/tmp/EMExport"; //getProperty<std::string>("ExportFolder");
69  }
70 
72  {
73  clearAll();
74  }
75 
77  {
78  }
79 
81  {
82  }
83 
84  void SimpleEpisodicMemory::export_episode() const
85  {
86  ARMARX_IMPORTANT << "Exporting current episode!";
87  if (m_current_episode.episodeName == NO_EPISODE)
88  {
89  //return;
90  }
91  if (m_current_episode.imageEvents.size() + m_current_episode.actionEvents.size() + m_current_episode.humanPoseEvents.size() +
92  m_current_episode.speechEvents.size() + m_current_episode.objectPoseEvents.size() + m_current_episode.kinematicUnitEvents.size() +
93  m_current_episode.platformUnitEvents.size() + m_current_episode.platformUnitTargetEvents.size() == 0)
94  {
95  ARMARX_DEBUG << "No information found. Skip export.";
96  return;
97  }
98 
99  if (std::filesystem::exists(m_export_folder))
100  {
101  const std::string episode_output = m_export_folder + "/episode_" + std::to_string(m_current_episode.startedInMs) + "/";
102  if (!std::filesystem::create_directory(episode_output))
103  {
104  ARMARX_ERROR << "Couldn't create episode folder: " << episode_output;
105  return;
106  }
107 
108  const std::string camera_output = episode_output + "camera/";
109  if (!std::filesystem::create_directory(camera_output))
110  {
111  ARMARX_ERROR << "Couldn't create camera folder";
112  return;
113  }
114 
115  const std::string object_output = episode_output + "objects/";
116  if (!std::filesystem::create_directory(object_output))
117  {
118  ARMARX_ERROR << "Couldn't objects camera folder";
119  return;
120  }
121 
122  const std::string action_output = episode_output + "actions/";
123  if (!std::filesystem::create_directory(action_output))
124  {
125  ARMARX_ERROR << "Couldn't create actions folder";
126  return;
127  }
128 
129  const std::string human_poses_output = episode_output + "poses/";
130  if (!std::filesystem::create_directory(human_poses_output))
131  {
132  ARMARX_ERROR << "Couldn't create poses folder";
133  return;
134  }
135 
136  const std::string speech_output = episode_output + "speech/";
137  if (!std::filesystem::create_directory(speech_output))
138  {
139  ARMARX_ERROR << "Couldn't create speech folder";
140  return;
141  }
142 
143  const std::string platformUnit_output = episode_output + "platformUnit/";
144  if (!std::filesystem::create_directory(platformUnit_output))
145  {
146  ARMARX_ERROR << "Couldn't create platformUnit folder";
147  return;
148  }
149 
150  const std::string platformUnitTarget_output = episode_output + "platformUnitTarget/";
151  if (!std::filesystem::create_directory(platformUnitTarget_output))
152  {
153  ARMARX_ERROR << "Couldn't create platformUnitTarget folder";
154  return;
155  }
156 
157  const std::string kinematicUnit_output = episode_output + "kinematicUnit/";
158  if (!std::filesystem::create_directory(kinematicUnit_output))
159  {
160  ARMARX_ERROR << "Couldn't create kinematicUnit folder";
161  return;
162  }
163 
164 
165  // Successfully created folders
166  // Now export data
167  // Start with episode information
168  {
169  ARMARX_DEBUG << "Export Episode info";
170  std::filesystem::path path{ episode_output + "episode.json" };
171 
172  std::ofstream e_ofs(path);
173  e_ofs << "{\n";
174  e_ofs << "\t\"name\": \"" + m_current_episode.episodeName + "\",\n";
175  e_ofs << "\t\"status\": \"" + SimpleEpisodicMemory::episode_status_descriptor.at(m_current_episode.status) + "\",\n";
176  e_ofs << "\t\"started\": \"" + std::to_string(m_current_episode.startedInMs) + "\",\n";
177  e_ofs << "\t\"ended\": \"" + std::to_string(m_current_episode.endedInMs) + "\"\n";
178  e_ofs << "}";
179  e_ofs.close();
180  }
181 
182  // Export object information
183  {
184  ARMARX_DEBUG << "Export Object info";
185  for (const auto& objectEvent : m_current_episode.objectPoseEvents)
186  {
187  const double timestamp = objectEvent.receivedInMs;
188 
189  std::ofstream o_ofs(object_output + "obj_" + std::to_string(timestamp) + ".json");
190  o_ofs << "{\n";
191  o_ofs << "\t\"name\": \"" + objectEvent.objectName + "\",\n";
192  o_ofs << "\t\"position\": [" + std::to_string(objectEvent.x) + ", " + std::to_string(objectEvent.y) + ", " + std::to_string(objectEvent.z) + "],\n";
193  o_ofs << "\t\"started\": \"" + std::to_string(timestamp) + "\",\n";
194  o_ofs << "\t\"frame\": \"" + objectEvent.frame + "\",\n";
195  o_ofs << "\t\"type\": \"" + SimpleEpisodicMemory::object_type_descriptor.at(objectEvent.type) + "\"\n";
196  o_ofs << "}";
197  o_ofs.close();
198  }
199  }
200 
201  // Export action information
202  {
203  ARMARX_DEBUG << "Export Action info";
204  for (const auto& actionEvent : m_current_episode.actionEvents)
205  {
206  const double timestamp = actionEvent.receivedInMs;
207 
208  std::ofstream a_ofs(action_output + "act_" + std::to_string(timestamp) + ".json");
209  a_ofs << "{\n";
210  a_ofs << "\t\"name\": \"" + actionEvent.actionName + "\",\n";
211  a_ofs << "\t\"status\": \"" + SimpleEpisodicMemory::action_status_descriptor.at(actionEvent.status) + "\",\n";
212  a_ofs << "\t\"started\": \"" + std::to_string(timestamp) + "\"\n";
213  a_ofs << "}";
214  a_ofs.close();
215  }
216  }
217 
218  // Export human poses
219  {
220  ARMARX_DEBUG << "Export Human pose info";
221  for (const auto& humanPose : m_current_episode.humanPoseEvents)
222  {
223  const double timestamp = humanPose.receivedInMs;
224 
225  std::ofstream p_ofs(human_poses_output + "pose_" + std::to_string(timestamp) + ".json");
226  p_ofs << "{\n";
227 
228  for (const auto& [label, keypoint] : humanPose.keypoints)
229  {
230  p_ofs << "\t\"" + label + "\":\n";
231  p_ofs << "\t{\n";
232  p_ofs << "\t\t \"confidence\": " + std::to_string(keypoint.confidence) + ",\n";
233  p_ofs << "\t\t \"local\": [" + std::to_string(keypoint.x) + ", " + std::to_string(keypoint.y) + ", " + std::to_string(keypoint.z) + " ],\n";
234  p_ofs << "\t\t \"global\": [" + std::to_string(keypoint.globalX) + ", " + std::to_string(keypoint.globalY) + ", " + std::to_string(keypoint.globalZ) + " ]\n";
235  p_ofs << "\t},\n";
236  }
237  p_ofs << "}";
238  p_ofs.close();
239  }
240  }
241 
242  // Export speech
243  {
244  ARMARX_DEBUG << "Export Speech info";
245  for (const auto& speech : m_current_episode.speechEvents)
246  {
247  const double timestamp = speech.receivedInMs;
248 
249  std::ofstream s_ofs(speech_output + "speech_" + std::to_string(timestamp) + ".json");
250  s_ofs << "{\n";
251  s_ofs << "\t \"text\": " << speech.text << "\n";
252  s_ofs << "}";
253  s_ofs.close();
254  }
255  }
256 
257  // Export kinematicUnit
258  {
259  ARMARX_DEBUG << "Export KinematicUnit info";
260  for (const auto& kinematicUnit : m_current_episode.kinematicUnitEvents)
261  {
262  const double timestamp = kinematicUnit.receivedInMs;
263 
264  std::ofstream k_ofs(kinematicUnit_output + "kinematicUnit_" + std::to_string(timestamp) + ".json");
265  k_ofs << "{\n";
266  for (const auto& [key, value] : kinematicUnit.data)
267  {
268  k_ofs << "\t \"" + key + "\": {\n";
269  k_ofs << "\t\t \"jointAngle\": \"" << value.jointAngle << "\",\n";
270  k_ofs << "\t\t \"jointVelocity\": \"" << value.jointVelocity << "\",\n";
271  k_ofs << "\t\t \"jointTorque\": \"" << value.jointTorque << "\",\n";
272  k_ofs << "\t\t \"jointAcceleration\": \"" << value.jointAcceleration << "\",\n";
273  k_ofs << "\t\t \"current\": \"" << value.current << "\",\n";
274  k_ofs << "\t\t \"temperature\": \"" << value.temperature << "\",\n";
275  k_ofs << "\t\t \"enabled\": \"" << value.enabled << "\"\n";
276  k_ofs << "\t },\n";
277  }
278  k_ofs << "}";
279  k_ofs.close();
280  }
281  }
282 
283  // Export platformUnit
284  {
285  ARMARX_DEBUG << "Export PlatformUnit info";
286  for (const auto& platformUnit : m_current_episode.platformUnitEvents)
287  {
288  const double timestamp = platformUnit.receivedInMs;
289 
290  std::ofstream p_ofs(platformUnit_output + "platformUnit_" + std::to_string(timestamp) + ".json");
291  p_ofs << "{\n";
292  p_ofs << "\t \"x\": \"" << platformUnit.x << "\",\n";
293  p_ofs << "\t \"y\": \"" << platformUnit.y << "\",\n";
294  p_ofs << "\t \"rot\": \"" << platformUnit.rot << "\",\n";
295  p_ofs << "\t \"acc_x\": \"" << platformUnit.acc_x << "\",\n";
296  p_ofs << "\t \"acc_y\": \"" << platformUnit.acc_y << "\",\n";
297  p_ofs << "\t \"acc_rot\": \"" << platformUnit.acc_rot << "\"\n";
298  p_ofs << "}";
299  p_ofs.close();
300  }
301  }
302 
303  // Export platformUnitTarget
304  {
305  ARMARX_DEBUG << "Export PlatformUnitTarget info";
306  for (const auto& platformUnitTarget : m_current_episode.platformUnitTargetEvents)
307  {
308  const double timestamp = platformUnitTarget.receivedInMs;
309 
310  std::ofstream t_ofs(platformUnitTarget_output + "platformUnitTarget_" + std::to_string(timestamp) + ".json");
311  t_ofs << "{\n";
312  t_ofs << "\t \"x\": \"" << platformUnitTarget.target_x << "\",\n";
313  t_ofs << "\t \"y\": \"" << platformUnitTarget.target_y << "\",\n";
314  t_ofs << "\t \"rot\": \"" << platformUnitTarget.target_rot << "\"\n";
315  t_ofs << "}";
316  t_ofs.close();
317  }
318  }
319 
320 
321  // Export image information
322  {
323  ARMARX_DEBUG << "Export Image info";
324  for (const auto& [imageProvider, imageEventList] : m_current_episode.imageEvents)
325  {
326  if (imageEventList.size() == 0)
327  {
328  continue;
329  }
330  const std::string image_provider_output = camera_output + imageProvider + "/";
331  if (!std::filesystem::create_directory(image_provider_output))
332  {
333  ARMARX_ERROR << "Couldn't create image provider folder: " + imageProvider;
334  return;
335  }
336 
337  for (const auto& imageEvent : imageEventList)
338  {
339  const double timestamp = imageEvent.receivedInMs;
340 
341  auto mode = CV_8UC3;
342  if (imageEvent.colourType == memoryx::ColourSpace::GRAYSCALE)
343  {
344  mode = CV_8UC1;
345  }
346  std::vector<uchar> data(imageEvent.data);
347  ARMARX_DEBUG << "Image size is " << imageEvent.width << ", " << imageEvent.height << ", " << imageEvent.colourType << " => " << imageEvent.data.size();
348  cv::Mat cv_image = cv::Mat(imageEvent.height, imageEvent.width, mode, data.data());
349 
350  cv::cvtColor(cv_image, cv_image, cv::COLOR_RGB2BGR);
351  cv::imwrite(image_provider_output + "img_" + std::to_string(timestamp) + ".jpg", cv_image);
352  ARMARX_DEBUG << "Exporting image to: img_" + std::to_string(timestamp) + ".jpg";
353  }
354  }
355  }
356  }
357  else
358  {
359  ARMARX_ERROR << "Cannot export files because folder does not exist: " << m_export_folder;
360  }
361  }
362 
363  void SimpleEpisodicMemory::clearAll()
364  {
365  ARMARX_DEBUG << "Resetting episode info to default.";
366  m_current_episode.episodeName = NO_EPISODE;
367  m_current_episode.startedInMs = IceUtil::Time::now().toMilliSecondsDouble();
368  m_current_episode.status = EpisodeStatus::EPISODE_STARTED;
369  }
370 
371  void SimpleEpisodicMemory::registerEpisodeEvent(const EpisodeEvent& e, const Ice::Current& c)
372  {
373  std::lock_guard<std::mutex> l(episodeEventMutex);
374  if (m_current_episode.episodeName != e.episodeName && e.status != EPISODE_STARTED)
375  {
376  ARMARX_ERROR << "Received an episode unequal to current one with non-starting status: " << e.episodeName;
377  }
378  if (m_current_episode.episodeName != e.episodeName && m_current_episode.endedInMs != 0 && e.status == EPISODE_STARTED)
379  {
380  ARMARX_WARNING << "Received a new starting episode without ending the last one. Last episodes name is " << m_current_episode.episodeName << ". Finishing it now.";
381  EpisodeEvent abort;
382  abort.episodeName = m_current_episode.episodeName;
383  abort.status = EpisodeStatus::EPISODE_COMPLETED_ABORT;
384  abort.receivedInMs = IceUtil::Time::now().toMilliSecondsDouble();
385  registerEpisodeEvent(abort, c);
386  }
387 
388  if (e.status == EPISODE_COMPLETED_SUCCESS || e.status == EPISODE_COMPLETED_FAILURE || e.status == EPISODE_COMPLETED_ABORT)
389  {
390  ARMARX_DEBUG << "Received a terminating episode (" << e.episodeName << ")";
391  m_current_episode.status = e.status;
392  m_current_episode.endedInMs = e.receivedInMs;
393  }
394  else //if (e.status == EPISODE_STARTED)
395  {
396  ARMARX_DEBUG << "Received a starting episode (" << e.episodeName << ")";
397  m_current_episode.episodeName = e.episodeName;
398  m_current_episode.status = e.status;
399  m_current_episode.startedInMs = e.receivedInMs;
400  }
401 
402  std::lock_guard<std::mutex> l2(imageEventMutex);
403  std::lock_guard<std::mutex> l3(humanPoseEventMutex);
404  std::lock_guard<std::mutex> l4(speechEventMutex);
405  std::lock_guard<std::mutex> l5(objectPoseEventMutex);
406  std::lock_guard<std::mutex> l6(kinematicUnitEventMutex);
407  std::lock_guard<std::mutex> l7(platformUnitEventMutex);
408  std::lock_guard<std::mutex> l8(platformUnitTargetEventMutex);
409  std::lock_guard<std::mutex> l9(actionEventMutex);
410  if (m_enable_export && m_current_episode.endedInMs != 0)
411  {
412  ARMARX_DEBUG << "Exporting episode...";
413  export_episode();
414  clearAll();
415  }
416  }
417 
418  void SimpleEpisodicMemory::registerImageEvent(const ImageEvent& i, const Ice::Current& c)
419  {
420  std::lock_guard<std::mutex> l(imageEventMutex);
421  ARMARX_DEBUG << "Received an image. Current number of images of provider " << i.providerName << " in episode: " << this->m_current_episode.imageEvents[i.providerName].size();
422  this->m_current_episode.imageEvents[i.providerName].push_back(i);
423  }
424 
425  void SimpleEpisodicMemory::registerObjectPoseEvent(const ObjectPoseEvent& o, const Ice::Current& c)
426  {
427  std::lock_guard<std::mutex> l(objectPoseEventMutex);
428  ARMARX_DEBUG << "Received an objectPose (" << o.objectName << "). Current number of objectPoses in episode: " << this->m_current_episode.objectPoseEvents.size();
429  this->m_current_episode.objectPoseEvents.push_back(o);
430  }
431 
432  void SimpleEpisodicMemory::registerActionEvent(const ActionEvent& a, const Ice::Current& c)
433  {
434  std::lock_guard<std::mutex> l(actionEventMutex);
435  ARMARX_DEBUG << "Received an action (" << a.actionName << " with status " << SimpleEpisodicMemory::action_status_descriptor.at(a.status) << ")Current number of actions in episode: " << this->m_current_episode.actionEvents.size();
436  this->m_current_episode.actionEvents.push_back(a);
437  }
438 
439  void SimpleEpisodicMemory::registerHumanPoseEvent(const Body25HumanPoseEvent& p, const Ice::Current&)
440  {
441  std::lock_guard<std::mutex> l(humanPoseEventMutex);
442  ARMARX_DEBUG << "Received a human pose. Current number of poses in episode: " << this->m_current_episode.humanPoseEvents.size();
443  this->m_current_episode.humanPoseEvents.push_back(p);
444  }
445 
446  void SimpleEpisodicMemory::registerSpeechEvent(const SpeechEvent& s, const Ice::Current&)
447  {
448  if (s.text.find("export now") != std::string::npos)
449  {
450  ARMARX_IMPORTANT << "Received export token!. Terminating current episode and create an empty new one.";
451  EpisodeEvent terminate;
452  terminate.episodeName = m_current_episode.episodeName;
453  terminate.status = EpisodeStatus::EPISODE_COMPLETED_ABORT;
454  terminate.receivedInMs = IceUtil::Time::now().toMilliSecondsDouble();
456  return;
457  }
458 
459  std::lock_guard<std::mutex> l(speechEventMutex);
460  ARMARX_DEBUG << "Received spoken text (" << s.text << "). Current number of speeches in episode: " << this->m_current_episode.speechEvents.size();
461  this->m_current_episode.speechEvents.push_back(s);
462  }
463 
464  void SimpleEpisodicMemory::registerKinematicUnitEvent(const KinematicUnitEvent& k, const Ice::Current&)
465  {
466  std::lock_guard<std::mutex> l(kinematicUnitEventMutex);
467  ARMARX_DEBUG << "Received a kinematicUnitEvent. Current number of events in episode: " << this->m_current_episode.kinematicUnitEvents.size();
468  this->m_current_episode.kinematicUnitEvents.push_back(k);
469  }
470 
471  void SimpleEpisodicMemory::registerPlatformUnitEvent(const PlatformUnitEvent& p, const Ice::Current&)
472  {
473  std::lock_guard<std::mutex> l(platformUnitEventMutex);
474  ARMARX_DEBUG << "Received a platformUnitEvent. Current number of events in episode: " << this->m_current_episode.platformUnitEvents.size();
475  this->m_current_episode.platformUnitEvents.push_back(p);
476  }
477 
478  void SimpleEpisodicMemory::registerPlatformUnitTargetEvent(const PlatformUnitTargetEvent& t, const Ice::Current&)
479  {
480  std::lock_guard<std::mutex> l(platformUnitTargetEventMutex);
481  ARMARX_DEBUG << "Received a platformUnitTarget. Current number of events in episode: " << this->m_current_episode.platformUnitTargetEvents.size();
482  this->m_current_episode.platformUnitTargetEvents.push_back(t);
483  }
484 
485  void SimpleEpisodicMemory::notifyKeyframe(const Ice::Current& c)
486  {
487 
488  }
489 
491  {
493 
494  //def->bool(m_enable_export, "EnableExport");
495  return def;
496  }
497 
498 }
memoryx::SimpleEpisodicMemory::registerObjectPoseEvent
void registerObjectPoseEvent(const ObjectPoseEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:425
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
SimpleEpisodicMemory.h
memoryx::SimpleEpisodicMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimpleEpisodicMemory.cpp:490
memoryx::SimpleEpisodicMemory::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: SimpleEpisodicMemory.cpp:76
memoryx::SimpleEpisodicMemory::object_type_descriptor
static const std::map< ObjectPoseEventType, std::string > object_type_descriptor
Definition: SimpleEpisodicMemory.h:52
memoryx::SimpleEpisodicMemory::registerSpeechEvent
void registerSpeechEvent(const SpeechEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:446
memoryx::SimpleEpisodicMemory::action_status_descriptor
static const std::map< ActionStatus, std::string > action_status_descriptor
Definition: SimpleEpisodicMemory.h:51
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::SimpleEpisodicMemory::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: SimpleEpisodicMemory.cpp:80
memoryx::SimpleEpisodicMemory::registerImageEvent
void registerImageEvent(const ImageEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:418
memoryx::SimpleEpisodicMemory::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: SimpleEpisodicMemory.cpp:65
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
memoryx::SimpleEpisodicMemory::registerHumanPoseEvent
void registerHumanPoseEvent(const Body25HumanPoseEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:439
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
memoryx::SimpleEpisodicMemory::registerActionEvent
void registerActionEvent(const ActionEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:432
armarx::ManagedIceObject::terminate
void terminate()
Initiates termination of this IceManagedObject.
Definition: ManagedIceObject.cpp:420
memoryx::SimpleEpisodicMemory::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: SimpleEpisodicMemory.cpp:71
memoryx::SimpleEpisodicMemory::episode_status_descriptor
static const std::map< EpisodeStatus, std::string > episode_status_descriptor
Definition: SimpleEpisodicMemory.h:50
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
memoryx::SimpleEpisodicMemory::registerEpisodeEvent
void registerEpisodeEvent(const EpisodeEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:371
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
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
IceUtil::Handle< class PropertyDefinitionContainer >
memoryx::SimpleEpisodicMemory::registerKinematicUnitEvent
void registerKinematicUnitEvent(const KinematicUnitEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:464
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
memoryx::SimpleEpisodicMemory::registerPlatformUnitEvent
void registerPlatformUnitEvent(const PlatformUnitEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:471
memoryx::SimpleEpisodicMemory::registerPlatformUnitTargetEvent
void registerPlatformUnitTargetEvent(const PlatformUnitTargetEvent &, const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:478
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
memoryx::SimpleEpisodicMemory::notifyKeyframe
void notifyKeyframe(const Ice::Current &=Ice::emptyCurrent) override
Definition: SimpleEpisodicMemory.cpp:485
memoryx::SimpleEpisodicMemory::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: SimpleEpisodicMemory.cpp:60