24 #include <SimoxUtility/json.h>
27 #include <ArmarXCore/interface/core/BasicTypes.h>
28 #include <ArmarXCore/interface/serialization/Eigen.h>
30 #include <armarx/control/common/mp/aron/MPConfig.aron.generated.h>
32 #include <mplib/factories/AbstractMPFactory.h>
33 #include <mplib/factories/MPFactoryCreator.h>
34 #include <mplib/factories/VMPFactory.h>
35 #include <mplib/representation/vmp/PrincipalComponentVMP.h>
36 #include <mplib/representation/vmp/TaskSpacePrincipalComponentVMP.h>
37 #include <mplib/representation/vmp/VMP.h>
41 using namespace arondto;
42 using VMPPtr = std::shared_ptr<mplib::representation::vmp::PrincipalComponentVMP>;
46 using DVec = Ice::DoubleSeq;
70 MP(
const MPConfig&
c);
71 virtual ~
MP() =
default;
73 std::string getMPName();
74 std::string getClassName();
75 std::string getNodeSetName();
79 void start(
const DVec& goals);
82 void start(
const DVec& goals,
const DVec& starts);
92 void learnFromCSV(
const Ice::StringSeq& fileNames = std::vector<std::string>());
94 void trainMPFromTraj(std::vector<mplib::core::SampledTrajectory>& trajs);
98 void setGoal(
const DVec& goals);
99 void setStart(
const DVec& starts);
100 void setStartAndGoal(
const DVec& starts,
const DVec& goals);
102 void removeAllViaPoint();
105 void setWeight(
const DVecVec& weights);
106 void setTranslationWeights(
const DVecVec& weights);
107 void setRotationWeights(
const DVecVec& weights);
109 std::string serialize(
const std::string& mode =
"string");
110 DVec deserialize(
const std::string&,
const std::string& mode =
"string");
113 double getCanonicalValue();
118 resetVMPType(
const std::string& mpTypeString)
120 if (mpTypeString !=
"")
122 vmpType = mplib::representation::VMPType::_from_string_nocase(mpTypeString.c_str());
129 bool isDisturbance =
false;
133 mplib::representation::VMPType vmpType = mplib::representation::VMPType::PrincipalComponent;
135 std::atomic_bool running =
false;
136 std::atomic_bool finished =
false;
137 std::atomic_bool paused =
false;
138 double canonicalValue = 1.0;
140 std::atomic_bool goalSetByUser{
false};
143 std::atomic_bool mpTrained{
false};