ChppRobotMotion Class Reference

Defines the motion of a robot along time. More...

#include <hpp/gik/robot/robot-motion.hh>

Public Member Functions

 ChppRobotMotion (CjrlHumanoidDynamicRobot *inRobot, double inStartTime, double inSamplingPeriod)
 Constructor. More...
 
 ~ChppRobotMotion ()
 Destructor. More...
 
void startTime (double inStartTime)
 Set lower bound of definition interval. More...
 
double startTime () const
 Get lower bound of definition interval. More...
 
double endTime () const
 Get upper bound of defintion interval. More...
 
const CjrlHumanoidDynamicRobot & robot ()
 Get robot for which motion is defined. More...
 
double samplingPeriod ()
 Get the sampling period of this motion. More...
 
void appendSample (const ChppRobotMotionSample &inSample)
 Append a new sample. More...
 
bool appendMotion (const ChppRobotMotion &inMotion)
 Append another robot motion. More...
 
void clear ()
 Delete stored motion. More...
 
void dumpTo (const char *inFilename, const char *option="w") const
 Motion dumper: More...
 
bool empty () const
 Tell if this robot motion object is empty. More...
 
const ChppRobotMotionSamplefirstSample ()
 This object keeps an iterator on the list of stored samples and it is reset by this method. More...
 
const ChppRobotMotionSamplenextSample ()
 This object keeps an iterator on the list of stored samples and it is incremented by this method to access the samples list sequentially. More...
 
const ChppRobotMotionSamplepreviousSample ()
 This object keeps an iterator on the list of stored samples and it is decremented by this method. More...
 
const ChppRobotMotionSamplelastSample ()
 Get a pointer to the last sample stored. More...
 
bool getSampleAtTime (double inTime, ChppRobotMotionSample &outSample) const
 Copy the sample corresponding to time. More...
 
unsigned int numberSamples () const
 Get the number of samples. More...
 

Detailed Description

Defines the motion of a robot along time.

The motion is stored as a list of ublas vectors.

Constructor & Destructor Documentation

◆ ChppRobotMotion()

ChppRobotMotion::ChppRobotMotion ( CjrlHumanoidDynamicRobot *  inRobot,
double  inStartTime,
double  inSamplingPeriod 
)

Constructor.

◆ ~ChppRobotMotion()

ChppRobotMotion::~ChppRobotMotion ( )

Destructor.

Member Function Documentation

◆ appendMotion()

bool ChppRobotMotion::appendMotion ( const ChppRobotMotion inMotion)

Append another robot motion.

The passed motion is copied sample by sample and added to the end of this motion.

Returns
false in case the robot associated to the passed motion is different.

◆ appendSample()

void ChppRobotMotion::appendSample ( const ChppRobotMotionSample inSample)

Append a new sample.

◆ clear()

void ChppRobotMotion::clear ( )

Delete stored motion.

◆ dumpTo()

void ChppRobotMotion::dumpTo ( const char *  inFilename,
const char *  option = "w" 
) const

Motion dumper:

5 files are produced for openHRP joint configuration freeflyer position freeflyer orientation zmp reference motion in waist frame observed zmp motion in waist frame 2 files are produced for debug: zmp reference motion in world frame zmp for solution motion in world frame

In all these files, a data sample is output to a line beginning by the sample time, starting from 0.0.

◆ empty()

bool ChppRobotMotion::empty ( ) const

Tell if this robot motion object is empty.

◆ endTime()

double ChppRobotMotion::endTime ( ) const

Get upper bound of defintion interval.

◆ firstSample()

const ChppRobotMotionSample* ChppRobotMotion::firstSample ( )

This object keeps an iterator on the list of stored samples and it is reset by this method.

Returns
a pointer to the first element in the list of stored samples. 0 is returned if the list is empty

◆ getSampleAtTime()

bool ChppRobotMotion::getSampleAtTime ( double  inTime,
ChppRobotMotionSample outSample 
) const

Copy the sample corresponding to time.

Parameters
inTimein
outSample
Returns
false if time out of bounds

◆ lastSample()

const ChppRobotMotionSample* ChppRobotMotion::lastSample ( )

Get a pointer to the last sample stored.

The returned pointer is null in case the motion is empty.

◆ nextSample()

const ChppRobotMotionSample* ChppRobotMotion::nextSample ( )

This object keeps an iterator on the list of stored samples and it is incremented by this method to access the samples list sequentially.

Returns
0 if the end of the list is met.

◆ numberSamples()

unsigned int ChppRobotMotion::numberSamples ( ) const

Get the number of samples.

◆ previousSample()

const ChppRobotMotionSample* ChppRobotMotion::previousSample ( )

This object keeps an iterator on the list of stored samples and it is decremented by this method.

Returns
first sample if current is sample is first, previous otherwise.

◆ robot()

const CjrlHumanoidDynamicRobot& ChppRobotMotion::robot ( )

Get robot for which motion is defined.

◆ samplingPeriod()

double ChppRobotMotion::samplingPeriod ( )

Get the sampling period of this motion.

◆ startTime() [1/2]

void ChppRobotMotion::startTime ( double  inStartTime)

Set lower bound of definition interval.

◆ startTime() [2/2]

double ChppRobotMotion::startTime ( ) const

Get lower bound of definition interval.