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 | Protected Member Functions | Protected Attributes
MMM::LegacyMotionReaderXML Class Reference

The generic XML reader for legacy MMM motions. The following XML tags are initially supported by this reader: "comments", "description","joint_order","motion". Custom tag processors can be registered in order to read other data. Unknown tags are ignored by default. More...

#include <LegacyMotionReaderXML.h>

Inheritance diagram for MMM::LegacyMotionReaderXML:
[legend]

Public Member Functions

LegacyMotionPtr createMotionFromString (const std::string &xmlString, const std::string &motionName=std::string(), const std::filesystem::path &motionFilePath=std::string())
 
std::vector< std::string > getMotionNames (const std::filesystem::path &xmlFile) const
 
std::vector< std::string > getMotionNamesFromXMLString (std::string motionXML) const
 
bool isModelLoaded ()
 
EIGEN_MAKE_ALIGNED_OPERATOR_NEW LegacyMotionReaderXML (bool mmmOnly=false, bool logging=true)
 
LegacyMotionList loadAllMotions (const std::filesystem::path &xmlFile)
 
LegacyMotionList loadAllMotionsFromString (const std::string &xmlDataString)
 
LegacyMotionPtr loadMotion (const rapidxml::xml_node< char > *motionNode, const std::string &motionName, const std::filesystem::path &motionFilePath)
 
LegacyMotionPtr loadMotion (const std::filesystem::path &xmlFile, const std::string &motionName=std::string())
 
virtual bool processMotionFrameXMLTag (rapidxml::xml_node< char > *tag, MotionFramePtr motionframe)
 Implement the XMLMotionFrameTagProcessor method in order to process the standard motion-data tags.
 
virtual bool processMotionXMLTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 Implement the XMLTagProcessor method in order to process the standard MMM tags.
 
bool registerMotionFrameXMLTag (const std::string &xmlTag, XMLMotionFrameTagProcessorPtr processor)
 
bool registerMotionXMLTag (const std::string &xmlTag, XMLMotionTagProcessorPtr processor)
 
void setHandleMissingModelFile (const std::function< void(std::filesystem::path &)> &handleMissingModelFile)
 

Protected Member Functions

bool processCommentsTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool processJointOrderTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool processModelProcessorConfigTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool processModelTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool processMotionFramesTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool processMotionFrameTag (rapidxml::xml_node< char > *tag, LegacyMotionPtr motion)
 
bool registerMotionFrameXMLTag (const std::string &xmlTag, XMLMotionFrameTagProcessor *processor)
 
bool registerMotionXMLTag (const std::string &xmlTag, XMLMotionTagProcessor *processor)
 

Protected Attributes

bool logging
 
bool mmmOnly
 
ModelReaderXMLPtr mr
 
std::vector< XMLMotionTagProcessorPtr > processorList
 
std::vector< XMLMotionFrameTagProcessorPtr > processorListMotionFrame
 
std::map< std::string, XMLMotionTagProcessor * > xmlProcessors
 
std::map< std::string, XMLMotionFrameTagProcessor * > xmlProcessorsMotionFrame
 

Detailed Description

The generic XML reader for legacy MMM motions. The following XML tags are initially supported by this reader: "comments", "description","joint_order","motion". Custom tag processors can be registered in order to read other data. Unknown tags are ignored by default.

See also
XMLTagProcessor
XMLMotionFrameTagProcessor

Member Function Documentation

◆ createMotionFromString()

LegacyMotionPtr MMM::LegacyMotionReaderXML::createMotionFromString ( const std::string &  xmlString,
const std::string &  motionName = std::string(),
const std::filesystem::path &  motionFilePath = std::string() 
)

Parse the XML string and generate motion. A complete XML string is expected e.g <MMM><Motion> ... </Motion></MMM> In case an error was detected, an empty LegacyMotionPtr is returned.

Parameters
motionNameThe name of the motion. If empty, the first motion is used.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadMotion()

LegacyMotionPtr MMM::LegacyMotionReaderXML::loadMotion ( const std::filesystem::path &  xmlFile,
const std::string &  motionName = std::string() 
)

Load XML data.

Parameters
xmlFileThe xmlFile path.
motionNameThe name of the motion. If empty the first motion is selected.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerMotionFrameXMLTag()

bool MMM::LegacyMotionReaderXML::registerMotionFrameXMLTag ( const std::string &  xmlTag,
XMLMotionFrameTagProcessorPtr  processor 
)

Register factory methods for processing custom MotionFrame XML tags.

Parameters
xmlTagThe string that identifies this custom tag. Existing tag processors that are already registered with this name are overwritten.
processorThe factory that will create MotionFrameEntry objects.
Returns
True on success.

◆ registerMotionXMLTag()

bool MMM::LegacyMotionReaderXML::registerMotionXMLTag ( const std::string &  xmlTag,
XMLMotionTagProcessorPtr  processor 
)

Register factory methods for processing custom Motion XML tags.

Parameters
xmlTagThe string that identifies this custom tag. Existing tag processors that are already registered with this name are overwritten.
processorThe factory that will create MotionEntry objects.
Returns
True on success.

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