MPPool.cpp
Go to the documentation of this file.
1 #include "MPPool.h"
2 
3 #include <SimoxUtility/json.h>
4 #include <VirtualRobot/Nodes/RobotNode.h>
5 
8 
10 #include <armarx/control/common/mp/aron/MPConfig.aron.generated.h>
11 
12 #include "../utils.h"
13 #include "JSMP.h"
14 #include "KeypointsMP.h"
15 #include "TSMP.h"
16 
18 {
19 
20  void
21  MPPool::createMPs(const MPListConfig& mpListConfig)
22  {
23  auto _start = IceUtil::Time::now().toSecondsDouble();
24  ARMARX_INFO << "----------------------------------- creating MPs "
25  "-------------------------------------------------";
26  ARMARX_INFO << " -- in MPPool, we have " << mpListConfig.mpList.size() << " MPs";
27 
28  int index = 0;
29  for (const MPConfig& c : mpListConfig.mpList)
30  {
31  auto className = mpClass::_from_string_nocase(c.className.c_str());
32  ARMARX_INFO << "-- (" << index << ") creating MP with name " << c.name
33  << "\n---- class: " << c.className << "\n---- type: " << c.mpTypeString
34  << "\n---- mode: " << c.mpMode << "\n---- style: " << c.mpStyle;
35  index++;
36  switch (className)
37  {
38  case mpClass::JSMP:
39  {
40  JSMPPtr jsmp(new JSMP(c));
41  JSMPInputPtr in(new JSMPInput());
42  JSMPOutputPtr out(new JSMPOutput());
43  mps.insert({c.name, {jsmp, in, out}});
44  break;
45  }
46  case mpClass::JSVelMP:
47  break;
48  case mpClass::TSMP:
49  {
50  TSMPPtr tsmp(new TSMP(c));
51  TSMPInputPtr in(new TSMPInput());
52  TSMPOutputPtr out(new TSMPOutput());
53  mps.insert({c.name, {tsmp, in, out}});
54  break;
55  }
56  case mpClass::KeypointsMP:
57  {
58  KeypointsMPPtr tsmp(new KeypointsMP(c));
61  mps.insert({c.name, {tsmp, in, out}});
62  break;
63  }
64  case mpClass::TSVelMP:
65  break;
66  default:
67  ARMARX_WARNING << "unsupported MP class: " << c.className
68  << "\nsupported names include: "
69  "JSMP, JSVelMP, TSMP, TSVelMP, KeypointsMP";
70  break;
71  }
72  }
73  auto _duration = IceUtil::Time::now().toSecondsDouble() - _start;
74  ARMARX_INFO << "---------------------------------- All MPs created in " << _duration
75  << " sec "
76  "-----------------------------------------------";
77  }
78 
79  void
80  MPPool::reconfigureMPs(const MPListConfig& mpListConfig)
81  {
82  mps.clear();
83  createMPs(mpListConfig);
84  }
85 
86  void
87  MPPool::runMPs(const bool rtSafe)
88  {
89  for (auto& mp : mps)
90  {
91  if (rtSafe or mp.second.mp->isFirstRun())
92  {
93  mp.second.mp->run(mp.second.input, mp.second.output);
94  }
95  }
96  }
97 
98  std::string
99  MPPool::getNames(const Ice::Current& iceCurrent)
100  {
101  std::string allMPs = "";
102  for (auto& mp : mps)
103  {
104  allMPs = allMPs + mp.second.mp->getMPName() + ", ";
105  }
106  return allMPs;
107  }
108 
109  void
112  const ::armarx::StringDoubleMap& durationSec,
113  const ::Ice::Current&)
114  {
115  for (auto& pair : mps)
116  {
117  auto it = durationSec.find(pair.first);
118  auto is = startVec.find(pair.first);
119  auto ig = goalVec.find(pair.first);
120 
121  if (it != durationSec.end())
122  {
123  if (it->second > 0.0)
124  {
125  pair.second.mp->setDurationSec(it->second);
126  }
127  }
128  if (is != startVec.end())
129  {
130  pair.second.mp->setStart(is->second);
131  }
132  if (ig != goalVec.end())
133  {
134  pair.second.mp->setGoal(ig->second);
135  }
136  }
137  }
138 
139  void
140  MPPool::startAll(const Ice::Current& iceCurrent)
141  {
142  start();
143  }
144 
145  void
146  MPPool::start(const std::string& mpName,
147  const DVec& startVec,
148  const DVec& goalVec,
149  Ice::Double timeDuration,
150  const Ice::Current& iceCurrent)
151  {
152  auto start = IceUtil::Time::now().toSecondsDouble();
153  if (mpName == "all")
154  {
155  ARMARX_INFO << "--------------------------------------- start all MPs "
156  "---------------------------------------";
157  ARMARX_INFO << " -- To start all MPs at once, it's up to the user to configure the "
158  "start, goal and timeduration properly before this call.";
159  int index = 0;
160  for (auto& mp : mps)
161  {
162  ARMARX_INFO << " -- (" << index << ")-th MP: ";
163  mp.second.mp->start();
164  index++;
165  }
166  ARMARX_INFO << " -- all MPs started.";
167  }
168  else
169  {
170  auto search = mps.find(mpName);
171  if (search != mps.end())
172  {
173  if (timeDuration < 0.0)
174  {
175  search->second.mp->start(goalVec, startVec);
176  }
177  else
178  {
179  search->second.mp->start(goalVec, startVec, timeDuration);
180  }
181  }
182  else
183  {
184  ARMARX_ERROR << mpName
185  << " is not in the MP pool. Please check your configuration file";
186  }
187  }
188  // ARMARX_IMPORTANT << "starting mp" << VAROUT(mpName) << "with start: " << dVecToString(startVec) << " and goal: " << dVecToString(goalVec) << " for " << timeDuration << " seconds";
189  auto duration = IceUtil::Time::now().toSecondsDouble() - start;
190  ARMARX_INFO << "All mp started in " << duration << " sec.";
191  }
192 
193  void
194  MPPool::stopAll(const Ice::Current& iceCurrent)
195  {
196  stop();
197  }
198 
199  void
200  MPPool::requestStop(const std::string& mpName, const Ice::Current&)
201  {
202  if (mpName == "all")
203  {
204  for (auto& mp : mps)
205  {
206  mp.second.mp->requestStop();
207  }
208  }
209  else
210  {
211  auto search = mps.find(mpName);
212  if (search != mps.end())
213  {
214  search->second.mp->requestStop();
215  }
216  else
217  {
218  ARMARX_ERROR << mpName
219  << " is not in the MP pool. Please check your configuration file";
220  }
221  }
222  }
223 
224  void
225  MPPool::stop(const std::string& mpName, const Ice::Current&)
226  {
227  if (mpName == "all")
228  {
229  for (auto& mp : mps)
230  {
231  mp.second.mp->stop();
232  }
233  }
234  else
235  {
236  auto search = mps.find(mpName);
237  if (search != mps.end())
238  {
239  search->second.mp->stop();
240  }
241  else
242  {
243  ARMARX_ERROR << mpName
244  << " is not in the MP pool. Please check your configuration file";
245  }
246  }
247  }
248 
249  void
250  MPPool::pauseAll(const Ice::Current& iceCurrent)
251  {
252  pause();
253  }
254 
255  void
256  MPPool::pause(const std::string& mpName, const Ice::Current&)
257  {
258  if (mpName == "all")
259  {
260  for (auto& mp : mps)
261  {
262  mp.second.mp->pause();
263  }
264  }
265  else
266  {
267  auto search = mps.find(mpName);
268  if (search != mps.end())
269  {
270  search->second.mp->pause();
271  }
272  else
273  {
274  ARMARX_ERROR << mpName
275  << " is not in the MP pool. Please check your configuration file";
276  }
277  }
278  }
279 
280  void
281  MPPool::resumeAll(const Ice::Current& iceCurrent)
282  {
283  resume();
284  }
285 
286  void
287  MPPool::resume(const std::string& mpName, const Ice::Current&)
288  {
289  if (mpName == "all")
290  {
291  for (auto& mp : mps)
292  {
293  mp.second.mp->resume();
294  }
295  }
296  else
297  {
298  auto search = mps.find(mpName);
299  if (search != mps.end())
300  {
301  search->second.mp->resume();
302  }
303  else
304  {
305  ARMARX_ERROR << mpName
306  << " is not in the MP pool. Please check your configuration file";
307  }
308  }
309  }
310 
311  void
312  MPPool::resetAll(const Ice::Current& iceCurrent)
313  {
314  reset();
315  }
316 
317  void
318  MPPool::reset(const std::string& mpName, const Ice::Current&)
319  {
320  if (mpName == "all")
321  {
322  for (auto& mp : mps)
323  {
324  mp.second.mp->reset();
325  }
326  }
327  else
328  {
329  auto search = mps.find(mpName);
330  if (search != mps.end())
331  {
332  search->second.mp->reset();
333  }
334  else
335  {
336  ARMARX_ERROR << mpName
337  << " is not in the MP pool. Please check your configuration file";
338  }
339  }
340  }
341 
342  bool
343  MPPool::isFinishedAll(const Ice::Current& iceCurrent)
344  {
345  return isFinished();
346  }
347 
348  bool
349  MPPool::isFinished(const std::string& mpName, const Ice::Current&)
350  {
351  if (mpName == "all")
352  {
353  return std::all_of(mps.begin(),
354  mps.end(),
355  [](const auto& pair) { return pair.second.mp->isFinished(); });
356  }
357 
358  auto it = mps.find(mpName);
359  if (it != mps.end())
360  {
361  return it->second.mp->isFinished();
362  }
363 
364  ARMARX_ERROR << mpName << " is not in the MP pool. Please check your configuration file";
365  return true;
366  }
367 
368  void
369  MPPool::learnFromCSV(const Ice::StringSeq& fileNames, const Ice::Current& iceCurrent)
370  {
371  if (fileNames.size() > 0)
372  {
373  ARMARX_WARNING << "Be aware that the fileNames ice parameter is not yet used. "
374  << "Instead, set the file names in the MPConfig parameter of your "
375  << "previous ice interface call.";
376  }
377  ARMARX_INFO << "--------------------------------------- Train MPs "
378  "----------------------------------------------------";
379  for (auto& mp : mps)
380  {
381  mp.second.mp->learnFromCSV();
382  }
383  isMPReady.store(true);
384  ARMARX_INFO << "--------------------------------------- done "
385  "----------------------------------------------------";
386  }
387 
388  void
390  const Ice::Current& iceCurrent)
391  {
392  auto start = IceUtil::Time::now().toSecondsDouble();
393  ARMARX_INFO << "--------------------------------------- Train MPs "
394  "----------------------------------------------------";
395 
396  // Convert parameter of ice interface call to business object
397  MultiMPTrajs trajsDict;
398  trajsDict.fromAron(dict);
399  // std::map<std::string, std::vector<arondto::MPTraj>> dto =
400  // arondto::MultiMPTrajs::FromAron(dict).data;
401  // // armarx::aron::fromAron<std::vector<arondto::MPTraj>, MPTrajs>(arondto::MultiMPTrajs::FromAron(dict), bo);
402  // armarx::aron::fromAron<std::string, std::vector<arondto::MPTraj>, std::string, MPTrajs>(
403  // dto, trajsDict);
404 
405  // MultiMPTrajs trajsDict = ::armarx::fromAronDict<arondto::MultiMPTrajs, MultiMPTrajs>(dict);
406 
407  if (trajsDict.data.empty())
408  {
409  ARMARX_INFO << "Learning from trajectories specified in MPConfig(s) rather than as an "
410  "ice parameter";
411  for (const auto& [mpName, mpInputOutput] : mps)
412  {
413  const auto& mpConfig = mpInputOutput.mp->getConfig();
414  ARMARX_CHECK(not mpConfig.trajectoryList.empty())
415  << "For MP " << mpName << ": No trajectories provided as parameter, "
416  << "and not trajectories specified in MPConfig.";
417  mpInputOutput.mp->learnFromTraj(mpConfig.trajectoryList);
418  }
419  }
420  else
421  {
422  for (const auto& [mpName, trajs] : trajsDict.data)
423  {
424  // Learn the MP identified by mpName from the trajectory list stored in
425  // trajsDict.at(mpName)
426  ARMARX_CHECK(mps.count(mpName))
427  << "Trajectories provided for unknown MP " << mpName;
428  ARMARX_CHECK(not trajs.empty())
429  << "Empty list of trajectories provided for MP " << mpName;
430  mps.at(mpName).mp->learnFromTraj(trajs);
431  }
432  }
433  // mark whole MP pool as ready
434  isMPReady.store(true);
435 
436  auto duration = IceUtil::Time::now().toSecondsDouble() - start;
437  ARMARX_INFO << "--------------------------------------- done in " << duration
438  << " sec "
439  "----------------------------------------------------";
440  }
441 
442  void
443  MPPool::trainMP(const Ice::Current& iceCurrent)
444  {
445  auto start = IceUtil::Time::now().toSecondsDouble();
446  for (auto& mp : mps)
447  {
448  mp.second.mp->trainMP();
449  }
450  isMPReady.store(true);
451  auto duration = IceUtil::Time::now().toSecondsDouble() - start;
452  ARMARX_INFO << "training finished in " << duration << " sec.";
453  }
454 
455  void
456  MPPool::setGoal(const DVec& goals, const Ice::Current& iceCurrent)
457  {
458  }
459 
460  void
461  MPPool::setStartAndGoal(const DVec& starts, const DVec& goals, const Ice::Current& iceCurrent)
462  {
463  for (auto& mp : mps)
464  {
465  mp.second.mp->setStartAndGoal(starts, goals);
466  }
467  }
468 
469  void
470  MPPool::setViaPoint(Ice::Double u, const DVec& viapoint, const Ice::Current& iceCurrent)
471  {
472  }
473 
474  void
475  MPPool::removeAllViaPoint(const Ice::Current& iceCurrent)
476  {
477  }
478 
479  //void MPPool::setWeight(const DVecSeq& weights, const Ice::Current &iceCurrent)
480  //{
481 
482  //}
483 
484  std::string
485  MPPool::serialize(const Ice::Current& iceCurrent)
486  {
487  return "";
488  }
489 
490  DVec
491  MPPool::deserialize(const std::string&, const Ice::Current& iceCurrent)
492  {
493  std::vector<double> test{0.1, 0.1};
494  return test;
495  }
496 
498  MPPool::getCanVal(const std::string& mpName, const Ice::Current& iceCurrent)
499  {
500  auto search = mps.find(mpName);
501  if (search != mps.end())
502  {
503  return search->second.mp->getCanonicalValue();
504  }
505  else
506  {
507  ARMARX_ERROR << mpName
508  << " is not in the MP pool. Please check your configuration file";
509  return true;
510  }
511  }
512 
513  bool
514  MPPool::getMPEnabled(const Ice::Current&)
515  {
516  return true;
517  }
518 
519  void
521  const Ice::Current& iceCurrent)
522  {
523  ARMARX_WARNING << "You should overwrite this method in your concrete MP controllers, and "
524  "call resetMPs(dto, rnsMap)";
525  }
526 
527  bool
529  const std::map<std::string, VirtualRobot::RobotNodeSetPtr>& rnsMap)
530  {
531  std::scoped_lock lock(mtx_mps);
532  if (not isFinishedAll())
533  {
534  ARMARX_WARNING << "MP is not finished yet, cannot reset MP\n"
535  "If you want to force reset, please call \n\n"
536  " ctrl->stop('all') \n\n"
537  "before you continue";
538  return false;
539  }
540 
541  auto configData = MPListConfig::FromAron(dto);
542  isMPReady.store(false);
543  while (mpTaskRunning.load())
544  {
545  usleep(1000);
546  }
547 
548  for (const auto& _mp : configData.mpList)
549  {
550  if (rnsMap.find(_mp.nodeSetName) == rnsMap.end())
551  {
552  ARMARX_WARNING << "You have to make sure the RobotNodeSet " << _mp.nodeSetName
553  << " in your MP config "
554  << "corresponds to one of the RobotNodeSet in the controllers";
555  return false;
556  }
557  }
558  mpConfig = configData;
560 
561  reInitMPInputOutputData(rnsMap);
562  ARMARX_INFO << "-- successfully updated MP config.";
563  return true;
564  }
565 
567  MPPool::getMPConfig(const Ice::Current& iceCurrent)
568  {
569  return mpConfig.toAronDTO();
570  }
571 
572  void
574  const std::map<std::string, VirtualRobot::RobotNodeSetPtr>& rnsMap)
575  {
576  ARMARX_INFO << "-- reconfigure MP: reinitialize the mp input output, as well as the rt "
577  "related buffer values";
578  int index = 0;
579  for (auto& _mp : mps)
580  {
581  // const auto& nodeSetName = ;
582  // ARMARX_CHECK_EQUAL(nodeSetName, limb.at(nodeSetName)->kinematicChainName);
583  VirtualRobot::RobotNodeSetPtr rns = rnsMap.at(_mp.second.mp->getNodeSetName());
584 
585  if (_mp.second.mp->getRole() == "taskspace")
586  {
587  Eigen::Matrix4f currentPose = rns->getTCP()->getPoseInRootFrame();
588  ARMARX_INFO << "---- (" << index << ") init input output data for "
589  << _mp.second.mp->getMPName();
590  std::dynamic_pointer_cast<mp::TSMPInput>(_mp.second.input)->pose = currentPose;
591  std::dynamic_pointer_cast<mp::TSMPInput>(_mp.second.input)->vel.setZero();
592  std::dynamic_pointer_cast<mp::TSMPOutput>(_mp.second.output)->pose = currentPose;
593  std::dynamic_pointer_cast<mp::TSMPOutput>(_mp.second.output)->vel.setZero();
594  }
595  else if (_mp.second.mp->getRole() == "nullspace")
596  {
597  ARMARX_INFO << "---- (" << index << ") init input output data for "
598  << _mp.second.mp->getMPName() << " with "
599  << rns->getJointValues().size() << " joints";
600  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angleRadian =
601  rns->getJointValuesEigen();
602  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angularVel =
603  Eigen::VectorXf::Zero(rns->getJointValues().size());
604  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angleRadian =
605  rns->getJointValuesEigen();
606  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angularVel =
607  Eigen::VectorXf::Zero(rns->getJointValues().size());
608  }
609  else if (_mp.second.mp->getRole() == "hand")
610  {
611  ARMARX_INFO << "---- (" << index << ") init input output data for "
612  << _mp.second.mp->getMPName() << " with "
613  << rns->getJointValues().size() << " joints";
614  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angleRadian =
615  rns->getJointValuesEigen();
616  std::dynamic_pointer_cast<mp::JSMPInput>(_mp.second.input)->angularVel =
617  Eigen::VectorXf::Zero(rns->getJointValues().size());
618  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angleRadian =
619  rns->getJointValuesEigen();
620  std::dynamic_pointer_cast<mp::JSMPOutput>(_mp.second.output)->angularVel =
621  Eigen::VectorXf::Zero(rns->getJointValues().size());
622  }
623  index++;
624  }
625  }
626 
627 } // namespace armarx::control::common::mp
armarx::control::common::mp::MPPool::getCanVal
Ice::Double getCanVal(const std::string &mpName, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:498
armarx::MPPoolInterface::getNames
string getNames()
armarx::MPPoolInterface::getMPEnabled
bool getMPEnabled()
armarx::control::common::mp::MPPool::isMPReady
std::atomic< bool > isMPReady
Definition: MPPool.h:131
armarx::control::common::mp::MPPool::reconfigureMPs
void reconfigureMPs(const MPListConfig &mpListConfig)
Definition: MPPool.cpp:80
armarx::MPPoolInterface::isFinishedAll
bool isFinishedAll()
TSMP.h
armarx::control::common::mp::MPPool::setGoal
void setGoal(const DVec &goals, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:456
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::control::common::mp::JSMPInputPtr
std::shared_ptr< JSMPInput > JSMPInputPtr
Definition: JSMP.h:47
armarx::control::common::mp::MPPool::stop
void stop(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:225
armarx::control::common::mp::TSMPPtr
std::shared_ptr< TSMP > TSMPPtr
Definition: TSMP.h:62
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
JSMP.h
armarx::control::common::mp::MPPool::reset
void reset(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:318
armarx::control::common::mp::MPPool::mpTaskRunning
std::atomic_bool mpTaskRunning
Definition: MPPool.h:140
armarx::MPPoolInterface::stopAll
void stopAll()
armarx::control::common::mp::MPPool::learnFromTrajs
void learnFromTrajs(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:389
armarx::control::common::mp::TSMP
Definition: TSMP.h:49
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
aron_conversions.h
armarx::control::common::mp
This file is part of ArmarX.
Definition: aron_conversions.cpp:331
armarx::control::common::mp::MPPool::runMPs
void runMPs(const bool rtSafe)
Definition: MPPool.cpp:87
armarx::control::common::mp::JSMPOutput
Definition: JSMP.h:41
armarx::control::common::mp::JSMPOutputPtr
std::shared_ptr< JSMPOutput > JSMPOutputPtr
Definition: JSMP.h:48
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
armarx::MPPoolInterface::resumeAll
void resumeAll()
armarx::MPPoolInterface::getMPConfig
armarx::aron::data::dto::Dict getMPConfig()
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::control::common::mp::MPPool::resetMPs
bool resetMPs(const ::armarx::aron::data::dto::DictPtr &dto, const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap)
Definition: MPPool.cpp:528
armarx::control::common::mp::MPPool::setViaPoint
void setViaPoint(Ice::Double u, const DVec &viapoint, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:470
armarx::control::common::mp::MPPool::createMPs
void createMPs(const MPListConfig &mpListConfig)
Definition: MPPool.cpp:21
armarx::VariantType::Double
const VariantTypeId Double
Definition: Variant.h:920
armarx::control::common::mp::KeypointsMPOutput
Definition: KeypointsMP.h:39
armarx::MPPoolInterface::resetAll
void resetAll()
armarx::control::common::mp::TSMPOutputPtr
std::shared_ptr< TSMPOutput > TSMPOutputPtr
Definition: TSMP.h:47
armarx::control::common::mp::MPPool::resume
void resume(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:287
armarx::control::common::mp::MPPool::set
void set(const ::armarx::StringDoubleSeqMap &, const ::armarx::StringDoubleSeqMap &, const ::armarx::StringDoubleMap &, const ::Ice::Current &iceCurrent=::Ice::emptyCurrent) override
Definition: MPPool.cpp:110
armarx::control::common::mp::KeypointsMPOutputPtr
std::shared_ptr< KeypointsMPOutput > KeypointsMPOutputPtr
Definition: KeypointsMP.h:46
armarx::MPPoolInterface::removeAllViaPoint
void removeAllViaPoint()
KeypointsMP.h
armarx::control::common::mp::DVec
Ice::DoubleSeq DVec
Definition: MP.h:47
armarx::control::common::mp::JSMPPtr
std::shared_ptr< JSMP > JSMPPtr
Definition: JSMP.h:61
armarx::control::common::mp::MPPool::deserialize
DVec deserialize(const std::string &, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:491
armarx::MPPoolInterface::startAll
void startAll()
armarx::control::common::mp::MPPool::mtx_mps
std::recursive_mutex mtx_mps
Definition: MPPool.h:130
armarx::control::common::mp::MPPool::reInitMPInputOutputData
void reInitMPInputOutputData(const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap)
Definition: MPPool.cpp:573
armarx::control::common::mp::MPPool::pause
void pause(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:256
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:196
armarx::control::common::mp::MPPool::updateMPConfig
void updateMPConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:520
armarx::control::common::mp::MPPool::learnFromCSV
void learnFromCSV(const Ice::StringSeq &fileNames=std::vector< std::string >(), const Ice::Current &iceCurrent=Ice::emptyCurrent) override
setting
Definition: MPPool.cpp:369
ExpressionException.h
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
armarx::control::common::mp::MPPool::setStartAndGoal
void setStartAndGoal(const DVec &starts, const DVec &goals, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:461
armarx::MPPoolInterface::pauseAll
void pauseAll()
armarx::control::common::mp::KeypointsMPInput
Definition: KeypointsMP.h:32
armarx::StringDoubleMap
dictionary< string, double > StringDoubleMap
Definition: MPPoolInterface.ice:35
armarx::control::common::mp::TSMPOutput
Definition: TSMP.h:40
armarx::control::common::mp::JSMP
Definition: JSMP.h:50
armarx::control::common::mp::MPPool::start
void start(const std::string &mpName="all", const DVec &startVec=std::vector< double >(), const DVec &goalVec=std::vector< double >(), Ice::Double timeDuration=-1.0, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
control
Definition: MPPool.cpp:146
armarx::control::common::mp::JSMPInput
Definition: JSMP.h:34
armarx::control::common::mp::TSMPInput
Definition: TSMP.h:33
armarx::control::common::mp::MPPool::mps
std::map< std::string, MPInputOutput > mps
Definition: MPPool.h:129
armarx::MPPoolInterface::trainMP
void trainMP()
armarx::control::common::mp::TSMPInputPtr
std::shared_ptr< TSMPInput > TSMPInputPtr
Definition: TSMP.h:46
armarx::MPPoolInterface::serialize
string serialize()
serialze
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:193
MPPool.h
armarx::control::common::mp::MPPool::requestStop
void requestStop(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:200
armarx::control::common::mp::KeypointsMP
Definition: KeypointsMP.h:48
ArmarXDataPath.h
armarx::StringDoubleSeqMap
dictionary< string, Ice::DoubleSeq > StringDoubleSeqMap
Definition: MPPoolInterface.ice:34
armarx::control::common::mp::KeypointsMPPtr
std::shared_ptr< KeypointsMP > KeypointsMPPtr
Definition: KeypointsMP.h:57
armarx::control::common::mp::KeypointsMPInputPtr
std::shared_ptr< KeypointsMPInput > KeypointsMPInputPtr
Definition: KeypointsMP.h:45
armarx::control::common::mp::MPPool::isFinished
bool isFinished(const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition: MPPool.cpp:349
armarx::control::common::mp::MPPool::mpConfig
MPListConfig mpConfig
this variable is only needed when constructing the MP instances, therefore you don't need to use trip...
Definition: MPPool.h:136