MP Class Referenceabstract

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

+ Inheritance diagram for MP:

Classes

struct  DictViaPoint
 
struct  ListViaPoint
 
struct  MPConfig
 
struct  MPListConfig
 

Public Member Functions

Ice::DoubleSeq deserialize (const std::string &, const std::string &mode="string")
 
double getCanonicalValue ()
 
std::string getClassName ()
 
std::string getMPName ()
 
DoubleSeqSeq getWeight ()
 
bool isFinished ()
 
void learnFromCSV (const Ice::StringSeq &fileNames=std::vector< std::string >())
 setting More...
 
 MP (const MPConfig &c)
 
void pause ()
 
void removeAllViaPoint ()
 
void reset ()
 
void resume ()
 
virtual void run (MPInputPtr, MPOutputPtr)=0
 
std::string serialize (const std::string &mode="string")
 
void setGoal (const Ice::DoubleSeq &goals)
 
void setRotationWeights (const std::vector< std::vector< double >> &weights)
 
void setStart (const Ice::DoubleSeq &starts)
 
void setStartAndGoal (const Ice::DoubleSeq &starts, const Ice::DoubleSeq &goals)
 
void setTranslationWeights (const std::vector< std::vector< double >> &weights)
 
void setViaPoint (Ice::Double u, const Ice::DoubleSeq &viapoint)
 
void setWeight (const std::vector< std::vector< double >> &weights)
 serialze More...
 
void start ()
 control More...
 
void start (const Ice::DoubleSeq &goals)
 
void start (const Ice::DoubleSeq &goals, const Ice::DoubleSeq &starts)
 
void start (const Ice::DoubleSeq &goals, const Ice::DoubleSeq &starts, Ice::Double timeDuration)
 
void start (const Ice::DoubleSeq &goals, Ice::Double timeDuration)
 
void stop ()
 
virtual ~MP ()=default
 

Protected Attributes

double canonicalValue = 1.0
 
MPConfig cfg
 
std::vector< mplib::representation::MPState > currentState
 
std::atomic_bool finished = false
 
std::atomic_bool goalSetByUser {false}
 
bool isDisturbance = false
 
MutexType mpMutex
 
std::atomic_bool mpTrained {false}
 Note: if mp is not trained, the dimension is not initialized, thus mp->getDim() is undefined, if you set viapoints you will have memory allocation error. More...
 
std::atomic_bool paused = false
 
std::atomic_bool running = false
 
mplib::core::DVec targetPoseVec
 
mplib::core::DVec targetPoseVecInTraj
 
std::vector< std::pair< double, mplib::core::DVec > > userDefinedViaPoints
 
VMPPtr vmp
 
mplib::representation::VMPType vmpType = mplib::representation::VMPType::PrincipalComponent
 

Detailed Description

Definition at line 48 of file MP.h.

Constructor & Destructor Documentation

◆ MP()

MP ( const MPConfig c)

Definition at line 16 of file MP.cpp.

+ Here is the call graph for this function:

◆ ~MP()

virtual ~MP ( )
virtualdefault

Member Function Documentation

◆ deserialize()

Ice::DoubleSeq deserialize ( const std::string &  mpString,
const std::string &  mode = "string" 
)

Definition at line 295 of file MP.cpp.

◆ getCanonicalValue()

double getCanonicalValue ( )

Definition at line 262 of file MP.cpp.

◆ getClassName()

std::string getClassName ( )

Definition at line 44 of file MP.cpp.

◆ getMPName()

std::string getMPName ( )

Definition at line 39 of file MP.cpp.

◆ getWeight()

DoubleSeqSeq getWeight ( )

Definition at line 273 of file MP.cpp.

◆ isFinished()

bool isFinished ( )

Definition at line 134 of file MP.cpp.

◆ learnFromCSV()

void learnFromCSV ( const Ice::StringSeq &  fileNames = std::vector<std::string>())

setting

Definition at line 139 of file MP.cpp.

◆ pause()

void pause ( )

Definition at line 106 of file MP.cpp.

◆ removeAllViaPoint()

void removeAllViaPoint ( )

Definition at line 256 of file MP.cpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( )

Definition at line 116 of file MP.cpp.

+ Here is the call graph for this function:

◆ resume()

void resume ( )

Definition at line 111 of file MP.cpp.

+ Here is the caller graph for this function:

◆ run()

virtual void run ( MPInputPtr  ,
MPOutputPtr   
)
pure virtual

Implemented in JSMP, TSMP, and KeypointsMP.

◆ serialize()

std::string serialize ( const std::string &  mode = "string")

Definition at line 278 of file MP.cpp.

◆ setGoal()

void setGoal ( const Ice::DoubleSeq &  goals)

Definition at line 189 of file MP.cpp.

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

◆ setRotationWeights()

void setRotationWeights ( const std::vector< std::vector< double >> &  weights)

◆ setStart()

void setStart ( const Ice::DoubleSeq &  starts)

Definition at line 212 of file MP.cpp.

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

◆ setStartAndGoal()

void setStartAndGoal ( const Ice::DoubleSeq &  starts,
const Ice::DoubleSeq &  goals 
)

Definition at line 230 of file MP.cpp.

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

◆ setTranslationWeights()

void setTranslationWeights ( const std::vector< std::vector< double >> &  weights)

◆ setViaPoint()

void setViaPoint ( Ice::Double  u,
const Ice::DoubleSeq &  viapoint 
)

Definition at line 236 of file MP.cpp.

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

◆ setWeight()

void setWeight ( const std::vector< std::vector< double >> &  weights)

serialze

Definition at line 268 of file MP.cpp.

◆ start() [1/5]

void start ( )

control

Definition at line 49 of file MP.cpp.

+ Here is the caller graph for this function:

◆ start() [2/5]

void start ( const Ice::DoubleSeq &  goals)

Definition at line 54 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [3/5]

void start ( const Ice::DoubleSeq &  goals,
const Ice::DoubleSeq &  starts 
)

parse user defined viapoints from configuration file

overwrite goals and starts if available

prepare execution

set flag

Definition at line 71 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [4/5]

void start ( const Ice::DoubleSeq &  goals,
const Ice::DoubleSeq &  starts,
Ice::Double  timeDuration 
)

Definition at line 65 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [5/5]

void start ( const Ice::DoubleSeq &  goals,
Ice::Double  timeDuration 
)

Definition at line 59 of file MP.cpp.

+ Here is the call graph for this function:

◆ stop()

void stop ( )

Definition at line 101 of file MP.cpp.

Member Data Documentation

◆ canonicalValue

double canonicalValue = 1.0
protected

Definition at line 170 of file MP.h.

◆ cfg

MPConfig cfg
protected

Definition at line 159 of file MP.h.

◆ currentState

std::vector<mplib::representation::MPState> currentState
protected

Definition at line 178 of file MP.h.

◆ finished

std::atomic_bool finished = false
protected

Definition at line 168 of file MP.h.

◆ goalSetByUser

std::atomic_bool goalSetByUser {false}
protected

Definition at line 172 of file MP.h.

◆ isDisturbance

bool isDisturbance = false
protected

Definition at line 161 of file MP.h.

◆ mpMutex

MutexType mpMutex
mutableprotected

Definition at line 163 of file MP.h.

◆ mpTrained

std::atomic_bool mpTrained {false}
protected

Note: if mp is not trained, the dimension is not initialized, thus mp->getDim() is undefined, if you set viapoints you will have memory allocation error.

So make sure mp is trained before setting any viapoint.

Definition at line 175 of file MP.h.

◆ paused

std::atomic_bool paused = false
protected

Definition at line 169 of file MP.h.

◆ running

std::atomic_bool running = false
protected

Definition at line 167 of file MP.h.

◆ targetPoseVec

mplib::core::DVec targetPoseVec
protected

Definition at line 176 of file MP.h.

◆ targetPoseVecInTraj

mplib::core::DVec targetPoseVecInTraj
protected

Definition at line 177 of file MP.h.

◆ userDefinedViaPoints

std::vector<std::pair<double, mplib::core::DVec> > userDefinedViaPoints
protected

Definition at line 179 of file MP.h.

◆ vmp

VMPPtr vmp
protected

Definition at line 164 of file MP.h.

◆ vmpType

mplib::representation::VMPType vmpType = mplib::representation::VMPType::PrincipalComponent
protected

Definition at line 165 of file MP.h.


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