MP Class Referenceabstract

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

+ Inheritance diagram for MP:

Public Member Functions

virtual void computePhaseStop (const MPInputPtr input, const MPOutputPtr output, PhaseStopResult &phaseStop)
 
DVec deserialize (const std::string &, const std::string &mode="string")
 
double getCanonicalValue ()
 
const std::string & getClassName () const
 
MPConfig getConfig ()
 
const arondto::MPGroup & getGroup () const
 
std::string getGroupName () const
 
const std::string & getMPName () const
 
const std::string & getNodeSetName () const
 
const std::string & getRole () const
 
bool getStartFromPrevTarget ()
 
std::vector< double > getStartVec ()
 
DVecVec getWeight ()
 
bool isFinished ()
 status
 
bool isFirstRun ()
 
bool isRunning ()
 
bool isStopRequested ()
 
bool isTaskSpaceMP () const
 
void learnFromCSV (const Ice::StringSeq &fileNames=std::vector< std::string >())
 setting
 
void learnFromTraj (const MPTrajs &trajs=MPTrajs())
 
 MP (const MPConfig &c)
 
void pause ()
 
void removeAllViaPoint ()
 
void requestStop ()
 
void reset ()
 
void resume ()
 
virtual void run (MPInputPtr, MPOutputPtr, const PhaseStopResult &phaseStop)=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
 
void start ()
 control
 
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 DVec validateViaPoint (const DVec &viapoint)
 
virtual ~MP ()=default
 

Public Attributes

DVec prevViapoint
 

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
 
armarx::DateTime mpStartTimeSec
 
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.
 
std::atomic_bool paused = false
 
std::atomic_bool running = false
 
std::atomic_bool stopRequested = false
 
DVec targetPoseVec
 
DVec targetPoseVecInTraj
 
std::vector< std::pair< double, DVec > > userDefinedViaPoints
 
VMPPtr vmp
 
mplib::representation::VMPType vmpType = mplib::representation::VMPType::PrincipalComponent
 

Constructor & Destructor Documentation

◆ MP()

MP ( const MPConfig & c)

◆ ~MP()

virtual ~MP ( )
virtualdefault

Member Function Documentation

◆ computePhaseStop()

virtual void computePhaseStop ( const MPInputPtr input,
const MPOutputPtr output,
PhaseStopResult & phaseStop )
inlinevirtual

Reimplemented in TSMP.

◆ deserialize()

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

◆ getCanonicalValue()

double getCanonicalValue ( )

◆ getClassName()

const std::string & getClassName ( ) const

◆ getConfig()

MPConfig getConfig ( )

◆ getGroup()

const arondto::MPGroup & getGroup ( ) const

◆ getGroupName()

std::string getGroupName ( ) const

◆ getMPName()

const std::string & getMPName ( ) const

◆ getNodeSetName()

const std::string & getNodeSetName ( ) const

◆ getRole()

const std::string & getRole ( ) const

◆ getStartFromPrevTarget()

bool getStartFromPrevTarget ( )

◆ getStartVec()

std::vector< double > getStartVec ( )

◆ getWeight()

DVecVec getWeight ( )

◆ isFinished()

bool isFinished ( )

status

◆ isFirstRun()

bool isFirstRun ( )

◆ isRunning()

bool isRunning ( )

◆ isStopRequested()

bool isStopRequested ( )

◆ isTaskSpaceMP()

bool isTaskSpaceMP ( ) const

◆ learnFromCSV()

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

setting

◆ learnFromTraj()

void learnFromTraj ( const MPTrajs & trajs = MPTrajs())

◆ pause()

void pause ( )

◆ removeAllViaPoint()

void removeAllViaPoint ( )

◆ requestStop()

void requestStop ( )

◆ reset()

void reset ( )

◆ resume()

void resume ( )

◆ run()

virtual void run ( MPInputPtr ,
MPOutputPtr ,
const PhaseStopResult & phaseStop )
pure virtual

Implemented in JSMP, KeypointsMP, and TSMP.

◆ serialize()

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

◆ setDurationSec()

void setDurationSec ( Ice::Double timeDuration)

◆ setGoal()

void setGoal ( const DVec & goals)

◆ setRotationWeights()

void setRotationWeights ( const DVecVec & weights)

◆ setStart()

void setStart ( const DVec & starts)

◆ setStartAndGoal()

void setStartAndGoal ( const DVec & starts,
const DVec & goals )

◆ setTranslationWeights()

void setTranslationWeights ( const DVecVec & weights)

◆ setViaPoint()

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

◆ setWeight()

void setWeight ( const DVecVec & weights)

serialze

◆ start() [1/5]

void start ( )

control

◆ start() [2/5]

void start ( const DVec & goals)

◆ 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

◆ start() [4/5]

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

◆ start() [5/5]

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

◆ stop()

void stop ( )

◆ trainMP()

void trainMP ( )

◆ trainMPFromTraj()

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

◆ validateInitialState()

virtual void validateInitialState ( const DVec & starts)
inlinevirtual

Reimplemented in TSMP.

◆ validateViaPoint()

virtual DVec validateViaPoint ( const DVec & viapoint)
inlinevirtual

Reimplemented in TSMP.

Member Data Documentation

◆ canonicalValue

double canonicalValue = 1.0
protected

◆ cfg

MPConfig cfg
protected

◆ currentState

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

◆ finished

std::atomic_bool finished = false
protected

◆ firstRun

std::atomic_bool firstRun = true
protected

◆ goalSetByUser

std::atomic_bool goalSetByUser {false}
protected

◆ isDisturbance

bool isDisturbance = false
protected

◆ mpMutex

MutexType mpMutex
mutableprotected

◆ mpStartTimeSec

armarx::DateTime mpStartTimeSec
protected

◆ 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.

◆ paused

std::atomic_bool paused = false
protected

◆ prevViapoint

DVec prevViapoint

◆ running

std::atomic_bool running = false
protected

◆ stopRequested

std::atomic_bool stopRequested = false
protected

◆ targetPoseVec

DVec targetPoseVec
protected

◆ targetPoseVecInTraj

DVec targetPoseVecInTraj
protected

◆ userDefinedViaPoints

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

◆ vmp

VMPPtr vmp
protected

◆ vmpType

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

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