DMPInstance Class Reference

#include <RobotComponents/components/DMPComponent/DMPInstance.h>

+ Inheritance diagram for DMPInstance:

Public Member Functions

nStateValues calcNextState (double t, const Ice::DoubleSeq &goal, double currentT, const Vec2D &currentStates, const Ice::DoubleSeq &canonicalValues, double temporalFactor, const ::Ice::Current &=Ice::emptyCurrent) override
 
nStateValues calcNextStateFromConfig (double t, double currentT, const Vec2D &currentStates, const Ice::DoubleSeq &canonicalValues, const Ice::Current &=Ice::emptyCurrent) override
 
Vec2D calcTrajectory (double startTime, double timestep, double endTime, const ::Ice::DoubleSeq &goal, const cStateVec &initStates, const ::Ice::DoubleSeq &canonicalValues, double temporalFactor, const Ice::Current &=Ice::emptyCurrent) override
 calcTrajectory solves the DMP for all Timesteps More...
 
Vec2D calcTrajectoryFromConfig (const Ice::DoubleSeq &timestamps, const Vec2D &initStates, const Ice::DoubleSeq &canonicalValues, const Ice::Current &=Ice::emptyCurrent) override
 
Vec2D calcTrajectoryV2 (const Ice::DoubleSeq &timestamps, const Ice::DoubleSeq &goal, const Vec2D &initStates, const Ice::DoubleSeq &canonicalValues, double temporalFactor, const Ice::Current &=Ice::emptyCurrent) override
 
configMap createConfigMap (DMP::Vec< std::string > paraIDs, DMP::Vec< paraType > paraVals)
 
 DMPInstance ()
 DMPInstance constructs an empty instance of a basicDMP. More...
 
 DMPInstance (DMP::DMPInterfacePtr dmpInter)
 
 DMPInstance (DMP::DMPInterfacePtr dmpInter, std::string DMPType)
 DMPInstance constructs a new instance of the specified DMP. More...
 
double getAmpl (int dim, const ::Ice::Current &=Ice::emptyCurrent) override
 getAmpl: get current amplitude of a dimension More...
 
Ice::DoubleSeq getCanonicalValues (const ::Ice::Current &=Ice::emptyCurrent) override
 getCanonicalValues: get current canonical values More...
 
cStateVec getCurrentState (const ::Ice::Current &=Ice::emptyCurrent) override
 getCurrentState: get current state in dmp More...
 
double getCurrentTime ()
 
double getDampingFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getDampingFactor: get dmp's damping factor More...
 
DMP::DMPInterfacePtr getDMP ()
 
int getDMPDim (const ::Ice::Current &=Ice::emptyCurrent) override
 getDMPDim: get dimesions of dmp More...
 
std::string getDMPType (const ::Ice::Current &=Ice::emptyCurrent) override
 getDMPType: get dmp type More...
 
double getForceTerm (const Ice::DoubleSeq &canVal, int dim, const ::Ice::Current &=Ice::emptyCurrent) override
 getForceTerm: get force termf for one dimension at a specified canonical values More...
 
Ice::DoubleSeq getGoal (const Ice::Current &=Ice::emptyCurrent)
 
cStateVec getNextState (const cStateVec &states, const ::Ice::Current &=Ice::emptyCurrent) override
 getNextState: get next state according to the state given More...
 
cStateVec getNextStateWithCurrentState (const ::Ice::Current &=Ice::emptyCurrent) override
 getNextState: get next state according to the state given More...
 
double getSpringFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getSpringFactor: get dmp's spring factor More...
 
Ice::DoubleSeq getStartPosition (const ::Ice::Current &=Ice::emptyCurrent) override
 getStartPosition: get start position of dmp More...
 
double getTemporalFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getTemporalFactor: get current temporal factor More...
 
Ice::DoubleSeq getTrajGoal (const ::Ice::Current &=Ice::emptyCurrent) override
 getTrajGoal: get the goal of the training trajectory More...
 
cStateVec getTrajStartState (const ::Ice::Current &=Ice::emptyCurrent) override
 getTrajStartState: get the start state of the training trajectory More...
 
void readTrajectoryFromFile (const std::string &file, double times=1, const ::Ice::Current &=Ice::emptyCurrent) override
 
void setAmpl (int dim, double value, const ::Ice::Current &=Ice::emptyCurrent) override
 setAmpl: set amplitude for dmp More...
 
void setCanonicalValues (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setCanonicalValues: set dmp canonicalValues to control the dmp's state More...
 
void setConfigurationMap (const DMPConfigMap &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setConfigurationMap set dmp configurations using configMap More...
 
void setCurrentTime (double t)
 
void setDMPState (const cStateVec &state, const ::Ice::Current &=Ice::emptyCurrent) override
 setDMPState set current state for dmp More...
 
void setGoal (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setGoal set the goal for dmp More...
 
void setParameter (const std::string &paraId, const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setParameter set parameters for More...
 
void setStartPosition (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setStartPosition set the start position for dmp More...
 
void setTemporalFactor (double value, const ::Ice::Current &=Ice::emptyCurrent) override
 setTemporalFactor: set dmp temporal factor More...
 
void setTimeStep (double ts)
 
void trainDMP (const ::Ice::Current &=Ice::emptyCurrent) override
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Protected Attributes

DMP::DVec canonicalValues
 
configMap configs
 
double ctime
 
DMP::DMPInterfacePtr dmp
 
std::string dmpName
 
cStateVec dmpState
 
std::string dmpType
 
double timestep
 
TrajVec trajs
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Additional Inherited Members

- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Detailed Description

Definition at line 82 of file DMPInstance.h.

Constructor & Destructor Documentation

◆ DMPInstance() [1/3]

DMPInstance ( )
inline

DMPInstance constructs an empty instance of a basicDMP.

Definition at line 91 of file DMPInstance.h.

◆ DMPInstance() [2/3]

DMPInstance ( DMP::DMPInterfacePtr  dmpInter)
inline

Definition at line 99 of file DMPInstance.h.

◆ DMPInstance() [3/3]

DMPInstance ( DMP::DMPInterfacePtr  dmpInter,
std::string  DMPType 
)

DMPInstance constructs a new instance of the specified DMP.

Parameters
dmpInterpointer to the dmp
DMPTypetype of dmp

Definition at line 87 of file DMPInstance.cpp.

Member Function Documentation

◆ calcNextState()

armarx::nStateValues calcNextState ( double  t,
const Ice::DoubleSeq &  goal,
double  currentT,
const Vec2D &  currentStates,
const Ice::DoubleSeq &  canonicalValues,
double  temporalFactor,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 129 of file DMPInstance.cpp.

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

◆ calcNextStateFromConfig()

armarx::nStateValues calcNextStateFromConfig ( double  t,
double  currentT,
const Vec2D &  currentStates,
const Ice::DoubleSeq &  canonicalValues,
const Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 185 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ calcTrajectory()

Vec2D calcTrajectory ( double  startTime,
double  timestep,
double  endTime,
const ::Ice::DoubleSeq &  goal,
const cStateVec &  initStates,
const ::Ice::DoubleSeq &  canonicalValues,
double  temporalFactor,
const Ice::Current &  = Ice::emptyCurrent 
)
override

calcTrajectory solves the DMP for all Timesteps

Calculates the Trajectory for the trained DMP given the goal and inital State for all Dimensions

Parameters
timestampsThe timesteps for which the trajecotry should be calculated
goalThe target(goal) position for all dimensions of the trajectory
initStatesthe initial States of the DMP
canonicalValuesThe canonical Value for the DMP
temporalFactorhis factor determines the duration of the trajectory. The duration scales linear with this factor.
Returns
The Trajectory which is created by the DMP, containing all the States of the DMP for each timestep

Definition at line 397 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ calcTrajectoryFromConfig()

Vec2D calcTrajectoryFromConfig ( const Ice::DoubleSeq &  timestamps,
const Vec2D &  initStates,
const Ice::DoubleSeq &  canonicalValues,
const Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 473 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ calcTrajectoryV2()

Vec2D calcTrajectoryV2 ( const Ice::DoubleSeq &  timestamps,
const Ice::DoubleSeq &  goal,
const Vec2D &  initStates,
const Ice::DoubleSeq &  canonicalValues,
double  temporalFactor,
const Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 433 of file DMPInstance.cpp.

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

◆ createConfigMap()

configMap createConfigMap ( DMP::Vec< std::string >  paraIDs,
DMP::Vec< paraType paraVals 
)

Definition at line 207 of file DMPInstance.cpp.

◆ getAmpl()

double getAmpl ( int  dim,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

getAmpl: get current amplitude of a dimension

Parameters
dimthe dimension concerned

Definition at line 294 of file DMPInstance.cpp.

◆ getCanonicalValues()

Ice::DoubleSeq getCanonicalValues ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getCanonicalValues: get current canonical values

Definition at line 187 of file DMPInstance.h.

◆ getCurrentState()

cStateVec getCurrentState ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getCurrentState: get current state in dmp

Definition at line 267 of file DMPInstance.h.

+ Here is the caller graph for this function:

◆ getCurrentTime()

double getCurrentTime ( )
inline

Definition at line 310 of file DMPInstance.h.

◆ getDampingFactor()

double getDampingFactor ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getDampingFactor: get dmp's damping factor

Definition at line 195 of file DMPInstance.h.

◆ getDMP()

DMP::DMPInterfacePtr getDMP ( )
inline

Definition at line 294 of file DMPInstance.h.

◆ getDMPDim()

int getDMPDim ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getDMPDim: get dimesions of dmp

Definition at line 219 of file DMPInstance.h.

◆ getDMPType()

std::string getDMPType ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getDMPType: get dmp type

Definition at line 211 of file DMPInstance.h.

◆ getForceTerm()

double getForceTerm ( const Ice::DoubleSeq &  canVal,
int  dim,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

getForceTerm: get force termf for one dimension at a specified canonical values

Parameters
canValcorresponding canonical value
dimthe dimension concerned

Definition at line 304 of file DMPInstance.cpp.

◆ getGoal()

Ice::DoubleSeq getGoal ( const Ice::Current &  = Ice::emptyCurrent)

Definition at line 309 of file DMPInstance.cpp.

+ Here is the caller graph for this function:

◆ getNextState()

cStateVec getNextState ( const cStateVec &  states,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

getNextState: get next state according to the state given

Parameters
statesthe current state given to the function

Definition at line 97 of file DMPInstance.cpp.

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

◆ getNextStateWithCurrentState()

cStateVec getNextStateWithCurrentState ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getNextState: get next state according to the state given

Definition at line 255 of file DMPInstance.h.

+ Here is the call graph for this function:

◆ getSpringFactor()

double getSpringFactor ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getSpringFactor: get dmp's spring factor

Definition at line 203 of file DMPInstance.h.

◆ getStartPosition()

Ice::DoubleSeq getStartPosition ( const ::Ice::Current &  = Ice::emptyCurrent)
inlineoverride

getStartPosition: get start position of dmp

Definition at line 227 of file DMPInstance.h.

◆ getTemporalFactor()

double getTemporalFactor ( const ::Ice::Current &  = Ice::emptyCurrent)
override

getTemporalFactor: get current temporal factor

Definition at line 299 of file DMPInstance.cpp.

+ Here is the caller graph for this function:

◆ getTrajGoal()

Ice::DoubleSeq getTrajGoal ( const ::Ice::Current &  = Ice::emptyCurrent)
override

getTrajGoal: get the goal of the training trajectory

Definition at line 324 of file DMPInstance.cpp.

◆ getTrajStartState()

cStateVec getTrajStartState ( const ::Ice::Current &  = Ice::emptyCurrent)
override

getTrajStartState: get the start state of the training trajectory

Definition at line 336 of file DMPInstance.cpp.

◆ readTrajectoryFromFile()

void readTrajectoryFromFile ( const std::string &  file,
double  times = 1,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

Definition at line 353 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ setAmpl()

void setAmpl ( int  dim,
double  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setAmpl: set amplitude for dmp

Parameters
dimthe dimension concerned
valuenew amplitude

Definition at line 250 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ setCanonicalValues()

void setCanonicalValues ( const Ice::DoubleSeq &  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setCanonicalValues: set dmp canonicalValues to control the dmp's state

Parameters
valuecurrent canonical values needed

Definition at line 245 of file DMPInstance.cpp.

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

◆ setConfigurationMap()

void setConfigurationMap ( const DMPConfigMap &  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setConfigurationMap set dmp configurations using configMap

Parameters
valueconfigMap saves all possible configurations for dmp

Definition at line 195 of file DMPInstance.cpp.

◆ setCurrentTime()

void setCurrentTime ( double  t)
inline

Definition at line 305 of file DMPInstance.h.

+ Here is the caller graph for this function:

◆ setDMPState()

void setDMPState ( const cStateVec &  state,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setDMPState set current state for dmp

Parameters
statestate to set

Definition at line 286 of file DMPInstance.cpp.

+ Here is the caller graph for this function:

◆ setGoal()

void setGoal ( const Ice::DoubleSeq &  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setGoal set the goal for dmp

Parameters
valuethe vector used to specify goal vector

Definition at line 260 of file DMPInstance.cpp.

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

◆ setParameter()

void setParameter ( const std::string &  paraId,
const Ice::DoubleSeq &  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setParameter set parameters for

Parameters
paraIdpointer to the dmp
valuetype of dmp

Definition at line 230 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ setStartPosition()

void setStartPosition ( const Ice::DoubleSeq &  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setStartPosition set the start position for dmp

Parameters
valuethe vector used to define start position

Definition at line 273 of file DMPInstance.cpp.

+ Here is the call graph for this function:

◆ setTemporalFactor()

void setTemporalFactor ( double  value,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

setTemporalFactor: set dmp temporal factor

Definition at line 255 of file DMPInstance.cpp.

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

◆ setTimeStep()

void setTimeStep ( double  ts)
inline

Definition at line 300 of file DMPInstance.h.

+ Here is the caller graph for this function:

◆ trainDMP()

void trainDMP ( const ::Ice::Current &  = Ice::emptyCurrent)
override

Definition at line 391 of file DMPInstance.cpp.

Member Data Documentation

◆ canonicalValues

DMP::DVec canonicalValues
protected

Definition at line 328 of file DMPInstance.h.

◆ configs

configMap configs
protected

Definition at line 321 of file DMPInstance.h.

◆ ctime

double ctime
protected

Definition at line 322 of file DMPInstance.h.

◆ dmp

DMP::DMPInterfacePtr dmp
protected

Definition at line 320 of file DMPInstance.h.

◆ dmpName

std::string dmpName
protected

Definition at line 327 of file DMPInstance.h.

◆ dmpState

cStateVec dmpState
protected

Definition at line 329 of file DMPInstance.h.

◆ dmpType

std::string dmpType
protected

Definition at line 319 of file DMPInstance.h.

◆ timestep

double timestep
protected

Definition at line 324 of file DMPInstance.h.

◆ trajs

TrajVec trajs
protected

Definition at line 326 of file DMPInstance.h.


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