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>
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!";
85 if (!motionDefault.empty())
87 load(motionDefault,
"Armar4");
98MMMPlayer::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();
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();
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
static void addDataPaths(const std::string &dataPathList)
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
std::string getDataDir() const
bool packageFound() const
Returns whether or not this package was found with cmake.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
void onInitComponent() override
std::string getMotionPath(const Ice::Current &) override
void onDisconnectComponent() override
bool isMotionLoaded(const Ice::Current &) override
Ice::StringSeq getMotionNames(const Ice::Current &) override
bool loadMMMFile(const std::string &filename, const std::string &projects, const Ice::Current &) override
std::string getModelPath(const Ice::Current &) override
int getNumberOfFrames(const Ice::Current &) override
void onConnectComponent() override
PropertyDefinitionsPtr createPropertyDefinitions() override
Ice::StringSeq getJointNames(const Ice::Current &) override
TrajectoryBasePtr getJointTraj(const Ice::Current &) override
bool setMotionData(const std::string &motionName, const Ice::Current &) override
void onExitComponent() override
TrajectoryBasePtr getBasePoseTraj(const Ice::Current &) override
void terminate()
Initiates termination of this IceManagedObject.
static MotionFileWrapperPtr create(const std::string &motionFilePath, double butterworthFilterCutOffFreq=0.0, const std::string relativeModelRoot="mmm")
Property< PropertyType > getProperty(const std::string &name)
Property creation and retrieval.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
T getValue(nlohmann::json &userConfig, nlohmann::json &defaultConfig, const std::string &entryName)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.