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 | Protected Member Functions | Protected Attributes
MMM::MotionRecording Class Reference
Inheritance diagram for MMM::MotionRecording:
[legend]

Public Member Functions

bool addMotion (MotionPtr motion)
 Add a motion.
 
bool addReplaceMotion (MotionPtr motion)
 Replace a motion with the same name in a list of motions with the given motion. Otherwise the motion will just be added. Returns true if a motion was replaced.
 
std::vector< MotionPtr >::iterator begin ()
 
MotionRecordingPtr clone (bool cloneSensors=true)
 clone Create a clone of this motion recording More...
 
MotionRecordingPtr cloneConfiguration ()
 
bool contains (const std::string &motionName)
 Returns 'True' if a motion is present with the given name.
 
bool containsMotionByName (MotionPtr motion)
 Returns 'True' if a motion is present having the same name as the given motion.
 
bool containsMotionWithAnySensor ()
 Returns 'True' if any motion contains sensor information.
 
bool containsMotionWithSensor (const std::string &type)
 Returns 'True' if any motion contains sensor information with a given type.
 
size_t countRefereceModelMotion ()
 Returns the number of mmm model reference motions in this recording.
 
bool empty ()
 Returns 'True' if no motions are in this motion recording.
 
std::vector< MotionPtr >::iterator end ()
 
float getCommonMaxTimestep ()
 Return the common maximum timestep of all motions.
 
float getCommonMinTimestep ()
 Return the common minimum timestep of all motions.
 
std::tuple< float, float > getCommonTimestepInterval ()
 Return the common minimum and maximum timestep of all motions.
 
void getCommonTimestepInterval (float &minTimestep, float &maxTimestep)
 Return the common minimum and maximum timestep of all motions.
 
std::string getDescription ()
 Returns the description of this recording.
 
MotionPtr getFirstMotion ()
 Returns the first motion in recording.
 
float getMaxTimestep (MotionPtr ignoreMotion=nullptr)
 Return the maximum timestep of all motions.
 
void getMinMaxTimesteps (float &minTimestep, float &maxTimestep)
 Return the minimum and timestep of all motions.
 
std::tuple< float, float > getMinMaxTimesteps (MotionPtr ignoreMotion=nullptr)
 Return the minimum and timestep of all motions.
 
float getMinTimestep (MotionPtr ignoreMotion=nullptr)
 Return the minimum timestep of all motions.
 
MotionRecordingPtr getMirroredMotionRecording ()
 
MotionPtr getMotion (const std::string &motionName)
 Returns the motion with the given name or nullptr if not available.
 
MotionPtr getMotion (unsigned int index)
 Returns the motion at given index or nullptr if size does not match.
 
MotionPtr getMotionByName (MotionPtr motion)
 Returns a motion with the same name as given motion or nullptr if not available.
 
std::vector< std::string > getMotionNames (MotionPtr ignoreMotion=nullptr)
 Return all motion names.
 
MotionRecordingPtr getMotionRecordingSegment (float startTimestep, float endTimestep, bool changeTimestep)
 
MotionPtr getMotionThrow (const std::string &motionName)
 Returns the motion with the given name. Throws MMMException if not available.
 
std::string getName ()
 Returns the name of this recording.
 
std::filesystem::path getOriginFilePath ()
 
MotionRecordingPtr getReducedMotion (bool changeTimestep)
 
MotionPtr getReferenceModelMotion ()
 
bool getReferencePose (Eigen::Matrix4f &referencePose, int &referenceAxis)
 
MotionRecordingSegmentPtr getSegment ()
 
void mirrorMotions ()
 
 MotionRecording (std::filesystem::path filePath="", const std::string &name=std::string(), const std::string &description=std::string())
 
MotionRecordingPtr motionsWithModel (bool logging=false)
 Returns all motions which contain a model.
 
MotionRecordingPtr motionsWithSensor (const std::string &type, bool logging=false)
 Returns all motions which contain a specific sensor type.
 
std::vector< MotionPtr >::iterator remove (MotionPtr motion)
 
void replaceAndSave (MotionPtr motion, const std::filesystem::path &motionFilePath)
 Replaces the motion with the same name and store at given filepath.
 
bool replaceMotionByName (MotionPtr motion)
 Replace a motion with the same name in a list of motions with the given motion. Returns true if a motion was replaced.
 
void saveXML (const std::filesystem::path &path, bool indent=true)
 saveXML Save containing motions as xml-based MMM dataformat More...
 
void setDescription (const std::string &description)
 Set the description of this recording.
 
void setMotionSegment (MotionRecordingSegmentPtr segment)
 
void setName (const std::string &name)
 Sets the name of this recording.
 
size_t size ()
 Returns the number of motions present.
 
void synchronizeMeasurements (float timeFrequency)
 Synchronizes all possible sensormeasurements on a specific time frequency via linear interpolation. Removes all sensors, that are not linear interpolatable.
 
void synchronizeSensorMeasurements (float timeFrequency)
 Synchronizes all possible sensormeasurements on a specific time frequency via linear interpolation. Removes all sensors, that are not linear interpolatable.
 
std::string toXML (const std::filesystem::path &path=std::string(), bool indent=true)
 toXML Returns the containing motions as xml-based MMM dataformat More...
 

Static Public Member Functions

static MotionRecordingPtr EmptyRecording ()
 Create a new empty motion recording.
 

Protected Member Functions

void add (MotionPtr motion)
 
simox::xml::RapidXMLWrapperNodePtr getXML (const std::filesystem::path &path)
 
bool isNameChangeAllowed (const std::string &name) override
 
void notifyIntervalChange (MotionPtr motion) override
 
void notifyMeasurementShift (MotionPtr motion, float delta) override
 
void notifyNameChange (MotionPtr motion, const std::string &oldName) override
 

Protected Attributes

std::string description
 
std::vector< MotionPtr > motions
 
std::string name
 
std::filesystem::path originFilePath
 
MotionRecordingSegmentPtr segment
 

Member Function Documentation

◆ clone()

MotionRecordingPtr MMM::MotionRecording::clone ( bool  cloneSensors = true)

clone Create a clone of this motion recording

Parameters
cloneSensorsIf sensor measurement should be cloned
Returns
cloned motion recording

◆ getReducedMotion()

MotionRecordingPtr MMM::MotionRecording::getReducedMotion ( bool  changeTimestep)

Returns a motion recording where min and max timestep match approximately

Here is the call graph for this function:

◆ getReferenceModelMotion()

MotionPtr MMM::MotionRecording::getReferenceModelMotion ( )

Returns the first mmm model reference motion in the list

◆ saveXML()

void MMM::MotionRecording::saveXML ( const std::filesystem::path &  path,
bool  indent = true 
)

saveXML Save containing motions as xml-based MMM dataformat

Parameters
pathWhere to store the xml file
indentUse indents
Here is the caller graph for this function:

◆ toXML()

std::string MMM::MotionRecording::toXML ( const std::filesystem::path &  path = std::string(),
bool  indent = true 
)

toXML Returns the containing motions as xml-based MMM dataformat

Parameters
pathWhere the motion will be stored later to create relative paths
indentUse indents
Returns
string in MMM data format

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