Karlsruhe Institute of Technology (KIT) Logo

Master Motor Map

Whole-body human reference model and tools for unifying representations of whole-body human motion

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
MMM::MotionReaderXML Class Reference

A generic xml reader for motions in the mmm dataformat. More...

#include <MotionReaderXML.h>

Public Member Functions

std::vector< std::filesystem::path > getMotionPathsFromDirectory (const std::filesystem::path &directoryPath, bool recursive=true, const std::string &regex=std::string(), unsigned int startIndex=0, bool printLog=false)
 
std::vector< MotionRecordingPtr > loadAllMotionRecordingsFromDirectory (const std::filesystem::path &directoryPath, bool recursive=false, unsigned int threads=1, const std::string &regex="", int maxNumber=-1, unsigned int startIndex=0, bool printLog=false)
 
std::vector< MotionRecordingPtr > loadAllMotionRecordingsFromPaths (const std::vector< std::filesystem::path > &paths, unsigned int threads=1, int maxNumber=-1, bool printLog=false)
 
MotionPtr loadMotion (const std::string &xml, const std::string &motionName, bool xmlIsPath=true)
 
MotionRecordingPtr loadMotionRecording (const std::string &xml, bool xmlIsPath=true)
 
 MotionReaderXML (bool convertLegacyMotions=true, bool mmmOnly=false, const std::vector< std::filesystem::path > &additionalLibPaths=std::vector< std::filesystem::path >(), bool loadUnknownSensors=true, bool ignoreStandardLibPaths=false)
 
 MotionReaderXML (const std::map< std::string, std::shared_ptr< SensorFactory > > &sensorFactories, bool convertLegacyMotions=true, bool mmmOnly=false, bool loadUnknownSensors=true)
 
void setHandleMissingModelFile (const std::function< void(std::filesystem::path &)> &handleMissingModelFile)
 

Static Public Member Functions

static std::filesystem::path getStandardLibPath ()
 

Static Public Attributes

static const std::string VERSION = "2.0"
 

Protected Member Functions

void error (const std::string &msg)
 
MotionPtr loadMotion (simox::xml::RapidXMLWrapperNodePtr motionNode, const std::filesystem::path &motionFilePath)
 
MotionPtr loadMotion (simox::xml::RapidXMLWrapperNodePtr motionNode, const std::string &version, const std::filesystem::path filePath)
 

Protected Attributes

std::map< std::string, std::shared_ptr< SensorFactory > > sensorFactories
 

Static Protected Attributes

static const std::string ERROR_MESSAGE = "Could not load motion file! "
 

Detailed Description

A generic xml reader for motions in the mmm dataformat.

Constructor & Destructor Documentation

◆ MotionReaderXML() [1/2]

MMM::MotionReaderXML::MotionReaderXML ( bool  convertLegacyMotions = true,
bool  mmmOnly = false,
const std::vector< std::filesystem::path > &  additionalLibPaths = std::vector<std::filesystem::path>(),
bool  loadUnknownSensors = true,
bool  ignoreStandardLibPaths = false 
)
Parameters
additionalLibPathsPaths to sensor plug-in folders. No need to include the standard folder.
ignoreStandardLibPathsJust use the given additional library Paths.
mmmOnlyOnly load motions with mmm reference model (mmm.xml)

◆ MotionReaderXML() [2/2]

MMM::MotionReaderXML::MotionReaderXML ( const std::map< std::string, std::shared_ptr< SensorFactory > > &  sensorFactories,
bool  convertLegacyMotions = true,
bool  mmmOnly = false,
bool  loadUnknownSensors = true 
)
Parameters
sensorFactoriesThe sensor factory plug-ins.
mmmOnlyOnly load motions with mmm reference model (mmm.xml)

Member Function Documentation

◆ loadMotion()

MotionPtr MMM::MotionReaderXML::loadMotion ( const std::string &  xml,
const std::string &  motionName,
bool  xmlIsPath = true 
)

Load a specific motion from an mmm dataformat xml document.

Parameters
xmlAn xml string or a path to an xml document.
motionNameThe name of the motion to load from the xml document.
xmlIsPathXml parameter is a path or string.
Exceptions
XMLFormatExceptionWhen the mmm data format is not applicable.
Here is the caller graph for this function:

◆ loadMotionRecording()

MotionRecordingPtr MMM::MotionReaderXML::loadMotionRecording ( const std::string &  xml,
bool  xmlIsPath = true 
)

Load all motions from an mmm dataformat xml document.

Parameters
xmlAn xml string or a path to an xml document.
xmlIsPathXml parameter is a path or string.
Exceptions
XMLFormatExceptionWhen the mmm data format is not applicable.
Here is the call graph for this function:

The documentation for this class was generated from the following files:
KoroiBot Logo WALK-MAN Logo Xperience Logo SecondHands Logo TimeStorm Logo I-SUPPORT Logo
PACO-PLUS Logo SFB-588 Logo SPP1527 Logo