LocalGuidance
A library that generates velocity references to follow a path.
dmp::GaussianKernel Class Reference

#include <GaussianKernel.hpp>

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW GaussianKernel ()
 
 ~GaussianKernel ()
 
bool initialize (const int numBasisFunctions, const double activation, const bool exponentiallySpaced=false, const double canSysCutOff=0.0)
 
bool learnWeights (const Eigen::VectorXd &inputVectorX, const Eigen::VectorXd &targetVectorY)
 
bool predict (const double queryX, double &predictionY, bool useModulationParameterX)
 
bool generateBasisFunctionMatrix (const Eigen::VectorXd &inputVectorX, Eigen::MatrixXd &basisFunctionMatrix)
 
bool generateBasisFunctionVector (const double &inputX, Eigen::VectorXd &basisFunctionVector)
 
bool getThetas (Eigen::VectorXd &thetas)
 
bool setThetas (const Eigen::VectorXd &thetas)
 
bool updateThetas (const Eigen::VectorXd &deltaThetas)
 
bool getInterpolatedTheta (const double &xInput, double &interpolatedTheta)
 
bool getWidthsAndCenters (Eigen::VectorXd &widths, Eigen::VectorXd &centers)
 
bool getNeighborCenterIndices (const double &inputX, int &previousNeighborIndex, int &nextNeighborIndex)
 
std::string getInfoString ()
 
bool getNumRFS (int &numBasisFunctions)
 

Private Member Functions

double getKernel (const double inputX, const int centerIndex)
 

Private Attributes

bool initialized_
 
int numBasisFunctions_
 
double basisFunctionWidthBoundary_
 
bool exponentiallySpaced_
 
Eigen::VectorXd centers_
 
Eigen::VectorXd widths_
 
Eigen::VectorXd thetas_
 
Eigen::VectorXd offsets_
 

Constructor & Destructor Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW dmp::GaussianKernel::GaussianKernel ( )
Returns
dmp::GaussianKernel::~GaussianKernel ( )

Member Function Documentation

bool dmp::GaussianKernel::generateBasisFunctionMatrix ( const Eigen::VectorXd &  inputVectorX,
Eigen::MatrixXd &  basisFunctionMatrix 
)
Parameters
inputX_vector
basis_function_matrix
Returns
True on success, false on failure
bool dmp::GaussianKernel::generateBasisFunctionVector ( const double &  inputX,
Eigen::VectorXd &  basisFunctionVector 
)
Parameters
inputX
basis_function_vector
Returns
True on success, false on failure
std::string dmp::GaussianKernel::getInfoString ( )

Writes the LWR model to file

Parameters
directoryName(input) Directory name in which the LWR model is stored.
Returns
True on success, false on failure
Parameters
directoryName
itemId
Returns

Returns a string containing relevant information of the Gaussian kernel model

Returns
bool dmp::GaussianKernel::getInterpolatedTheta ( const double &  xInput,
double &  interpolatedTheta 
)

Calculated the linearly interpolated theta value for inputX This function is used for logging and visualization

Parameters
inputX
interpolatedTheta
Returns
True on success, false on failure
double dmp::GaussianKernel::getKernel ( const double  inputX,
const int  centerIndex 
)
private

Evaluates the kernel

bool dmp::GaussianKernel::getNeighborCenterIndices ( const double &  inputX,
int &  previousNeighborIndex,
int &  nextNeighborIndex 
)

Gets the indices of the centers left and right to the value of inputX

Parameters
inputX
previousNeighborIndex
nextNeighborIndex
Returns
True on success, false on failure
bool dmp::GaussianKernel::getNumRFS ( int &  numBasisFunctions)

Gets the number of receptive fields

Returns
bool dmp::GaussianKernel::getThetas ( Eigen::VectorXd &  thetas)

Gets the theta vector

Parameters
thetas
Returns
True on success, false on failure
bool dmp::GaussianKernel::getWidthsAndCenters ( Eigen::VectorXd &  widths,
Eigen::VectorXd &  centers 
)
Parameters
widths
centers
Returns
True on success, false on failure
bool dmp::GaussianKernel::initialize ( const int  numBasisFunctions,
const double  activation,
const bool  exponentiallySpaced = false,
const double  canSysCutOff = 0.0 
)

Initialized the Gaussian kernel model

Parameters
numBasisFunctions
activation,designparameter, determines the variance/width of the kernels (value of activation is the point where a kernel intersects with its neighbors center)
Returns
True on success, false on failure
bool dmp::GaussianKernel::learnWeights ( const Eigen::VectorXd &  inputVectorX,
const Eigen::VectorXd &  targetVectorY 
)

Initializes the Gaussian kernel model using the parameters from the paramserver in the namespace parameter_namespace

Parameters
parameter_namespace
Returns

initialized LWR model from message

Parameters
model
Returns

Writes LWR model to message

Parameters
model
Returns
Parameters
x
y
Returns
True on success, false on failure
bool dmp::GaussianKernel::predict ( const double  queryX,
double &  predictionY,
bool  useModulationParameterX 
)
Parameters
x
y
Returns
True on success, false on failure
bool dmp::GaussianKernel::setThetas ( const Eigen::VectorXd &  thetas)

Sets the theta vector

Parameters
thetas
Returns
True on success, false on failure
bool dmp::GaussianKernel::updateThetas ( const Eigen::VectorXd &  deltaThetas)

updates the theta vectors (thetas += deltaThetas)

Parameters
deltaThetas
Returns
True on success, false on failure

Member Data Documentation

double dmp::GaussianKernel::basisFunctionWidthBoundary_
private

This value specifies at which value to neighboring functions will intersect

Eigen::VectorXd dmp::GaussianKernel::centers_
private

Centers of the receptive fields

bool dmp::GaussianKernel::exponentiallySpaced_
private

determines whether gaussians are exponentially spaced (true) or equally spaced (false) exponential scale is used to deal with the nonlinearity of the phase variable of the canonical system of a DMP

bool dmp::GaussianKernel::initialized_
private

Indicates whether the Gaussian kernel model is initialized

int dmp::GaussianKernel::numBasisFunctions_
private

Number of Gaussian basis functions used in this Gaussian kernel model

Eigen::VectorXd dmp::GaussianKernel::offsets_
private

Offsets of the local linear approximations. (currently not implemented)

Eigen::VectorXd dmp::GaussianKernel::thetas_
private

Slopes of the local linear approximations

Eigen::VectorXd dmp::GaussianKernel::widths_
private

Bandwidth used for each local model


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