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

A Motion defines a series of MotionFrame snapshots. More...

#include <LegacyMotion.h>

Inheritance diagram for MMM::LegacyMotion:
[legend]

Public Types

enum  jointEnum { eValues, eVelocities, eAccelerations }
 Enumeration to specify set of joint parameters.
 

Public Member Functions

void addComment (const std::string &comment)
 
bool addMotionFrame (MotionFramePtr md)
 
void calculateAccelerations (int method=0)
 Calculate Joint Accelerations from Joint Velocities.
 
void calculateVelocities (int method=0)
 Calculate Joint Velocities from Joint Values.
 
LegacyMotionPtr copy ()
 
std::string getComment ()
 Returns comment strings combined to one std::string.
 
std::vector< std::string > getJointNames ()
 Returns the joint names.
 
ModelPtr getModel (bool processedModel=true)
 
const std::filesystem::path getModelFilePath ()
 
ModelProcessorPtr getModelProcessor ()
 
const std::filesystem::path & getMotionFileName ()
 returns the motion file name and extension
 
const std::filesystem::path & getMotionFilePath ()
 
MotionFramePtr getMotionFrame (size_t frame)
 
std::vector< MotionFramePtr > getMotionFrames ()
 Returns the vector with all MotionFrame objects.
 
std::string getName ()
 Returns the name.
 
virtual unsigned int getNumFrames ()
 
ProcessedModelWrapperPtr getProcessedModelWrapper ()
 
LegacyMotionPtr getSegmentMotion (size_t frame1, size_t frame2)
 get a segment motion from the original motion
 
LegacyMotionList getSegmentMotions (std::vector< int > segmentPoints)
 get a segmented motion list according to segment points
 
std::vector< double > getTimestamps ()
 get the time stamps of a motion
 
bool hasJoint (const std::string &name)
 Validates if a given joint name is present.
 
void joinMotion (LegacyMotionPtr next)
 join two motions
 
 LegacyMotion (const LegacyMotion &m)
 
EIGEN_MAKE_ALIGNED_OPERATOR_NEW LegacyMotion (const std::string &name)
 
void outputData (const std::string &filename)
 generate data for representing motions
 
void print ()
 Prints the XML string to std::cout.
 
void print (const std::string &filename)
 Prints the XML string to file.
 
bool removeMotionFrame (size_t frame)
 
void setComment (const std::string &comment)
 
bool setJointOrder (const std::vector< std::string > &jointNames)
 
void setModel (ProcessedModelWrapperPtr model)
 
void setModelProcessor (ModelProcessorPtr modelProcessor)
 
void setMotionFileName (const std::filesystem::path &filename)
 stores the motion file name and extension
 
void setMotionFilePath (const std::filesystem::path &filepath)
 
void setMotionFrames (std::vector< MotionFramePtr > &mfs)
 Sets the vector with all MotionFrame objects;.
 
void setName (const std::string &name)
 
void setStartPose (const Eigen::Matrix4f &startPose)
 set the start pose of the mmm model in the motion
 
void setStartPosition (const Eigen::Vector3f &startPosition)
 set the start position of the mmm model in the motion
 
void setStartTime (double start, double step=0.01)
 set start time point
 
void smoothJointValues (jointEnum type, int windowSize)
 Smooth out joint values, veloctities or accelerations (specifited by type) by applying a rolling mean filter of size windowSize.
 
virtual std::string toXML ()
 
- Public Member Functions inherited from MMM::AbstractMotion
virtual bool addEntry (const std::string &name, MotionEntryPtr entry)
 
virtual MotionEntryPtr getEntry (const std::string &name)
 Retrieve custom motion data entries. Name is internally converted to lowercase.
 
virtual bool hasEntry (const std::string &name) const
 Check if entry with name (lowercase) is present.
 
virtual bool removeEntry (const std::string &name)
 Remove custom entry.
 
bool saveXML (const std::string &filename)
 Stores MMM content to file.
 

Protected Attributes

std::vector< std::string > jointNames
 
ProcessedModelWrapperPtr model
 
ModelProcessorPtr modelProcessor
 
std::filesystem::path motionFileName
 
std::filesystem::path motionFilePath
 
std::vector< MotionFramePtr > motionFrames
 
std::string name
 
- Protected Attributes inherited from MMM::AbstractMotion
std::map< std::string, MotionEntryPtr > motionEntries
 Custom Entries are stored in this map.
 

Additional Inherited Members

- Static Public Member Functions inherited from MMM::AbstractMotion
template<typename M , typename std::enable_if< std::is_base_of< AbstractMotion, M >::value >::type * = nullptr>
static bool saveXML (const std::vector< std::shared_ptr< M >> &motions, const std::string &filename)
 Stores MMM content to file.
 
- Static Protected Member Functions inherited from MMM::AbstractMotion
static bool saveXML (const std::string &filename, const std::string &content)
 

Detailed Description

A Motion defines a series of MotionFrame snapshots.

The data covers position, velocity and acceleration of the models root position and orientation and a set of joint values, velocities and accelerations.

Member Function Documentation

◆ addMotionFrame()

bool MMM::LegacyMotion::addMotionFrame ( MotionFramePtr  md)

Adds a snapshot to the motion data. The dimensions of the joint data is checked against the internal ndof value. The data is added without checking the timestep order.

Parameters
mdThe data to add.
Returns
True on success.
Here is the caller graph for this function:

◆ getModel()

ModelPtr MMM::LegacyMotion::getModel ( bool  processedModel = true)

Return the model.

Parameters
processedModelIndicates weather the processed or the original model should be returned (If no modelProcessor is specified, the originalModel is always returned).
Returns
The model or ModelPtr() if no model is not specified.

◆ getModelProcessor()

ModelProcessorPtr MMM::LegacyMotion::getModelProcessor ( )

Return the ModelProcessor (if specified).

◆ getMotionFrame()

MotionFramePtr MMM::LegacyMotion::getMotionFrame ( size_t  frame)

Returns the corresponding frame. If frame is out of bounds, an empty MotionFrame is returned.

Here is the caller graph for this function:

◆ getNumFrames()

unsigned int MMM::LegacyMotion::getNumFrames ( )
virtual

Returns the number of entries.

Implements MMM::AbstractMotion.

Here is the caller graph for this function:

◆ setComment()

void MMM::LegacyMotion::setComment ( const std::string &  comment)

Specifies a comment string. Overwrites current comment. Adds standard MotionEntry with name "comments".

Here is the call graph for this function:

◆ setJointOrder()

bool MMM::LegacyMotion::setJointOrder ( const std::vector< std::string > &  jointNames)

The joint names can be specified here. This implicitly sets the number of DoFs.

◆ toXML()

std::string MMM::LegacyMotion::toXML ( )
virtual

Creates an XML string for this object.

Implements MMM::AbstractMotion.

Here is the caller 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