MPPool Class Reference

#include <armarx/control/common/mp/MPPool.h>

+ Inheritance diagram for MPPool:

Public Member Functions

void createMPs (const MPListConfig &mpListConfig)
 
DVec deserialize (const std::string &, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
Ice::Double getCanVal (const std::string &mpName, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
::armarx::aron::data::dto::DictPtr getMPConfig (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 config
 
bool getMPEnabled (const Ice::Current &) override
 
std::string getNames (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 Interface functions.
 
bool isFinished (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
bool isFinishedAll (const Ice::Current &=Ice::emptyCurrent) override
 
void learnFromCSV (const Ice::StringSeq &fileNames=std::vector< std::string >(), const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 setting
 
void learnFromTrajs (const ::armarx::aron::data::dto::DictPtr &dict, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
 MPPool ()=default
 
void pause (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void pauseAll (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void reconfigureMPs (const MPListConfig &mpListConfig)
 
void removeAllViaPoint (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void requestStop (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void reset (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void resetAll (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
bool resetMPs (const ::armarx::aron::data::dto::DictPtr &dto, const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap)
 
bool resetMPsV1 (const ::armarx::aron::data::dto::DictPtr &dto, const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap, const std::shared_ptr< common::coordination::Coordination > &coordinator)
 
bool resetMPsV2 (const ::armarx::aron::data::dto::DictPtr &dto, const std::map< std::string, MPReInitData > &data)
 
void resume (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void resumeAll (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void runMPs (bool rtSafe)
 
std::string serialize (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 serialize
 
void set (const ::armarx::StringDoubleSeqMap &, const ::armarx::StringDoubleSeqMap &, const ::armarx::StringDoubleMap &, const ::Ice::Current &iceCurrent=::Ice::emptyCurrent) override
 
void setGoal (const DVec &goals, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void setStartAndGoal (const DVec &starts, const DVec &goals, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void setViaPoint (Ice::Double u, const DVec &viapoint, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
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
 
void startAll (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void stop (const std::string &mpName="all", const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void stopAll (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void trainMP (const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
void updateMPConfig (const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
 
 ~MPPool ()
 
- Public Member Functions inherited from MPPoolInterface
Ice::DoubleSeq deserialize (string mpAsString)
 
double getCanVal (string mpName)
 utilities
 
armarx::aron::data::dto::Dict getMPConfig ()
 
bool getMPEnabled ()
 
string getNames ()
 
bool isFinished (string mpName)
 
bool isFinishedAll ()
 
void learnFromCSV (Ice::StringSeq fileNames)
 setting
 
void learnFromTrajs (armarx::aron::data::dto::Dict config)
 
void pause (string mpName)
 
void pauseAll ()
 
void removeAllViaPoint ()
 
void requestStop (string mpName)
 
void reset (string mpName)
 
void resetAll ()
 
void resume (string mpName)
 
void resumeAll ()
 
string serialize ()
 serialze
 
void set (StringDoubleSeqMap startVec, StringDoubleSeqMap goalVec, StringDoubleMap durationSec)
 control
 
void setGoal (Ice::DoubleSeq goals)
 
void setStartAndGoal (Ice::DoubleSeq starts, Ice::DoubleSeq goals)
 
void setViaPoint (double u, Ice::DoubleSeq viapoint)
 
void start (string mpName, Ice::DoubleSeq startVec, Ice::DoubleSeq goalVec, double durationSec)
 
void startAll ()
 
void stop (string mpName)
 
void stopAll ()
 
void trainMP ()
 
void updateMPConfig (armarx::aron::data::dto::Dict config)
 config
 

Protected Member Functions

void reInitMPInputOutputData (const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap)
 
void reInitMPInputOutputDataV1 (const std::map< std::string, VirtualRobot::RobotNodeSetPtr > &rnsMap, const std::shared_ptr< common::coordination::Coordination > &coordinator)
 
void reInitMPInputOutputDataV2 (const std::map< std::string, MPReInitData > &data)
 

Protected Attributes

std::atomic< bool > isMPReady {false}
 
MPListConfig mpConfig
 this variable is only needed when constructing the MP instances, therefore you don't need to use triple buffers
 
std::map< std::string, MPInputOutputmps
 
std::atomic_bool mpTaskRunning {false}
 
std::recursive_mutex mtx_mps
 
std::map< arondto::MPGroup, PhaseStopResultphaseStops_
 

Detailed Description

Definition at line 59 of file MPPool.h.

Constructor & Destructor Documentation

◆ MPPool()

MPPool ( )
default
+ Here is the caller graph for this function:

◆ ~MPPool()

~MPPool ( )
inline

Definition at line 63 of file MPPool.h.

Member Function Documentation

◆ createMPs()

void createMPs ( const MPListConfig & mpListConfig)

Definition at line 23 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

DVec deserialize ( const std::string & ,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 532 of file MPPool.cpp.

◆ getCanVal()

Ice::Double getCanVal ( const std::string & mpName,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 539 of file MPPool.cpp.

◆ getMPConfig()

armarx::aron::data::dto::DictPtr getMPConfig ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

config

Definition at line 705 of file MPPool.cpp.

◆ getMPEnabled()

bool getMPEnabled ( const Ice::Current & )
override

Definition at line 551 of file MPPool.cpp.

◆ getNames()

std::string getNames ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Interface functions.

Definition at line 132 of file MPPool.cpp.

◆ isFinished()

bool isFinished ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 386 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ isFinishedAll()

bool isFinishedAll ( const Ice::Current & = Ice::emptyCurrent)
override

Definition at line 380 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ learnFromCSV()

void learnFromCSV ( const Ice::StringSeq & fileNames = std::vector<std::string>(),
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

setting

Definition at line 406 of file MPPool.cpp.

◆ learnFromTrajs()

void learnFromTrajs ( const ::armarx::aron::data::dto::DictPtr & dict,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 426 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ pause()

void pause ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 293 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ pauseAll()

void pauseAll ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 287 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ reconfigureMPs()

void reconfigureMPs ( const MPListConfig & mpListConfig)

Definition at line 97 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reInitMPInputOutputData()

void reInitMPInputOutputData ( const std::map< std::string, VirtualRobot::RobotNodeSetPtr > & rnsMap)
protected

Definition at line 760 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ reInitMPInputOutputDataV1()

void reInitMPInputOutputDataV1 ( const std::map< std::string, VirtualRobot::RobotNodeSetPtr > & rnsMap,
const std::shared_ptr< common::coordination::Coordination > & coordinator )
protected

Definition at line 815 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ reInitMPInputOutputDataV2()

void reInitMPInputOutputDataV2 ( const std::map< std::string, MPReInitData > & data)
protected

Definition at line 711 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAllViaPoint()

void removeAllViaPoint ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 516 of file MPPool.cpp.

◆ requestStop()

void requestStop ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 237 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 355 of file MPPool.cpp.

◆ resetAll()

void resetAll ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 349 of file MPPool.cpp.

◆ resetMPs()

bool resetMPs ( const ::armarx::aron::data::dto::DictPtr & dto,
const std::map< std::string, VirtualRobot::RobotNodeSetPtr > & rnsMap )

Definition at line 565 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetMPsV1()

bool resetMPsV1 ( const ::armarx::aron::data::dto::DictPtr & dto,
const std::map< std::string, VirtualRobot::RobotNodeSetPtr > & rnsMap,
const std::shared_ptr< common::coordination::Coordination > & coordinator )

Definition at line 604 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetMPsV2()

bool resetMPsV2 ( const ::armarx::aron::data::dto::DictPtr & dto,
const std::map< std::string, MPReInitData > & data )

Definition at line 666 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ resume()

void resume ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 324 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ resumeAll()

void resumeAll ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 318 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ runMPs()

void runMPs ( bool rtSafe)

Since there may be MPs for TCP, posture and fingers, we group those for one arm to use the same phase stop signal, usually it is a good choice to use the Task Space MP to compute the phase stop signal and propagate this to other mps in the same group Compute phase stop

propagate phase top to other mps

Definition at line 104 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ serialize()

std::string serialize ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

serialize

Definition at line 526 of file MPPool.cpp.

◆ set()

void set ( const ::armarx::StringDoubleSeqMap & startVec,
const ::armarx::StringDoubleSeqMap & goalVec,
const ::armarx::StringDoubleMap & durationSec,
const ::Ice::Current & iceCurrent = ::Ice::emptyCurrent )
override

Definition at line 147 of file MPPool.cpp.

◆ setGoal()

void setGoal ( const DVec & goals,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 493 of file MPPool.cpp.

◆ setStartAndGoal()

void setStartAndGoal ( const DVec & starts,
const DVec & goals,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 498 of file MPPool.cpp.

◆ setViaPoint()

void setViaPoint ( Ice::Double u,
const DVec & viapoint,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 509 of file MPPool.cpp.

◆ 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 at line 183 of file MPPool.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startAll()

void startAll ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 177 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ stop()

void stop ( const std::string & mpName = "all",
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 262 of file MPPool.cpp.

+ Here is the caller graph for this function:

◆ stopAll()

void stopAll ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 231 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ trainMP()

void trainMP ( const Ice::Current & iceCurrent = Ice::emptyCurrent)
override

Definition at line 480 of file MPPool.cpp.

+ Here is the call graph for this function:

◆ updateMPConfig()

void updateMPConfig ( const ::armarx::aron::data::dto::DictPtr & dto,
const Ice::Current & iceCurrent = Ice::emptyCurrent )
override

Definition at line 557 of file MPPool.cpp.

Member Data Documentation

◆ isMPReady

std::atomic<bool> isMPReady {false}
protected

Definition at line 148 of file MPPool.h.

◆ mpConfig

MPListConfig mpConfig
protected

this variable is only needed when constructing the MP instances, therefore you don't need to use triple buffers

Definition at line 153 of file MPPool.h.

◆ mps

std::map<std::string, MPInputOutput> mps
protected

Definition at line 146 of file MPPool.h.

◆ mpTaskRunning

std::atomic_bool mpTaskRunning {false}
protected

Definition at line 161 of file MPPool.h.

◆ mtx_mps

std::recursive_mutex mtx_mps
mutableprotected

Definition at line 147 of file MPPool.h.

◆ phaseStops_

std::map<arondto::MPGroup, PhaseStopResult> phaseStops_
protected

Definition at line 162 of file MPPool.h.


The documentation for this class was generated from the following files: