SkillManagerComponentPlugin.cpp
Go to the documentation of this file.
2 
6 
10 
11 namespace armarx::plugins
12 {
13  void
15  {
16  }
17 
18  void
20  {
21  auto& p = parent<SkillManagerComponentPluginUser>();
22  p.getProxy(myPrx, -1);
23  }
24 
25  void
27  {
28  }
29 
32  {
33  // NON LOCKING! WE ASSERT THAT THE CALLER HOLDS LOCK
34  for (const auto& [providerName, providerPrx] : skillProviderMap)
35  {
36  auto allSkills = providerPrx->getSkillDescriptions();
37  for (const auto& [currentSkillID, skillDesc] : allSkills)
38  {
39  if (currentSkillID.skillName == skillId.skillName)
40  {
41  return {providerName};
42  }
43  }
44  }
45  return {"INVALID PROVIDER NAME"};
46  }
47 
48  void
50  {
51  std::scoped_lock l(skillProviderMapMutex);
52  if (skillProviderMap.find(providerInfo.providerId) == skillProviderMap.end())
53  {
54  ARMARX_INFO << "Adding a provider with name '" << providerInfo.providerId.providerName
55  << "'.";
56  skillProviderMap.insert({providerInfo.providerId, providerInfo.providerInterface});
57  }
58  else
59  {
60  ARMARX_INFO << "Trying to add a provider with name '"
61  << providerInfo.providerId.providerName
62  << "' but the provider already exists. "
63  << "Overwriting the old provider info.";
64  skillProviderMap[providerInfo.providerId] = providerInfo.providerInterface;
65  }
66  }
67 
68  void
70  {
71  std::scoped_lock l(skillProviderMapMutex);
72  if (auto it = skillProviderMap.find(providerId); it != skillProviderMap.end())
73  {
74  ARMARX_INFO << "Removing a provider with name '" << providerId.providerName << "'.";
75  skillProviderMap.erase(it);
76  }
77  else
78  {
79  ARMARX_INFO << "Trying to remove a provider with name '" << providerId.providerName
80  << "' but it couldn't be found.";
81  }
82  }
83 
86  {
87  ARMARX_CHECK(executionRequest.skillId.isFullySpecified())
88  << "Got: " << executionRequest.skillId.toString();
89 
90  std::unique_lock l(skillProviderMapMutex);
91 
92  skills::ProviderID provderId(*executionRequest.skillId.providerId);
93 
94  // TODO: Really support regexes!
95  if (executionRequest.skillId.providerId->providerName == "*")
96  {
97  provderId = getFirstProviderNameThatHasSkill(executionRequest.skillId);
98  }
99 
100 
101  if (auto it = skillProviderMap.find(provderId); it != skillProviderMap.end())
102  {
103  const auto& provider = it->second;
104 
105  if (!provider)
106  {
107  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
108  << provderId << "'. Removing it from skills.";
109  skillProviderMap.erase(it);
110 
112  __PRETTY_FUNCTION__,
113  "Skill execution failed. Could not execute a skill of provider '" +
114  provderId.toString() + "' because the provider does not exist.");
115  }
116 
117  try
118  {
119  skills::SkillExecutionRequest provider_executionRequest{
120  .skillId = executionRequest.skillId,
121  .executorName = executionRequest.executorName,
122  .parameters = executionRequest.parameters,
123  .callbackInterface = myPrx};
124 
125  auto async =
126  provider->begin_executeSkill(provider_executionRequest.toProviderIce());
127  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
128  auto provider_statusUpdate_ice = provider->end_executeSkill(async);
129 
130  // convert to manager view
131  auto statusUpdate =
132  skills::SkillStatusUpdate::FromIce(provider_statusUpdate_ice, provderId);
133  return statusUpdate;
134  }
135  catch (const std::exception &e)
136  {
137  l.lock();
138 
139  handleExceptionNonLockingThrow(__PRETTY_FUNCTION__, e, provderId);
140  }
141  }
142  else
143  {
145  __PRETTY_FUNCTION__,
146  "Skill execution failed. Could not execute a skill of provider '" +
147  provderId.toString() + "' because the provider does not exist.");
148  }
149  }
150 
153  const skills::SkillExecutionRequest& executionRequest)
154  {
155  ARMARX_CHECK(executionRequest.skillId.isFullySpecified())
156  << "Got: " << executionRequest.skillId.toString();
157 
158  std::unique_lock l(skillProviderMapMutex);
159 
160  skills::ProviderID provderId(*executionRequest.skillId.providerId);
161 
162  // TODO: Really support regexes!
163  if (executionRequest.skillId.providerId->providerName == "*")
164  {
165  provderId = getFirstProviderNameThatHasSkill(executionRequest.skillId);
166  }
167 
168 
169  if (auto it = skillProviderMap.find(provderId); it != skillProviderMap.end())
170  {
171  const auto& provider = it->second;
172 
173  if (!provider)
174  {
175  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
176  << provderId << "'. Removing it from skills.";
177  skillProviderMap.erase(it);
178 
180  __PRETTY_FUNCTION__,
181  "Skill execution failed. Could not execute a skill of provider '" +
182  provderId.toString() + "' because the provider does not exist.");
183  }
184 
185  try
186  {
187  skills::SkillExecutionRequest provider_executionRequest{
188  .skillId = executionRequest.skillId,
189  .executorName = executionRequest.executorName,
190  .parameters = executionRequest.parameters,
191  .callbackInterface = myPrx};
192 
193  auto async =
194  provider->begin_executeSkillAsync(provider_executionRequest.toProviderIce());
195  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
196  auto provider_executionID_ice = provider->end_executeSkillAsync(async);
197 
198  // convert to manager view
199  auto executionId =
200  skills::SkillExecutionID::FromIce(provider_executionID_ice, provderId);
201  executionId.skillId.providerId = provderId;
202  return executionId;
203  }
204  catch (const std::exception &e)
205  {
206  l.lock();
207 
208  handleExceptionNonLockingThrow(__PRETTY_FUNCTION__, e, provderId);
209  }
210  }
211  else
212  {
214  __PRETTY_FUNCTION__,
215  "Skill execution failed. Could not execute a skill of provider '" +
216  provderId.toString() + "' because the provider does not exist.");
217  }
218  }
219 
220  bool
222  const aron::data::DictPtr& data)
223  {
224  ARMARX_DEBUG << "updateSkillParameters for skill " << executionId.skillId;
225 
226  ARMARX_CHECK(executionId.skillId.isFullySpecified())
227  << "Got: " << executionId.skillId.toString();
228 
229  std::unique_lock l(skillProviderMapMutex);
230  if (auto it = skillProviderMap.find(*executionId.skillId.providerId);
231  it != skillProviderMap.end())
232  {
233  const auto& providerId = it->first;
234  const auto& provider = it->second;
235 
236  if (!provider)
237  {
238  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
239  << providerId << "'. Removing it from skills.";
240  skillProviderMap.erase(it);
241  return false;
242  }
243 
244  try
245  {
246  auto async = provider->begin_updateSkillParameters(executionId.toProviderIce(),
247  data->toAronDictDTO());
248  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
249  auto r = provider->end_updateSkillParameters(async);
250  return r.success;
251  }
252  catch (const std::exception &e)
253  {
254  l.lock();
255 
256  handleExceptionNonLocking(__PRETTY_FUNCTION__, e, providerId);
257 
258  return false;
259  }
260  }
261  else
262  {
263  return false;
264  }
265  }
266 
267  bool
269  {
270  ARMARX_DEBUG << "abortSkill for skill " << executionId.skillId;
271 
272  ARMARX_CHECK(executionId.skillId.isFullySpecified())
273  << "Got: " << executionId.skillId.toString();
274 
275  std::unique_lock l(skillProviderMapMutex);
276  if (auto it = skillProviderMap.find(*executionId.skillId.providerId);
277  it != skillProviderMap.end())
278  {
279  const auto& providerId = it->first;
280  const auto& provider = it->second;
281 
282  if (!provider)
283  {
284  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
285  << providerId << "'. Removing it from skills.";
286  skillProviderMap.erase(it);
287  return false;
288  }
289 
290  try
291  {
292  auto async = provider->begin_abortSkill(executionId.toProviderIce());
293  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
294  auto r = provider->end_abortSkill(async);
295  return r.success;
296  }
297  catch (const std::exception &e)
298  {
299  l.lock();
300 
301  handleExceptionNonLocking(__PRETTY_FUNCTION__, e, providerId);
302 
303  return false;
304  }
305  }
306  else
307  {
308  return false;
309  }
310  }
311 
312  bool
314  {
315  ARMARX_CHECK(executionId.skillId.isFullySpecified())
316  << "Got: " << executionId.skillId.toString();
317 
318  std::unique_lock l(skillProviderMapMutex);
319  if (auto it = skillProviderMap.find(*executionId.skillId.providerId);
320  it != skillProviderMap.end())
321  {
322  const auto& providerId = it->first;
323  const auto& provider = it->second;
324 
325  if (!provider)
326  {
327  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
328  << providerId << "'. Removing it from skills.";
329  skillProviderMap.erase(it);
330  return false;
331  }
332 
333  try
334  {
335  auto async = provider->begin_abortSkill(executionId.toProviderIce());
336  return true;
337  }
338  catch (const std::exception &e)
339  {
340  handleExceptionNonLocking(__PRETTY_FUNCTION__, e, providerId);
341 
342  return false;
343  }
344  }
345  else
346  {
347  return false;
348  }
349  }
350 
351  std::optional<skills::SkillDescription>
353  {
354  ARMARX_DEBUG << "getSkillDescription for skill " << skillId;
355 
356  ARMARX_CHECK(skillId.isFullySpecified()) << "Got: " << skillId.toString();
357 
358  std::unique_lock l(skillProviderMapMutex);
359  if (auto it = skillProviderMap.find(*skillId.providerId); it != skillProviderMap.end())
360  {
361  const auto& providerId = it->first;
362  const auto& provider = it->second;
363 
364  if (!provider)
365  {
366  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
367  << providerId << "'. Removing it from skills.";
368  skillProviderMap.erase(it);
369 
370  throw skills::error::SkillException(__PRETTY_FUNCTION__,
371  "Skill execution failed. Could not query a "
372  "status update of a skill of provider '" +
373  providerId.toString() +
374  "' because the provider does not exist.");
375  }
376 
377  try
378  {
379  auto async = provider->begin_getSkillDescription(skillId.toProviderIce());
380  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
381  auto provider_desc_ice = provider->end_getSkillDescription(async);
382 
383  if (not provider_desc_ice)
384  {
385  return std::nullopt;
386  }
387 
388  // convert to manager view
389  auto desc =
390  skills::SkillDescription::FromIce(provider_desc_ice.value(), providerId);
391  return desc;
392  }
393  catch (const std::exception &e)
394  {
395  handleExceptionNonLockingThrow(__PRETTY_FUNCTION__, e, providerId);
396  }
397  }
398  else
399  {
400  return std::nullopt;
401  }
402  }
403 
404  std::map<skills::SkillID, skills::SkillDescription>
406  {
407  std::map<skills::SkillID, skills::SkillDescription> ret;
408 
409  std::scoped_lock l(skillProviderMapMutex);
410  for (auto it = skillProviderMap.cbegin(); it != skillProviderMap.cend();)
411  {
412  const auto& providerId = it->first;
413  const auto& provider = it->second;
414 
415  if (!provider)
416  {
417  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
418  << providerId << "'. Removing it from skills.";
419  it = skillProviderMap.erase(it);
420  continue;
421  }
422 
423  try
424  {
425  skills::provider::dto::SkillDescriptionMap m = provider->getSkillDescriptions();
426 
427  for (const auto& [provider_skillId_ice, skillDescription_ice] : m)
428  {
429  ret.insert(
430  {skills::SkillID::FromIce(provider_skillId_ice, providerId),
431  skills::SkillDescription::FromIce(skillDescription_ice, providerId)});
432  }
433 
434  ++it;
435  }
436  catch (const std::exception &e)
437  {
438  if (auto _it = handleExceptionNonLocking(__PRETTY_FUNCTION__, e, providerId))
439  {
440  it = _it.value(); // next element
441  }
442  }
443  }
444  return ret;
445  }
446 
447  std::optional<skills::SkillStatusUpdate>
449  const skills::SkillExecutionID& executionId)
450  {
451  ARMARX_CHECK(executionId.skillId.isFullySpecified())
452  << "Got: " << executionId.skillId.toString();
453 
454  std::unique_lock l(skillProviderMapMutex);
455  if (auto it = skillProviderMap.find(*executionId.skillId.providerId);
456  it != skillProviderMap.end())
457  {
458  const auto& providerId = it->first;
459  const auto& provider = it->second;
460 
461  if (!provider)
462  {
463  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
464  << providerId << "'. Removing it from skills.";
465  skillProviderMap.erase(it);
466 
467  throw skills::error::SkillException(__PRETTY_FUNCTION__,
468  "Skill execution failed. Could not query a "
469  "status update of a skill of provider '" +
470  providerId.toString() +
471  "' because the provider does not exist.");
472  }
473 
474  try
475  {
476  auto async = provider->begin_getSkillExecutionStatus(executionId.toProviderIce());
477  l.unlock(); // allow parallel e.g. stopping. Otherwise the manager would lock himself in nested calls
478  auto provider_statusUpdate_ice = provider->end_getSkillExecutionStatus(async);
479 
480  if (not provider_statusUpdate_ice)
481  {
482  return std::nullopt;
483  }
484 
485  // convert to manager view
486  auto statusUpdate = skills::SkillStatusUpdate::FromIce(
487  provider_statusUpdate_ice.value(), providerId);
488  return statusUpdate;
489  }
490  catch (const std::exception &e)
491  {
492  l.lock();
493 
494  handleExceptionNonLockingThrow(__PRETTY_FUNCTION__, e, providerId);
495  }
496  }
497  else
498  {
499  return std::nullopt;
500  }
501  }
502 
503  std::map<skills::SkillExecutionID, skills::SkillStatusUpdate>
505  {
506  std::map<skills::SkillExecutionID, skills::SkillStatusUpdate> ret;
507 
508  std::scoped_lock l(skillProviderMapMutex);
509  for (auto it = skillProviderMap.cbegin(); it != skillProviderMap.cend();)
510  {
511  const auto& providerId = it->first;
512  const auto& provider = it->second;
513 
514  if (!provider)
515  {
516  ARMARX_WARNING << __PRETTY_FUNCTION__ << ": Found disconnected skill provider '"
517  << providerId << "'. Removing it from skills.";
518  it = skillProviderMap.erase(it);
519  continue;
520  }
521 
522  try
523  {
524  auto m = provider->getSkillExecutionStatuses();
525 
526  for (const auto& [provider_executionId_ice, provider_statusUpdate_ice] : m)
527  {
528  ret.insert(
529  {skills::SkillExecutionID::FromIce(provider_executionId_ice, providerId),
530  skills::SkillStatusUpdate::FromIce(provider_statusUpdate_ice,
531  providerId)});
532  }
533  it++;
534  }
535  catch (const std::exception &e)
536  {
537  if (auto _it = handleExceptionNonLocking(__PRETTY_FUNCTION__, e, providerId))
538  {
539  it = _it.value(); // next element
540  }
541  }
542  }
543  return ret;
544  }
545 
546  std::optional<std::map<skills::ProviderID, skills::provider::dti::SkillProviderInterfacePrx>::iterator>
547  SkillManagerComponentPlugin::handleExceptionNonLocking(
548  const char* funcName, const std::exception& e, skills::ProviderID providerId, bool eraseSkillProvider)
549  {
550  // NON LOCKING! WE ASSERT THAT THE CALLER HOLDS LOCK
551  if (auto it = skillProviderMap.find(providerId); eraseSkillProvider and it != skillProviderMap.end())
552  {
553  ARMARX_WARNING << funcName
554  << ": Found disconnected or buggy skill provider '" << providerId
555  << "' during execution. Removing it from skills. "
556  << "Error: " << e.what();
557  return skillProviderMap.erase(it);
558  }
559  else
560  {
561  ARMARX_WARNING << funcName
562  << ": Found disconnected or buggy skill provider '" << providerId
563  << "' during execution. However, it already got removed... "
564  << "Error: " << e.what();
565  return std::nullopt;
566  }
567  }
568 
569  void
570  SkillManagerComponentPlugin::handleExceptionNonLockingThrow(
571  const char* funcName, const std::exception& e, skills::ProviderID providerId, bool eraseSkillProvider)
572  {
573  // NON LOCKING! WE ASSERT THAT THE CALLER HOLDS LOCK
574  handleExceptionNonLocking(funcName, e, providerId, eraseSkillProvider);
575 
576  throw skills::error::SkillException(
577  funcName,
578  "Skill execution failed. Could not execute a skill of provider '" +
579  providerId.toString() + "' because the provider does not exist.");
580  }
581 
582 } // namespace armarx::plugins
583 
584 namespace armarx
585 {
587  {
588  addPlugin(plugin);
589  }
590 
591  void
592  SkillManagerComponentPluginUser::addProvider(const skills::manager::dto::ProviderInfo& info,
593  const Ice::Current&)
594  {
595  auto i = skills::ProviderInfo::FromIce(info);
596  this->plugin->addProvider(i);
597  }
598 
599  void
601  const skills::manager::dto::ProviderID& provider,
602  const Ice::Current&)
603  {
604  auto i = skills::ProviderID::FromIce(provider);
605  this->plugin->removeProvider(i);
606  }
607 
608  skills::manager::dto::SkillStatusUpdate
610  const skills::manager::dto::SkillExecutionRequest& info,
611  const Ice::Current&)
612  {
614  return this->plugin->executeSkill(e).toManagerIce();
615  }
616 
617  skills::manager::dto::SkillExecutionID
619  const skills::manager::dto::SkillExecutionRequest& info,
620  const Ice::Current& current)
621  {
623  return this->plugin->executeSkillAsync(e).toManagerIce();
624  }
625 
626  skills::provider::dto::ParameterUpdateResult
628  const skills::manager::dto::SkillExecutionID& info,
629  const aron::data::dto::DictPtr& params,
630  const Ice::Current& current)
631  {
632  skills::provider::dto::ParameterUpdateResult ret;
634  auto e = skills::SkillExecutionID::FromIce(info);
635  ret.success = this->plugin->updateSkillParameters(e, a);
636  return ret;
637  }
638 
639  skills::provider::dto::AbortSkillResult
640  SkillManagerComponentPluginUser::abortSkill(const skills::manager::dto::SkillExecutionID& id,
641  const Ice::Current& current)
642  {
643  skills::provider::dto::AbortSkillResult ret;
645  ret.success = this->plugin->abortSkill(i);
646  return ret;
647  }
648 
649  skills::provider::dto::AbortSkillResult
651  const skills::manager::dto::SkillExecutionID& id,
652  const Ice::Current& /*unused*/)
653  {
654  skills::provider::dto::AbortSkillResult ret;
656  ret.success = this->plugin->abortSkillAsync(i);
657  return ret;
658  }
659 
660  void
662  const skills::provider::dto::SkillStatusUpdate& statusUpdate,
663  const skills::callback::dto::ProviderID& pid,
664  const Ice::Current&)
665  {
666  (void)statusUpdate;
667  (void)pid;
668  // If you want to use the status, implement this method!
669  }
670 
671  skills::manager::dto::SkillDescriptionMap
673  {
674  skills::manager::dto::SkillDescriptionMap ret;
675 
676  auto m = this->plugin->getSkillDescriptions();
677 
678  for (const auto& [k, v] : m)
679  {
680  ret.insert({k.toManagerIce(), v.toManagerIce()});
681  }
682 
683  return ret;
684  }
685 
686  IceUtil::Optional<skills::manager::dto::SkillDescription>
687  SkillManagerComponentPluginUser::getSkillDescription(const skills::manager::dto::SkillID& id,
688  const Ice::Current& current)
689  {
690  auto e = skills::SkillID::FromIce(id);
691  auto o = this->plugin->getSkillDescription(e);
692  if (o.has_value())
693  {
694  return o->toManagerIce();
695  }
696  return {};
697  }
698 
699  IceUtil::Optional<skills::manager::dto::SkillStatusUpdate>
701  const skills::manager::dto::SkillExecutionID& executionId,
702  const Ice::Current& current)
703  {
704  auto e = skills::SkillExecutionID::FromIce(executionId);
705  auto o = this->plugin->getSkillExecutionStatus(e);
706  if (o.has_value())
707  {
708  return o->toManagerIce();
709  }
710  return {};
711  }
712 
713  skills::manager::dto::SkillStatusUpdateMap
715  {
716  skills::manager::dto::SkillStatusUpdateMap ret;
717 
718  auto m = this->plugin->getSkillExecutionStatuses();
719 
720  for (const auto& [k, v] : m)
721  {
722  ret.insert({k.toManagerIce(), v.toManagerIce()});
723  }
724 
725  return ret;
726  }
727 } // namespace armarx
armarx::skills::SkillExecutionID
Definition: SkillExecutionID.h:19
armarx::skills::ProviderID::toString
std::string toString() const
Definition: ProviderID.cpp:56
armarx::skills::SkillID::toString
std::string toString() const
Definition: SkillID.cpp:64
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
armarx::skills::SkillStatusUpdate::toManagerIce
manager::dto::SkillStatusUpdate toManagerIce() const
Definition: SkillStatusUpdate.cpp:287
Exception.h
SkillStatusUpdate.h
armarx::skills::SkillStatusUpdate::FromIce
static SkillStatusUpdate FromIce(const provider::dto::SkillStatusUpdate &update, const std::optional< skills::ProviderID > &providerId=std::nullopt)
Definition: SkillStatusUpdate.cpp:367
armarx::skills::SkillExecutionRequest::skillId
skills::SkillID skillId
Definition: SkillExecutionRequest.h:33
SkillID.h
armarx::SkillManagerComponentPluginUser::getSkillExecutionStatus
IceUtil::Optional< skills::manager::dto::SkillStatusUpdate > getSkillExecutionStatus(const skills::manager::dto::SkillExecutionID &executionId, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:700
armarx::SkillManagerComponentPluginUser::executeSkill
skills::manager::dto::SkillStatusUpdate executeSkill(const skills::manager::dto::SkillExecutionRequest &info, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:609
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
armarx::plugins::SkillManagerComponentPlugin::getSkillDescription
std::optional< skills::SkillDescription > getSkillDescription(const skills::SkillID &id)
Definition: SkillManagerComponentPlugin.cpp:352
DateTime.h
armarx::skills::SkillExecutionRequest::FromIce
static SkillExecutionRequest FromIce(const manager::dto::SkillExecutionRequest &)
Definition: SkillExecutionRequest.cpp:29
armarx::skills::ProviderID::providerName
std::string providerName
Definition: ProviderID.h:31
armarx::SkillManagerComponentPluginUser::getSkillDescriptions
skills::manager::dto::SkillDescriptionMap getSkillDescriptions(const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:672
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition: SkillID.h:59
armarx::skills::ProviderInfo::FromIce
static ProviderInfo FromIce(const manager::dto::ProviderInfo &)
Definition: ProviderInfo.cpp:22
armarx::plugins::SkillManagerComponentPlugin::getSkillDescriptions
std::map< skills::SkillID, skills::SkillDescription > getSkillDescriptions()
Definition: SkillManagerComponentPlugin.cpp:405
ice_conversions.h
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::plugins::SkillManagerComponentPlugin::abortSkill
bool abortSkill(const skills::SkillExecutionID &id)
Definition: SkillManagerComponentPlugin.cpp:268
armarx::SkillManagerComponentPluginUser::executeSkillAsync
skills::manager::dto::SkillExecutionID executeSkillAsync(const skills::manager::dto::SkillExecutionRequest &skillExecutionRequest, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:618
armarx::skills::SkillExecutionID::toProviderIce
skills::provider::dto::SkillExecutionID toProviderIce() const
Definition: SkillExecutionID.cpp:19
armarx::aron::data::Dict::FromAronDictDTO
static PointerType FromAronDictDTO(const data::dto::DictPtr &aron)
Definition: Dict.cpp:129
armarx::SkillManagerComponentPluginUser::getSkillExecutionStatuses
skills::manager::dto::SkillStatusUpdateMap getSkillExecutionStatuses(const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:714
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
SkillManagerComponentPlugin.h
armarx::skills::SkillExecutionID::toManagerIce
skills::manager::dto::SkillExecutionID toManagerIce() const
Definition: SkillExecutionID.cpp:9
armarx::plugins::SkillManagerComponentPlugin::executeSkill
skills::SkillStatusUpdate executeSkill(const skills::SkillExecutionRequest &req)
Definition: SkillManagerComponentPlugin.cpp:85
armarx::skills::SkillExecutionRequest
Definition: SkillExecutionRequest.h:21
armarx::skills::ProviderInfo::providerInterface
provider::dti::SkillProviderInterfacePrx providerInterface
Definition: ProviderInfo.h:23
armarx::plugins::SkillManagerComponentPlugin::removeProvider
void removeProvider(const skills::ProviderID &id)
Definition: SkillManagerComponentPlugin.cpp:69
armarx::skills::SkillStatusUpdate
Definition: SkillStatusUpdate.h:139
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
armarx::SkillManagerComponentPluginUser::getSkillDescription
IceUtil::Optional< skills::manager::dto::SkillDescription > getSkillDescription(const skills::manager::dto::SkillID &id, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:687
armarx::skills::ProviderID
Definition: ProviderID.h:15
armarx::SkillManagerComponentPluginUser::abortSkill
skills::provider::dto::AbortSkillResult abortSkill(const skills::manager::dto::SkillExecutionID &id, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:640
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::plugins::SkillManagerComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: SkillManagerComponentPlugin.cpp:19
armarx::plugins::SkillManagerComponentPlugin::updateSkillParameters
bool updateSkillParameters(const skills::SkillExecutionID &id, const aron::data::DictPtr &data)
Definition: SkillManagerComponentPlugin.cpp:221
armarx::skills::error::SkillException
A base class for skill exceptions.
Definition: Exception.h:40
armarx::skills::SkillID::FromIce
static SkillID FromIce(const manager::dto::SkillID &)
Definition: SkillID.cpp:32
armarx::SkillManagerComponentPluginUser::removeProvider
void removeProvider(const skills::manager::dto::ProviderID &provider, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:600
Component.h
armarx::plugins::SkillManagerComponentPlugin::getSkillExecutionStatus
std::optional< skills::SkillStatusUpdate > getSkillExecutionStatus(const skills::SkillExecutionID &id)
Definition: SkillManagerComponentPlugin.cpp:448
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::SkillManagerComponentPluginUser::updateStatusForSkill
void updateStatusForSkill(const skills::provider::dto::SkillStatusUpdate &update, const skills::callback::dto::ProviderID &id, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:661
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::SkillManagerComponentPluginUser::addProvider
void addProvider(const skills::manager::dto::ProviderInfo &providerInfo, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:592
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::plugins::SkillManagerComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: SkillManagerComponentPlugin.cpp:14
armarx::skills::SkillExecutionID::skillId
SkillID skillId
Definition: SkillExecutionID.h:21
armarx::plugins::SkillManagerComponentPlugin::abortSkillAsync
bool abortSkillAsync(const skills::SkillExecutionID &id)
Definition: SkillManagerComponentPlugin.cpp:313
armarx::skills::SkillExecutionID::FromIce
static SkillExecutionID FromIce(const skills::manager::dto::SkillExecutionID &)
Definition: SkillExecutionID.cpp:29
armarx::skills::SkillExecutionRequest::parameters
armarx::aron::data::DictPtr parameters
Definition: SkillExecutionRequest.h:35
armarx::plugins::SkillManagerComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: SkillManagerComponentPlugin.cpp:26
armarx::skills::SkillExecutionRequest::executorName
std::string executorName
Definition: SkillExecutionRequest.h:34
armarx::plugins::SkillManagerComponentPlugin::addProvider
void addProvider(const skills::ProviderInfo &info)
Definition: SkillManagerComponentPlugin.cpp:49
armarx::skills::ProviderInfo
Definition: ProviderInfo.h:19
armarx::plugins::SkillManagerComponentPlugin::executeSkillAsync
skills::SkillExecutionID executeSkillAsync(const skills::SkillExecutionRequest &req)
Definition: SkillManagerComponentPlugin.cpp:152
armarx::SkillManagerComponentPluginUser::updateSkillParameters
skills::provider::dto::ParameterUpdateResult updateSkillParameters(const skills::manager::dto::SkillExecutionID &executionId, const aron::data::dto::DictPtr &params, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:627
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::skills::SkillDescription::FromIce
static SkillDescription FromIce(const provider::dto::SkillDescription &i, const std::optional< ProviderID > &=std::nullopt)
Definition: SkillDescription.cpp:39
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::skills::SkillID::isFullySpecified
bool isFullySpecified() const
Definition: SkillID.h:29
armarx::skills::ProviderInfo::providerId
ProviderID providerId
Definition: ProviderInfo.h:22
armarx::plugins::SkillManagerComponentPlugin::getFirstProviderNameThatHasSkill
skills::ProviderID getFirstProviderNameThatHasSkill(const skills::SkillID &skillid)
Definition: SkillManagerComponentPlugin.cpp:31
armarx::SkillManagerComponentPluginUser::abortSkillAsync
skills::provider::dto::AbortSkillResult abortSkillAsync(const skills::manager::dto::SkillExecutionID &id, const Ice::Current &current) override
Definition: SkillManagerComponentPlugin.cpp:650
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::skills::ProviderID::FromIce
static ProviderID FromIce(const manager::dto::ProviderID &)
Definition: ProviderID.cpp:32
armarx::plugins::SkillManagerComponentPlugin::getSkillExecutionStatuses
std::map< skills::SkillExecutionID, skills::SkillStatusUpdate > getSkillExecutionStatuses()
Definition: SkillManagerComponentPlugin.cpp:504
armarx::SkillManagerComponentPluginUser::SkillManagerComponentPluginUser
SkillManagerComponentPluginUser()
Definition: SkillManagerComponentPlugin.cpp:586