MP Class Referenceabstract

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

+ Inheritance diagram for MP:

Public Member Functions

DVec deserialize (const std::string &, const std::string &mode="string")
 
double getCanonicalValue ()
 
const std::string & getClassName () const
 
MPConfig getConfig ()
 
const std::string & getMPName () const
 
const std::string & getNodeSetName () const
 
const std::string & getRole () const
 
std::vector< double > getStartVec ()
 
DVecVec getWeight ()
 
bool isFinished ()
 status More...
 
bool isFirstRun ()
 
bool isRunning ()
 
void learnFromCSV (const Ice::StringSeq &fileNames=std::vector< std::string >())
 setting More...
 
void learnFromTraj (const MPTrajs &trajs=MPTrajs())
 
 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 setDurationSec (Ice::Double timeDuration)
 
void setGoal (const DVec &goals)
 
void setRotationWeights (const DVecVec &weights)
 
void setStart (const DVec &starts)
 
void setStartAndGoal (const DVec &starts, const DVec &goals)
 
void setTranslationWeights (const DVecVec &weights)
 
void setViaPoint (Ice::Double u, const DVec &viapoint)
 
void setWeight (const DVecVec &weights)
 serialze More...
 
void start ()
 control More...
 
void start (const DVec &goals)
 
void start (const DVec &goals, const DVec &starts)
 
void start (const DVec &goals, const DVec &starts, Ice::Double timeDuration)
 
void start (const DVec &goals, Ice::Double timeDuration)
 
void stop ()
 
void trainMP ()
 
void trainMPFromTraj (std::vector< mplib::core::SampledTrajectory > &trajs)
 
virtual void validateInitialState (const DVec &starts)
 
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 firstRun = true
 
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
 
DVec targetPoseVec
 
DVec targetPoseVecInTraj
 
std::vector< std::pair< double, DVec > > userDefinedViaPoints
 
VMPPtr vmp
 
mplib::representation::VMPType vmpType = mplib::representation::VMPType::PrincipalComponent
 

Detailed Description

Definition at line 67 of file MP.h.

Constructor & Destructor Documentation

◆ MP()

MP ( const MPConfig &  c)

Definition at line 17 of file MP.cpp.

+ Here is the call graph for this function:

◆ ~MP()

virtual ~MP ( )
virtualdefault

Member Function Documentation

◆ deserialize()

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

Definition at line 459 of file MP.cpp.

◆ getCanonicalValue()

double getCanonicalValue ( )

Definition at line 422 of file MP.cpp.

◆ getClassName()

const std::string & getClassName ( ) const

Definition at line 53 of file MP.cpp.

◆ getConfig()

MPConfig getConfig ( )

Definition at line 193 of file MP.cpp.

◆ getMPName()

const std::string & getMPName ( ) const

Definition at line 47 of file MP.cpp.

◆ getNodeSetName()

const std::string & getNodeSetName ( ) const

Definition at line 59 of file MP.cpp.

◆ getRole()

const std::string & getRole ( ) const

Definition at line 65 of file MP.cpp.

◆ getStartVec()

std::vector< double > getStartVec ( )

Definition at line 370 of file MP.cpp.

◆ getWeight()

DVecVec getWeight ( )

Definition at line 435 of file MP.cpp.

◆ isFinished()

bool isFinished ( )

status

Definition at line 175 of file MP.cpp.

◆ isFirstRun()

bool isFirstRun ( )

Definition at line 187 of file MP.cpp.

◆ isRunning()

bool isRunning ( )

Definition at line 181 of file MP.cpp.

◆ learnFromCSV()

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

setting

Definition at line 232 of file MP.cpp.

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

◆ learnFromTraj()

void learnFromTraj ( const MPTrajs trajs = MPTrajs())

Definition at line 199 of file MP.cpp.

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

◆ pause()

void pause ( )

Definition at line 144 of file MP.cpp.

◆ removeAllViaPoint()

void removeAllViaPoint ( )

Definition at line 415 of file MP.cpp.

+ Here is the caller graph for this function:

◆ reset()

void reset ( )

Definition at line 156 of file MP.cpp.

+ Here is the call graph for this function:

◆ resume()

void resume ( )

Definition at line 150 of file MP.cpp.

+ Here is the caller graph for this function:

◆ run()

virtual void run ( MPInputPtr  ,
MPOutputPtr   
)
pure virtual

Implemented in TSMP, JSMP, and KeypointsMP.

◆ serialize()

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

Definition at line 441 of file MP.cpp.

◆ setDurationSec()

void setDurationSec ( Ice::Double  timeDuration)

Definition at line 90 of file MP.cpp.

◆ setGoal()

void setGoal ( const DVec goals)

Definition at line 315 of file MP.cpp.

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

◆ setRotationWeights()

void setRotationWeights ( const DVecVec weights)

◆ setStart()

void setStart ( const DVec starts)

Definition at line 343 of file MP.cpp.

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

◆ setStartAndGoal()

void setStartAndGoal ( const DVec starts,
const DVec goals 
)

Definition at line 382 of file MP.cpp.

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

◆ setTranslationWeights()

void setTranslationWeights ( const DVecVec weights)

◆ setViaPoint()

void setViaPoint ( Ice::Double  u,
const DVec viapoint 
)

Definition at line 389 of file MP.cpp.

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

◆ setWeight()

void setWeight ( const DVecVec weights)

serialze

Definition at line 429 of file MP.cpp.

◆ start() [1/5]

void start ( )

control

Definition at line 71 of file MP.cpp.

+ Here is the caller graph for this function:

◆ start() [2/5]

void start ( const DVec goals)

Definition at line 77 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [3/5]

void start ( const DVec goals,
const DVec starts 
)

parse user defined viapoints from configuration file

overwrite goals and starts if available

prepare execution

set flag

Definition at line 103 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [4/5]

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

Definition at line 96 of file MP.cpp.

+ Here is the call graph for this function:

◆ start() [5/5]

void start ( const DVec goals,
Ice::Double  timeDuration 
)

Definition at line 83 of file MP.cpp.

+ Here is the call graph for this function:

◆ stop()

void stop ( )

Definition at line 138 of file MP.cpp.

◆ trainMP()

void trainMP ( )

Definition at line 291 of file MP.cpp.

+ Here is the call graph for this function:

◆ trainMPFromTraj()

void trainMPFromTraj ( std::vector< mplib::core::SampledTrajectory > &  trajs)

Definition at line 257 of file MP.cpp.

+ Here is the caller graph for this function:

◆ validateInitialState()

virtual void validateInitialState ( const DVec starts)
inlinevirtual

Reimplemented in TSMP.

Definition at line 109 of file MP.h.

Member Data Documentation

◆ canonicalValue

double canonicalValue = 1.0
protected

Definition at line 145 of file MP.h.

◆ cfg

MPConfig cfg
protected

Definition at line 134 of file MP.h.

◆ currentState

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

Definition at line 154 of file MP.h.

◆ finished

std::atomic_bool finished = false
protected

Definition at line 143 of file MP.h.

◆ firstRun

std::atomic_bool firstRun = true
protected

Definition at line 146 of file MP.h.

◆ goalSetByUser

std::atomic_bool goalSetByUser {false}
protected

Definition at line 148 of file MP.h.

◆ isDisturbance

bool isDisturbance = false
protected

Definition at line 136 of file MP.h.

◆ mpMutex

MutexType mpMutex
mutableprotected

Definition at line 138 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 151 of file MP.h.

◆ paused

std::atomic_bool paused = false
protected

Definition at line 144 of file MP.h.

◆ running

std::atomic_bool running = false
protected

Definition at line 142 of file MP.h.

◆ targetPoseVec

DVec targetPoseVec
protected

Definition at line 152 of file MP.h.

◆ targetPoseVecInTraj

DVec targetPoseVecInTraj
protected

Definition at line 153 of file MP.h.

◆ userDefinedViaPoints

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

Definition at line 155 of file MP.h.

◆ vmp

VMPPtr vmp
protected

Definition at line 139 of file MP.h.

◆ vmpType

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

Definition at line 140 of file MP.h.


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