#include <mrpt/poses/CPose3DInterpolator.h>
Public Types | |
enum | TInterpolatorMethod { imSpline = 0, imLinear2Neig, imLinear4Neig, imSSLLLL } |
Type to select the interpolation method in CPose3DInterpolator::setInterpolationMethod
| |
typedef TPath::iterator | iterator |
typedef TPath::const_iterator | const_iterator |
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
iterator | lower_bound (const mrpt::system::TTimeStamp &t) |
const_iterator | lower_bound (const mrpt::system::TTimeStamp &t) const |
iterator | upper_bound (const mrpt::system::TTimeStamp &t) |
const_iterator | upper_bound (const mrpt::system::TTimeStamp &t) const |
iterator | erase (iterator element_to_erase) |
size_t | size () const |
bool | empty () const |
CPose3DInterpolator () | |
Creates an empty interpolator (with no points). | |
void | insert (mrpt::system::TTimeStamp t, const CPose3D &p) |
Inserts a new pose in the sequence. | |
CPose3D & | interpolate (mrpt::system::TTimeStamp t, CPose3D &out_interp, bool &out_valid_interp) const |
Returns the pose at a given time, or interpolates using splines if there is not an exact match. | |
void | clear () |
Clears the current sequence of poses. | |
void | setMaxTimeInterpolation (double time) |
Set value of the maximum time to consider interpolation. | |
double | getMaxTimeInterpolation () |
Set value of the maximum time to consider interpolation. | |
bool | getPreviousPoseWithMinDistance (const mrpt::system::TTimeStamp &t, double distance, CPose3D &out_pose) |
Get the previous CPose3D in the map with a minimum defined distance. | |
bool | saveToTextFile (const std::string &s) const |
Saves the points in the interpolator to a text file, with this format: Each row contains these elements separated by spaces:
| |
bool | saveInterpolatedToTextFile (const std::string &s, double period) const |
Saves the points in the interpolator to a text file, with the same format that saveToTextFile, but interpolating the path with the given period in seconds. | |
bool | loadFromTextFile (const std::string &s) |
Loads from a text file, in the format described by saveToTextFile. | |
void | getBoundingBox (CPoint3D &minCorner, CPoint3D &maxCorner) const |
Computes the bounding box in X,Y,Z of the whole vehicle path. | |
void | setInterpolationMethod (TInterpolatorMethod method) |
Change the method used to interpolate the robot path. | |
TInterpolatorMethod | getInterpolationMethod () const |
Returns the currently set interpolation method. | |
Private Types | |
typedef mrpt::utils::map_serializable < mrpt::system::TTimeStamp, CPose3D > | TPath |
Private Attributes | |
TPath | m_path |
The sequence of poses. | |
double | maxTimeInterpolation |
Maximum time considered to interpolate. If the difference between the desired timestamp where to interpolate and the next timestamp stored in the map is bigger than this value, the interpolation will not be done. | |
TInterpolatorMethod | m_method |
To insert new points into the sequence, use the "insert" method, and for getting an interpolated point, use "interpolate" method. For example:
CPose3DInterpolator path; path.setInterpolationMethod( CPose3DInterpolator::imSpline ); path.insert( t0, CPose3D(...) ); path.insert( t1, CPose3D(...) ); path.insert( t2, CPose3D(...) ); path.insert( t3, CPose3D(...) ); CPose3D p; bool valid; cout << "Pose at t: " << path.interpolate(t,p,valid) << endl;
Time is represented with mrpt::system::TTimeStamp. See mrpt::system for methods and utilities to manage these time references.
See TInterpolatorMethod for the list of interpolation methods.
Definition at line 68 of file CPose3DInterpolator.h.
typedef TPath::const_iterator mrpt::poses::CPose3DInterpolator::const_iterator |
Definition at line 79 of file CPose3DInterpolator.h.
typedef TPath::iterator mrpt::poses::CPose3DInterpolator::iterator |
Definition at line 78 of file CPose3DInterpolator.h.
typedef mrpt::utils::map_serializable< mrpt::system::TTimeStamp, CPose3D > mrpt::poses::CPose3DInterpolator::TPath [private] |
Definition at line 74 of file CPose3DInterpolator.h.
Type to select the interpolation method in CPose3DInterpolator::setInterpolationMethod
Definition at line 87 of file CPose3DInterpolator.h.
mrpt::poses::CPose3DInterpolator::CPose3DInterpolator | ( | ) |
Creates an empty interpolator (with no points).
const_iterator mrpt::poses::CPose3DInterpolator::begin | ( | ) | const [inline] |
Definition at line 96 of file CPose3DInterpolator.h.
iterator mrpt::poses::CPose3DInterpolator::begin | ( | ) | [inline] |
Definition at line 95 of file CPose3DInterpolator.h.
void mrpt::poses::CPose3DInterpolator::clear | ( | ) |
Clears the current sequence of poses.
bool mrpt::poses::CPose3DInterpolator::empty | ( | ) | const [inline] |
Definition at line 110 of file CPose3DInterpolator.h.
const_iterator mrpt::poses::CPose3DInterpolator::end | ( | ) | const [inline] |
Definition at line 99 of file CPose3DInterpolator.h.
iterator mrpt::poses::CPose3DInterpolator::end | ( | ) | [inline] |
Definition at line 98 of file CPose3DInterpolator.h.
Definition at line 107 of file CPose3DInterpolator.h.
void mrpt::poses::CPose3DInterpolator::getBoundingBox | ( | CPoint3D & | minCorner, | |
CPoint3D & | maxCorner | |||
) | const |
Computes the bounding box in X,Y,Z of the whole vehicle path.
std::exception | On empty path |
TInterpolatorMethod mrpt::poses::CPose3DInterpolator::getInterpolationMethod | ( | ) | const |
double mrpt::poses::CPose3DInterpolator::getMaxTimeInterpolation | ( | ) |
Set value of the maximum time to consider interpolation.
bool mrpt::poses::CPose3DInterpolator::getPreviousPoseWithMinDistance | ( | const mrpt::system::TTimeStamp & | t, | |
double | distance, | |||
CPose3D & | out_pose | |||
) |
Get the previous CPose3D in the map with a minimum defined distance.
void mrpt::poses::CPose3DInterpolator::insert | ( | mrpt::system::TTimeStamp | t, | |
const CPose3D & | p | |||
) |
Inserts a new pose in the sequence.
It overwrites any previously existing pose at exactly the same time.
CPose3D& mrpt::poses::CPose3DInterpolator::interpolate | ( | mrpt::system::TTimeStamp | t, | |
CPose3D & | out_interp, | |||
bool & | out_valid_interp | |||
) | const |
Returns the pose at a given time, or interpolates using splines if there is not an exact match.
t | The time of the point to interpolate. | |
out_interp | The output interpolated pose. | |
out_valid_interp | Whether there was information enough to compute the interpolation. |
bool mrpt::poses::CPose3DInterpolator::loadFromTextFile | ( | const std::string & | s | ) |
Loads from a text file, in the format described by saveToTextFile.
std::exception | On invalid file format |
const_iterator mrpt::poses::CPose3DInterpolator::lower_bound | ( | const mrpt::system::TTimeStamp & | t | ) | const [inline] |
Definition at line 102 of file CPose3DInterpolator.h.
iterator mrpt::poses::CPose3DInterpolator::lower_bound | ( | const mrpt::system::TTimeStamp & | t | ) | [inline] |
Definition at line 101 of file CPose3DInterpolator.h.
bool mrpt::poses::CPose3DInterpolator::saveInterpolatedToTextFile | ( | const std::string & | s, | |
double | period | |||
) | const |
Saves the points in the interpolator to a text file, with the same format that saveToTextFile, but interpolating the path with the given period in seconds.
bool mrpt::poses::CPose3DInterpolator::saveToTextFile | ( | const std::string & | s | ) | const |
Saves the points in the interpolator to a text file, with this format: Each row contains these elements separated by spaces:
void mrpt::poses::CPose3DInterpolator::setInterpolationMethod | ( | TInterpolatorMethod | method | ) |
Change the method used to interpolate the robot path.
The default method at construction is "imSpline".
void mrpt::poses::CPose3DInterpolator::setMaxTimeInterpolation | ( | double | time | ) |
Set value of the maximum time to consider interpolation.
If set to a negative value, the check is disabled (default behavior).
size_t mrpt::poses::CPose3DInterpolator::size | ( | ) | const [inline] |
Definition at line 109 of file CPose3DInterpolator.h.
const_iterator mrpt::poses::CPose3DInterpolator::upper_bound | ( | const mrpt::system::TTimeStamp & | t | ) | const [inline] |
Definition at line 105 of file CPose3DInterpolator.h.
iterator mrpt::poses::CPose3DInterpolator::upper_bound | ( | const mrpt::system::TTimeStamp & | t | ) | [inline] |
Definition at line 104 of file CPose3DInterpolator.h.
Definition at line 188 of file CPose3DInterpolator.h.
double mrpt::poses::CPose3DInterpolator::maxTimeInterpolation [private] |
Maximum time considered to interpolate. If the difference between the desired timestamp where to interpolate and the next timestamp stored in the map is bigger than this value, the interpolation will not be done.
Definition at line 186 of file CPose3DInterpolator.h.
Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:35:09 EST 2009 |