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
 
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.
 
 DMPInstance (DMP::DMPInterfacePtr dmpInter)
 
 DMPInstance (DMP::DMPInterfacePtr dmpInter, std::string DMPType)
 DMPInstance constructs a new instance of the specified DMP.
 
double getAmpl (int dim, const ::Ice::Current &=Ice::emptyCurrent) override
 getAmpl: get current amplitude of a dimension
 
Ice::DoubleSeq getCanonicalValues (const ::Ice::Current &=Ice::emptyCurrent) override
 getCanonicalValues: get current canonical values
 
cStateVec getCurrentState (const ::Ice::Current &=Ice::emptyCurrent) override
 getCurrentState: get current state in dmp
 
double getCurrentTime ()
 
double getDampingFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getDampingFactor: get dmp's damping factor
 
DMP::DMPInterfacePtr getDMP ()
 
int getDMPDim (const ::Ice::Current &=Ice::emptyCurrent) override
 getDMPDim: get dimesions of dmp
 
std::string getDMPType (const ::Ice::Current &=Ice::emptyCurrent) override
 getDMPType: get dmp type
 
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
 
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
 
cStateVec getNextStateWithCurrentState (const ::Ice::Current &=Ice::emptyCurrent) override
 getNextState: get next state according to the state given
 
double getSpringFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getSpringFactor: get dmp's spring factor
 
Ice::DoubleSeq getStartPosition (const ::Ice::Current &=Ice::emptyCurrent) override
 getStartPosition: get start position of dmp
 
double getTemporalFactor (const ::Ice::Current &=Ice::emptyCurrent) override
 getTemporalFactor: get current temporal factor
 
Ice::DoubleSeq getTrajGoal (const ::Ice::Current &=Ice::emptyCurrent) override
 getTrajGoal: get the goal of the training trajectory
 
cStateVec getTrajStartState (const ::Ice::Current &=Ice::emptyCurrent) override
 getTrajStartState: get the start state of the training trajectory
 
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
 
void setCanonicalValues (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setCanonicalValues: set dmp canonicalValues to control the dmp's state
 
void setConfigurationMap (const DMPConfigMap &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setConfigurationMap set dmp configurations using configMap
 
void setCurrentTime (double t)
 
void setDMPState (const cStateVec &state, const ::Ice::Current &=Ice::emptyCurrent) override
 setDMPState set current state for dmp
 
void setGoal (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setGoal set the goal for dmp
 
void setParameter (const std::string &paraId, const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setParameter set parameters for
 
void setStartPosition (const Ice::DoubleSeq &value, const ::Ice::Current &=Ice::emptyCurrent) override
 setStartPosition set the start position for dmp
 
void setTemporalFactor (double value, const ::Ice::Current &=Ice::emptyCurrent) override
 setTemporalFactor: set dmp temporal factor
 
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.
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
 
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 LogSenderPtr & getLogSender () const
 Retrieve log sender.
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Constructor & Destructor Documentation

◆ DMPInstance() [1/3]

DMPInstance ( )
inline

DMPInstance constructs an empty instance of a basicDMP.

◆ DMPInstance() [2/3]

DMPInstance ( DMP::DMPInterfacePtr dmpInter)
inline

◆ 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

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

◆ calcNextStateFromConfig()

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

◆ 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

◆ calcTrajectoryFromConfig()

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

◆ 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

◆ createConfigMap()

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

◆ getAmpl()

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

getAmpl: get current amplitude of a dimension

Parameters
dimthe dimension concerned

◆ getCanonicalValues()

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

getCanonicalValues: get current canonical values

◆ getCurrentState()

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

getCurrentState: get current state in dmp

◆ getCurrentTime()

double getCurrentTime ( )
inline

◆ getDampingFactor()

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

getDampingFactor: get dmp's damping factor

◆ getDMP()

DMP::DMPInterfacePtr getDMP ( )
inline

◆ getDMPDim()

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

getDMPDim: get dimesions of dmp

◆ getDMPType()

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

getDMPType: get dmp type

◆ 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

◆ getGoal()

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

◆ 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

◆ getNextStateWithCurrentState()

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

getNextState: get next state according to the state given

◆ getSpringFactor()

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

getSpringFactor: get dmp's spring factor

◆ getStartPosition()

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

getStartPosition: get start position of dmp

◆ getTemporalFactor()

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

getTemporalFactor: get current temporal factor

◆ getTrajGoal()

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

getTrajGoal: get the goal of the training trajectory

◆ getTrajStartState()

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

getTrajStartState: get the start state of the training trajectory

◆ readTrajectoryFromFile()

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

◆ setAmpl()

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

setAmpl: set amplitude for dmp

Parameters
dimthe dimension concerned
valuenew amplitude

◆ 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

◆ 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

◆ setCurrentTime()

void setCurrentTime ( double t)
inline

◆ setDMPState()

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

setDMPState set current state for dmp

Parameters
statestate to set

◆ 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

◆ 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

◆ 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

◆ setTemporalFactor()

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

setTemporalFactor: set dmp temporal factor

◆ setTimeStep()

void setTimeStep ( double ts)
inline

◆ trainDMP()

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

Member Data Documentation

◆ canonicalValues

DMP::DVec canonicalValues
protected

◆ configs

configMap configs
protected

◆ ctime

double ctime
protected

◆ dmp

DMP::DMPInterfacePtr dmp
protected

◆ dmpName

std::string dmpName
protected

◆ dmpState

cStateVec dmpState
protected

◆ dmpType

std::string dmpType
protected

◆ timestep

double timestep
protected

◆ trajs

TrajVec trajs
protected

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