26#include <boost/archive/binary_iarchive.hpp>
27#include <boost/archive/binary_oarchive.hpp>
28#include <boost/archive/text_iarchive.hpp>
29#include <boost/archive/text_oarchive.hpp>
30#include <boost/archive/xml_iarchive.hpp>
31#include <boost/archive/xml_oarchive.hpp>
35#include <RobotComponents/interface/components/FunctionApproximatorBase.h>
37#include <dmp/functionapproximation/functionapproximation.h>
38#include <dmp/functionapproximation/functionapproximationregistration.h>
39#include <dmp/functionapproximation/locallyweightedlearning.h>
40#include <dmp/functionapproximation/radialbasisfunctioninterpolator.h>
70 using FuncAppMap = std::map<std::string, DMP::FunctionApproximationInterfacePtr>;
71 using FuncAppPair = std::pair<std::string, DMP::FunctionApproximationInterfacePtr>;
75 virtual public armarx::FunctionApproximatorBase
80 DMP::DVec widthFactor;
81 widthFactor.push_back(10);
82 widthFactor.push_back(10);
91 return "FunctionApproximator";
124 const Ice::DoubleSeq& factors,
125 const Ice::Current&)
override;
126 void learn(
const std::string& name,
129 const Ice::Current&)
override;
131 predict(
const std::string& name,
const Ice::DoubleSeq&,
const Ice::Current&)
override;
132 void ilearn(
const std::string& name,
133 const Ice::DoubleSeq&,
135 const Ice::Current&)
override;
136 void blearn(
const std::string& name,
137 const Ice::DoubleSeq&,
138 const Ice::DoubleSeq&,
139 const Ice::Current&)
override;
141 bpredict(
const std::string& name,
const Ice::DoubleSeq&
x,
const Ice::Current&)
override;
144 const std::string& name,
145 const Ice::Current&)
override;
147 const std::string& filename,
148 const Ice::Current&)
override;
150 const std::string& name,
151 const Ice::Current&)
override;
156 void reset(
const Ice::Current&)
override;
159 const std::string& name);
160 void initializeTest(
const std::string& fappName,
const Ice::DoubleSeq& widthFactors);
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
FunctionApproximatorPropertyDefinitions(std::string prefix)
void onInitComponent() override
void initializeTest(const std::string &fappName, const Ice::DoubleSeq &widthFactors)
void blearn(const std::string &name, const Ice::DoubleSeq &, const Ice::DoubleSeq &, const Ice::Current &) override
void onDisconnectComponent() override
void reset(const Ice::Current &) override
void getFunctionApproximatorsFromFile(const std::vector< std::string > &funcNameList, const std::string &filename, const Ice::Current &) override
Ice::Double predict(const std::string &name, const Ice::DoubleSeq &, const Ice::Current &) override
void getFunctionApproximatorFromFile(const std::string &funcName, const std::string &name, const Ice::Current &) override
void initialize(const std::string &fappName, const Ice::DoubleSeq &factors, const Ice::Current &) override
void onConnectComponent() override
Ice::DoubleSeq bpredict(const std::string &name, const Ice::DoubleSeq &x, const Ice::Current &) override
void learn(const std::string &name, const DVector2d &, const DVector2d &, const Ice::Current &) override
void onExitComponent() override
void ilearn(const std::string &name, const Ice::DoubleSeq &, Ice::Double, const Ice::Current &) override
void saveFunctionApproximatorInFile(const std::string &funcName, const std::string &name, const Ice::Current &) override
void saveFunctionApproximatorInFileTest(const std::string &funcName, const std::string &name)
std::string getDefaultName() const override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::map< std::string, DMP::FunctionApproximationInterfacePtr > FuncAppMap
::IceInternal::Handle<::armarx::FunctionApproximator > FunctionApproximatorPtr
std::pair< std::string, DMP::FunctionApproximationInterfacePtr > FuncAppPair