Base class for SE(2)/SE(3) interpolators.
See docs for derived classes.
Definition at line 47 of file CPoseInterpolatorBase.h.
#include <mrpt/poses/CPoseInterpolatorBase.h>
Public Member Functions | |
CPoseInterpolatorBase () | |
Default ctor: empty sequence of poses. More... | |
void | insert (mrpt::system::TTimeStamp t, const pose_t &p) |
Inserts a new pose in the sequence. More... | |
void | insert (mrpt::system::TTimeStamp t, const cpose_t &p) |
Overload (slower) More... | |
pose_t & | interpolate (mrpt::system::TTimeStamp t, pose_t &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. More... | |
cpose_t & | interpolate (mrpt::system::TTimeStamp t, cpose_t &out_interp, bool &out_valid_interp) const |
void | clear () |
Clears the current sequence of poses. More... | |
void | setMaxTimeInterpolation (double time) |
Set value of the maximum time to consider interpolation. More... | |
double | getMaxTimeInterpolation () |
Set value of the maximum time to consider interpolation. More... | |
bool | getPreviousPoseWithMinDistance (const mrpt::system::TTimeStamp &t, double distance, pose_t &out_pose) |
Get the previous CPose3D in the map with a minimum defined distance. More... | |
bool | getPreviousPoseWithMinDistance (const mrpt::system::TTimeStamp &t, double distance, cpose_t &out_pose) |
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: More... | |
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. More... | |
bool | loadFromTextFile (const std::string &s) |
Loads from a text file, in the format described by saveToTextFile. More... | |
void | getBoundingBox (point_t &minCorner, point_t &maxCorner) const |
Computes the bounding box in all Euclidean coordinates of the whole path. More... | |
void | setInterpolationMethod (TInterpolatorMethod method) |
Change the method used to interpolate the robot path. The default method at construction is "imSpline". More... | |
TInterpolatorMethod | getInterpolationMethod () const |
Returns the currently set interpolation method. More... | |
void | filter (unsigned int component, unsigned int samples) |
Filters by averaging one of the components of the pose data within the interpolator. More... | |
Protected Member Functions | |
void | impl_interpolation (const mrpt::math::CArrayDouble< 4 > &ts, const TTimePosePair p1, const TTimePosePair p2, const TTimePosePair p3, const TTimePosePair p4, const TInterpolatorMethod method, double td, pose_t &out_interp) const |
template<> | |
void | impl_interpolation (const mrpt::math::CArrayDouble< 4 > &ts, const TTimePosePair p1, const TTimePosePair p2, const TTimePosePair p3, const TTimePosePair p4, const TInterpolatorMethod method, double td, pose_t &out_interp) const |
template<> | |
void | impl_interpolation (const mrpt::math::CArrayDouble< 4 > &ts, const TTimePosePair p1, const TTimePosePair p2, const TTimePosePair p3, const TTimePosePair p4, const TInterpolatorMethod method, double td, pose_t &out_interp) const |
Protected Attributes | |
TPath | m_path |
The sequence of poses. More... | |
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. More... | |
TInterpolatorMethod | m_method |
typedef TPath::const_iterator mrpt::poses::CPoseInterpolatorBase< DIM >::const_iterator |
Definition at line 62 of file CPoseInterpolatorBase.h.
typedef TPath::const_reverse_iterator mrpt::poses::CPoseInterpolatorBase< DIM >::const_reverse_iterator |
Definition at line 64 of file CPoseInterpolatorBase.h.
typedef mrpt::poses::SE_traits<DIM>::pose_t mrpt::poses::CPoseInterpolatorBase< DIM >::cpose_t |
Definition at line 56 of file CPoseInterpolatorBase.h.
typedef TPath::iterator mrpt::poses::CPoseInterpolatorBase< DIM >::iterator |
Definition at line 61 of file CPoseInterpolatorBase.h.
typedef mrpt::poses::SE_traits<DIM>::point_t mrpt::poses::CPoseInterpolatorBase< DIM >::point_t |
TPoint2D or TPoint3D.
Definition at line 57 of file CPoseInterpolatorBase.h.
typedef mrpt::poses::SE_traits<DIM>::lightweight_pose_t mrpt::poses::CPoseInterpolatorBase< DIM >::pose_t |
TPose2D or TPose3D.
Definition at line 55 of file CPoseInterpolatorBase.h.
typedef TPath::reverse_iterator mrpt::poses::CPoseInterpolatorBase< DIM >::reverse_iterator |
Definition at line 63 of file CPoseInterpolatorBase.h.
typedef std::map<mrpt::system::TTimeStamp,pose_t> mrpt::poses::CPoseInterpolatorBase< DIM >::TPath |
Definition at line 60 of file CPoseInterpolatorBase.h.
typedef std::pair<mrpt::system::TTimeStamp,pose_t> mrpt::poses::CPoseInterpolatorBase< DIM >::TTimePosePair |
Definition at line 59 of file CPoseInterpolatorBase.h.
mrpt::poses::CPoseInterpolatorBase< DIM >::CPoseInterpolatorBase | ( | ) |
Default ctor: empty sequence of poses.
Definition at line 24 of file CPoseInterpolatorBase.hpp.
|
inline |
Definition at line 66 of file CPoseInterpolatorBase.h.
Referenced by mrpt::topography::path_from_rtk_gps(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
inline |
Definition at line 67 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 68 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 78 of file CPoseInterpolatorBase.h.
void mrpt::poses::CPoseInterpolatorBase< DIM >::clear | ( | ) |
Clears the current sequence of poses.
Definition at line 30 of file CPoseInterpolatorBase.hpp.
Referenced by mrpt::nav::CAbstractNavigator::internal_onStartNewNavigation(), mrpt::topography::path_from_rtk_gps(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
inline |
Definition at line 101 of file CPoseInterpolatorBase.h.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating().
|
inline |
Definition at line 76 of file CPoseInterpolatorBase.h.
Referenced by mrpt::topography::path_from_rtk_gps().
|
inline |
Definition at line 77 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 98 of file CPoseInterpolatorBase.h.
Referenced by mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
void mrpt::poses::CPoseInterpolatorBase< DIM >::filter | ( | unsigned int | component, |
unsigned int | samples | ||
) |
Filters by averaging one of the components of the pose data within the interpolator.
The width of the filter is set by the number of samples.
component | [IN] The index of the component to filter: 0 (x), 1 (y), 2 (z), 3 (yaw), 4 (pitch) or 5 (roll) |
samples | [IN] The width of the average filter. |
Definition at line 356 of file CPoseInterpolatorBase.hpp.
|
inline |
Definition at line 103 of file CPoseInterpolatorBase.h.
Referenced by mrpt::poses::CPoseInterpolatorBase< 3 >::getPreviousPoseWithMinDistance().
|
inline |
Definition at line 104 of file CPoseInterpolatorBase.h.
void mrpt::poses::CPoseInterpolatorBase< DIM >::getBoundingBox | ( | point_t & | minCorner, |
point_t & | maxCorner | ||
) | const |
Computes the bounding box in all Euclidean coordinates of the whole path.
std::exception | On empty path |
Definition at line 323 of file CPoseInterpolatorBase.hpp.
TInterpolatorMethod mrpt::poses::CPoseInterpolatorBase< DIM >::getInterpolationMethod | ( | ) | const |
Returns the currently set interpolation method.
Definition at line 350 of file CPoseInterpolatorBase.hpp.
double mrpt::poses::CPoseInterpolatorBase< DIM >::getMaxTimeInterpolation | ( | ) |
Set value of the maximum time to consider interpolation.
Definition at line 219 of file CPoseInterpolatorBase.hpp.
bool mrpt::poses::CPoseInterpolatorBase< DIM >::getPreviousPoseWithMinDistance | ( | const mrpt::system::TTimeStamp & | t, |
double | distance, | ||
pose_t & | out_pose | ||
) |
Get the previous CPose3D in the map with a minimum defined distance.
Definition at line 181 of file CPoseInterpolatorBase.hpp.
bool mrpt::poses::CPoseInterpolatorBase< DIM >::getPreviousPoseWithMinDistance | ( | const mrpt::system::TTimeStamp & | t, |
double | distance, | ||
cpose_t & | out_pose | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 172 of file CPoseInterpolatorBase.hpp.
|
protected |
Definition at line 50 of file CPose2DInterpolator.cpp.
|
protected |
Definition at line 60 of file CPose3DInterpolator.cpp.
|
protected |
void mrpt::poses::CPoseInterpolatorBase< DIM >::insert | ( | mrpt::system::TTimeStamp | t, |
const pose_t & | p | ||
) |
Inserts a new pose in the sequence.
It overwrites any previously existing pose at exactly the same time.
Definition at line 41 of file CPoseInterpolatorBase.hpp.
Referenced by mrpt::topography::path_from_rtk_gps(), TEST(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
void mrpt::poses::CPoseInterpolatorBase< DIM >::insert | ( | mrpt::system::TTimeStamp | t, |
const cpose_t & | p | ||
) |
Overload (slower)
Definition at line 36 of file CPoseInterpolatorBase.hpp.
CPoseInterpolatorBase< DIM >::pose_t & mrpt::poses::CPoseInterpolatorBase< DIM >::interpolate | ( | mrpt::system::TTimeStamp | t, |
pose_t & | 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. |
Definition at line 59 of file CPoseInterpolatorBase.hpp.
Referenced by mrpt::obs::CObservationVelodyneScan::generatePointCloudAlongSE3Trajectory(), mrpt::nav::CAbstractPTGBasedReactive::performNavigationStep(), and TEST().
CPoseInterpolatorBase< DIM >::cpose_t & mrpt::poses::CPoseInterpolatorBase< DIM >::interpolate | ( | mrpt::system::TTimeStamp | t, |
cpose_t & | out_interp, | ||
bool & | out_valid_interp | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 50 of file CPoseInterpolatorBase.hpp.
bool mrpt::poses::CPoseInterpolatorBase< DIM >::loadFromTextFile | ( | const std::string & | s | ) |
Loads from a text file, in the format described by saveToTextFile.
std::exception | On invalid file format |
Definition at line 289 of file CPoseInterpolatorBase.hpp.
|
inline |
Definition at line 92 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 93 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 86 of file CPoseInterpolatorBase.h.
Referenced by mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
inline |
Definition at line 87 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 89 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 90 of file CPoseInterpolatorBase.h.
bool mrpt::poses::CPoseInterpolatorBase< DIM >::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.
Definition at line 252 of file CPoseInterpolatorBase.hpp.
bool mrpt::poses::CPoseInterpolatorBase< DIM >::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:
Definition at line 225 of file CPoseInterpolatorBase.hpp.
void mrpt::poses::CPoseInterpolatorBase< DIM >::setInterpolationMethod | ( | TInterpolatorMethod | method | ) |
Change the method used to interpolate the robot path. The default method at construction is "imSpline".
Definition at line 344 of file CPoseInterpolatorBase.hpp.
Referenced by mrpt::nav::CAbstractNavigator::CAbstractNavigator(), and mrpt::topography::path_from_rtk_gps().
void mrpt::poses::CPoseInterpolatorBase< DIM >::setMaxTimeInterpolation | ( | double | time | ) |
Set value of the maximum time to consider interpolation.
If set to a negative value, the check is disabled (default behavior).
Definition at line 212 of file CPoseInterpolatorBase.hpp.
Referenced by mrpt::topography::path_from_rtk_gps().
|
inline |
Definition at line 100 of file CPoseInterpolatorBase.h.
Referenced by mrpt::topography::path_from_rtk_gps(), mrpt::nav::CAbstractNavigator::performNavigationStepNavigating(), TEST(), and mrpt::nav::CAbstractNavigator::updateCurrentPoseAndSpeeds().
|
inline |
Definition at line 95 of file CPoseInterpolatorBase.h.
|
inline |
Definition at line 96 of file CPoseInterpolatorBase.h.
|
protected |
Definition at line 172 of file CPoseInterpolatorBase.h.
|
protected |
The sequence of poses.
Definition at line 170 of file CPoseInterpolatorBase.h.
|
protected |
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 171 of file CPoseInterpolatorBase.h.
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |