Go to the documentation of this file.
27 #include <Ice/ObjectAdapter.h>
29 #include <VirtualRobot/MathTools.h>
36 #include <ArmarXCore/interface/observers/VariantBase.h>
44 #include <MMM/Model/ModelReaderXML.h>
45 #include <MMM/Motion/Legacy/LegacyMotionReaderXML.h>
60 std::string armarxProjects = getProperty<std::string>(
"ArmarXProjects").getValue();
62 if (!armarxProjects.empty())
64 std::vector<std::string> projects =
armarx::Split(armarxProjects,
",;",
true,
true);
66 for (std::string& p : projects)
73 ARMARX_WARNING <<
"ArmarX Package " << p <<
" has not been found!";
83 std::string motionDefault = getProperty<std::string>(
"MMMFile").getValue();
85 if (!motionDefault.empty())
87 load(motionDefault,
"Armar4");
98 MMMPlayer::load(
const std::string& MMMFile,
const std::string& projects)
100 std::unique_lock lock(mmmMutex);
102 if (!projects.empty())
104 std::vector<std::string> proj =
armarx::Split(projects,
",;",
true,
true);
106 for (std::string& p : proj)
111 if (!finder.packageFound())
113 ARMARX_WARNING <<
"ArmarX Package " << p <<
" has not been found!";
117 ARMARX_INFO <<
"Adding to datapaths: " << finder.getDataDir();
127 getProperty<bool>(
"ApplyButterworthFilter").
getValue()
128 ? getProperty<float>(
"ButterworthFilterCutOffFreq")
133 motionData =
nullptr;
137 motionData = motionWrapper->getFirstMotionData();
144 load(MMMFile, projects);
145 return motionData !=
nullptr;
151 motionData = motionWrapper->getMotionData(motionName);
152 return motionData !=
nullptr;
158 return (
int)motionData->numberOfFrames;
170 return motionData->modelPath;
176 return motionData->jointNames;
184 return Ice::StringSeq();
186 return motionWrapper->getMotionNames();
192 return motionData !=
nullptr;
208 return motionData->getJointTrajectory();
214 return motionData->getPoseTrajectory();
void onConnectComponent() override
int getNumberOfFrames(const Ice::Current &) override
bool packageFound() const
Returns whether or not this package was found with cmake.
bool loadMMMFile(const std::string &filename, const std::string &projects, const Ice::Current &) override
void onDisconnectComponent() override
bool setMotionData(const std::string &motionName, const Ice::Current &) override
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitComponent() override
Ice::StringSeq getMotionNames(const Ice::Current &) override
void onInitComponent() override
TrajectoryBasePtr getBasePoseTraj(const Ice::Current &) override
std::string getDataDir() const
void terminate(const Process &p)
TrajectoryBasePtr getJointTraj(const Ice::Current &) override
std::string getModelPath(const Ice::Current &) override
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
static void addDataPaths(const std::string &dataPathList)
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Ice::StringSeq getJointNames(const Ice::Current &) override
bool isMotionLoaded(const Ice::Current &) override
void load(const mongocxx::database &db, armem::wm::Memory &m)
This file offers overloads of toIce() and fromIce() functions for STL container types.
static MotionFileWrapperPtr create(const std::string &motionFilePath, double butterworthFilterCutOffFreq=0.0, const std::string relativeModelRoot="mmm")
std::string getMotionPath(const Ice::Current &) override