Go to the documentation of this file.
28 #include <boost/archive/binary_iarchive.hpp>
29 #include <boost/archive/binary_oarchive.hpp>
30 #include <boost/archive/text_iarchive.hpp>
31 #include <boost/archive/text_oarchive.hpp>
32 #include <boost/archive/xml_iarchive.hpp>
33 #include <boost/archive/xml_oarchive.hpp>
34 #include <boost/variant/get.hpp>
35 #include <boost/variant/variant.hpp>
37 #include <RobotComponents/interface/components/DMPComponentBase.h>
39 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
40 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
41 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
42 #include <MemoryX/interface/memorytypes/MemorySegments.h>
46 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
47 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
48 #include <dmp/representation/dmp/dmpregistration.h>
49 #include <dmp/representation/dmpfactory.h>
50 #pragma GCC diagnostic pop
51 #pragma GCC diagnostic pop
86 defineOptionalProperty<std::string>(
87 "LongtermMemoryName",
"LongtermMemory",
"Name of the LongtermMemory component");
101 using DMPPair = std::pair<std::string, std::pair<DMPInstancePtr, DMPInstanceBasePrx>>;
102 using DMPMap = std::map<std::string, std::pair<DMPInstancePtr, DMPInstanceBasePrx>>;
121 return "DMPComponent";
134 DMPInstanceBasePrx
getDMP(
const std::string& dmpName,
135 const Ice::Current& = Ice::emptyCurrent)
override;
139 const std::string& dmpName =
"UNKNOWN",
140 const Ice::Current& = Ice::emptyCurrent)
override;
142 const Ice::Current&)
override;
144 const std::string& dmpName =
"UNKNOWN",
145 const Ice::Current& = Ice::emptyCurrent)
override;
148 const std::string& dmpName,
149 const Ice::Current&)
override;
151 const std::string& name,
152 const ::Ice::Current& = Ice::emptyCurrent)
override;
154 const ::Ice::Current& = Ice::emptyCurrent)
override;
160 const std::string& DMPType,
162 const ::Ice::Current& = Ice::emptyCurrent)
override;
165 const ::armarx::cStateVec& state,
166 const ::Ice::Current& = Ice::emptyCurrent)
override;
167 void setGoal(
const std::string& dmpName,
168 const Ice::DoubleSeq&
value,
169 const Ice::Current& = Ice::emptyCurrent)
override;
171 const Ice::DoubleSeq&
value,
172 const Ice::Current& = Ice::emptyCurrent)
override;
174 const Ice::DoubleSeq&
value,
175 const Ice::Current& = Ice::emptyCurrent)
override;
178 const std::string& file,
180 const ::Ice::Current& = Ice::emptyCurrent)
override;
182 void trainDMP(
const std::string& dmpName,
183 const ::Ice::Current& = Ice::emptyCurrent)
override;
184 void setAmpl(
const std::string& dmpName,
187 const ::Ice::Current& = Ice::emptyCurrent)
override;
188 double getAmpl(
const std::string& dmpName,
190 const ::Ice::Current& = Ice::emptyCurrent)
override;
194 const ::Ice::Current& = Ice::emptyCurrent)
override;
197 const ::Ice::Current& = Ice::emptyCurrent)
override;
204 const ::Ice::DoubleSeq& goal,
205 const cStateVec& states,
206 const ::Ice::DoubleSeq& canonicalValues,
207 double temporalFactor,
208 const ::Ice::Current& = Ice::emptyCurrent)
override;
217 void setTimeStep(
double ts, const ::Ice::Current& = Ice::emptyCurrent)
override;
219 double getCurrentTime(const ::Ice::Current& = Ice::emptyCurrent)
override;
221 void resetTime(const ::Ice::Current& = Ice::emptyCurrent)
override;
227 const ::Ice::Current& = Ice::emptyCurrent)
override;
230 const ::Ice::Current& = Ice::emptyCurrent)
override;
233 const Ice::DoubleSeq& canonicalValues,
235 const Ice::Current& = Ice::emptyCurrent)
override;
239 const cStateVec& states,
240 const ::Ice::Current& = Ice::emptyCurrent)
override;
242 const ::Ice::Current& = Ice::emptyCurrent)
override;
244 const ::Ice::Current& = Ice::emptyCurrent)
override;
245 Ice::DoubleSeq
getTrajGoal(
const std::string& dmpName,
246 const ::Ice::Current& = Ice::emptyCurrent)
override;
248 const ::Ice::Current& = Ice::emptyCurrent)
override;
250 std::string
getDMPType(
const std::string& dmpName,
251 const ::Ice::Current& = Ice::emptyCurrent)
override;
254 const ::Ice::Current& = Ice::emptyCurrent)
override;
256 SVector
getDMPNameList(const ::Ice::Current& = Ice::emptyCurrent)
override;
258 void eraseDMP(
const std::string& dmpName,
259 const ::Ice::Current& = Ice::emptyCurrent)
override;
261 const ::Ice::Current& = Ice::emptyCurrent)
override;
262 int getDMPDim(
const std::string& dmpName,
263 const ::Ice::Current& = Ice::emptyCurrent)
override;
271 DMPInstanceBasePrx findInstancePrx(std::string name);
::armarx::cStateVec getTrajStartState(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
Vec2D calcTrajectory(const std::string &dmpName, double startTime, double timeStep, double endTime, const ::Ice::DoubleSeq &goal, const cStateVec &states, const ::Ice::DoubleSeq &canonicalValues, double temporalFactor, const ::Ice::Current &=Ice::emptyCurrent) override
std::string getDefaultName() const override
DMPInstanceBasePrx instantiateDMP(const std::string &dmpName, const std::string &DMPType, int kernelSize, const ::Ice::Current &=Ice::emptyCurrent) override
std::string getDMPType(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void setTemporalFactor(const std::string &dmpName, double tau, const ::Ice::Current &=Ice::emptyCurrent) override
void setAmpl(const std::string &dmpName, int dim, double value, const ::Ice::Current &=Ice::emptyCurrent) override
DMPInstanceBasePrx getDMPFromDatabaseById(const std::string &dbId, const Ice::Current &) override
bool isDMPExist(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void storeDMPInFile(const std::string &fileName, const std::string &dmpName, const Ice::Current &) override
void setTimeStep(double ts, const ::Ice::Current &=Ice::emptyCurrent) override
memoryx::LongtermMemoryInterfacePrx longtermMemoryPrx
std::vector< int > usedDimensions
void setGoal(const std::string &dmpName, const Ice::DoubleSeq &value, const Ice::Current &=Ice::emptyCurrent) override
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
void setStartPosition(const std::string &dmpName, const Ice::DoubleSeq &value, const Ice::Current &=Ice::emptyCurrent) override
std::map< std::string, std::pair< DMPInstancePtr, DMPInstanceBasePrx > > DMPMap
void trainDMP(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void onConnectComponent() override
DMPInstanceBasePrx getDMP(const std::string &dmpName, const Ice::Current &=Ice::emptyCurrent) override
std::pair< DMPInstancePtr, DMPInstanceBasePrx > DMPInstancePair
DMPComponentPropertyDefinitions(std::string prefix)
void setCanonicalValues(const std::string &dmpName, const Ice::DoubleSeq &value, const Ice::Current &=Ice::emptyCurrent) override
double getCurrentTime(const ::Ice::Current &=Ice::emptyCurrent) override
std::shared_ptr< Value > value()
void removeDMPFromDatabaseById(const std::string &dbId, const Ice::Current &) override
void onExitComponent() override
memoryx::PersistentDMPDataSegmentBasePrx dmpDataMemoryPrx
double getTimeStep(const ::Ice::Current &=Ice::emptyCurrent) override
DMPInstanceBasePrx getDMPFromFile(const std::string &fileName, const std::string &dmpName="UNKNOWN", const Ice::Current &=Ice::emptyCurrent) override
Ice::DoubleSeq getCanonicalValues(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void setDMPState(const std::string &dmpName, const ::armarx::cStateVec &state, const ::Ice::Current &=Ice::emptyCurrent) override
double getAmpl(const std::string &dmpName, int dim, const ::Ice::Current &=Ice::emptyCurrent) override
void onDisconnectComponent() override
DMPInstanceBasePrx getDMPFromDatabase(const std::string &dmpEntityName, const std::string &dmpName="UNKNOWN", const Ice::Current &=Ice::emptyCurrent) override
void readTrajectoryFromFile(const std::string &dmpName, const std::string &file, double times=1, const ::Ice::Current &=Ice::emptyCurrent) override
Baseclass for all ArmarX ManagedIceObjects requiring properties.
int getDMPDim(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
std::pair< std::string, std::pair< DMPInstancePtr, DMPInstanceBasePrx > > DMPPair
void onInitComponent() override
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
double getDampingFactor(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
cStateVec getCurrentState(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void eraseDMP(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
Default component property definition container.
Ice::DoubleSeq getStartPosition(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void resetCanonicalValues(const ::Ice::Current &=Ice::emptyCurrent) override
void removeDMPFromDatabase(const std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
double getTemporalFactor(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
void storeDMPInDatabase(const std::string &dmpName, const std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
double getSpringFactor(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
SVector getDMPNameList(const ::Ice::Current &=Ice::emptyCurrent) override
cStateVec getNextState(const std::string &dmpName, const cStateVec &states, const ::Ice::Current &=Ice::emptyCurrent) override
Ice::DoubleSeq getTrajGoal(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
This file offers overloads of toIce() and fromIce() functions for STL container types.
void resetTime(const ::Ice::Current &=Ice::emptyCurrent) override
double getForceTerm(const std::string &dmpName, const Ice::DoubleSeq &canonicalValues, int dim, const Ice::Current &=Ice::emptyCurrent) override