MRPT
1.9.9
|
This class stores a time-stamped trajectory in SE(2) (mrpt::math::TPose2D poses).
It can also interpolate SE(2) poses over time using linear, splines or SLERP interpolation, as set in CPose2DInterpolator::setInterpolationMethod() Usage:
Time is represented with mrpt::Clock::time_point. See mrpt::system for methods and utilities to manage these time references.
See TInterpolatorMethod for the list of interpolation methods. The default method at constructor is "imLinearSlerp".
Definition at line 48 of file CPose2DInterpolator.h.
#include <mrpt/poses/CPose2DInterpolator.h>
Public Member Functions | |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
void | insert (const mrpt::Clock::time_point &t, const pose_t &p) |
Inserts a new pose in the sequence. More... | |
void | insert (const mrpt::Clock::time_point &t, const cpose_t &p) |
Overload (slower) More... | |
pose_t & | interpolate (const mrpt::Clock::time_point &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 (const mrpt::Clock::time_point &t, cpose_t &out_interp, bool &out_valid_interp) const |
void | clear () |
Clears the current sequence of poses. More... | |
void | setMaxTimeInterpolation (const mrpt::Clock::duration &time) |
Set value of the maximum time to consider interpolation. More... | |
mrpt::Clock::duration | getMaxTimeInterpolation () |
Set value of the maximum time to consider interpolation. More... | |
bool | getPreviousPoseWithMinDistance (const mrpt::Clock::time_point &t, double distance, pose_t &out_pose) |
Get the previous CPose3D in the map with a minimum defined distance. More... | |
bool | getPreviousPoseWithMinDistance (const mrpt::Clock::time_point &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, const mrpt::Clock::duration &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. 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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | duplicateGetSmartPtr () const |
Makes a deep copy of the object and returns a smart pointer to it. More... | |
Protected Member Functions | |
void | impl_interpolation (const TTimePosePair &p1, const TTimePosePair &p2, const TTimePosePair &p3, const TTimePosePair &p4, const TInterpolatorMethod method, const mrpt::Clock::time_point &td, pose_t &out_interp) const |
void | impl_interpolation (const TTimePosePair &p1, const TTimePosePair &p2, const TTimePosePair &p3, const TTimePosePair &p4, const TInterpolatorMethod method, const mrpt::Clock::time_point &t, pose_t &out_interp) const |
void | impl_interpolation (const TTimePosePair &p1, const TTimePosePair &p2, const TTimePosePair &p3, const TTimePosePair &p4, const TInterpolatorMethod method, const mrpt::Clock::time_point &t, pose_t &out_interp) const |
CSerializable virtual methods | |
uint8_t | serializeGetVersion () const override |
Must return the current versioning number of the object. More... | |
void | serializeTo (mrpt::serialization::CArchive &out) const override |
Pure virtual method for writing (serializing) to an abstract archive. More... | |
void | serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override |
Pure virtual method for reading (deserializing) from an abstract archive. More... | |
CSerializable virtual methods | |
virtual void | serializeTo (CSchemeArchiveBase &out) const |
Virtual method for writing (serializing) to an abstract schema based archive. More... | |
virtual void | serializeFrom (CSchemeArchiveBase &in) |
Virtual method for reading (deserializing) from an abstract schema based archive. More... | |
Protected Attributes | |
TPath | m_path |
The sequence of poses. More... | |
mrpt::Clock::duration | maxTimeInterpolation |
Maximum time considered to interpolate. More... | |
TInterpolatorMethod | m_method |
RTTI stuff | |
using | Ptr = std::shared_ptr< mrpt::poses ::CPose2DInterpolator > |
using | ConstPtr = std::shared_ptr< const mrpt::poses ::CPose2DInterpolator > |
using | UniquePtr = std::unique_ptr< mrpt::poses ::CPose2DInterpolator > |
using | ConstUniquePtr = std::unique_ptr< const mrpt::poses ::CPose2DInterpolator > |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "mrpt::poses" "::" "CPose2DInterpolator" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static std::shared_ptr< CObject > | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename Alloc , typename... Args> | |
static Ptr | CreateAlloc (const Alloc &alloc, Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
|
inherited |
Definition at line 69 of file CPoseInterpolatorBase.h.
|
inherited |
Definition at line 71 of file CPoseInterpolatorBase.h.
using mrpt::poses::CPose2DInterpolator::ConstPtr = std::shared_ptr<const mrpt::poses :: CPose2DInterpolator > |
Definition at line 52 of file CPose2DInterpolator.h.
using mrpt::poses::CPose2DInterpolator::ConstUniquePtr = std::unique_ptr<const mrpt::poses :: CPose2DInterpolator > |
Definition at line 52 of file CPose2DInterpolator.h.
|
inherited |
Definition at line 62 of file CPoseInterpolatorBase.h.
|
inherited |
Definition at line 68 of file CPoseInterpolatorBase.h.
|
inherited |
TPoint2D or TPoint3D.
Definition at line 64 of file CPoseInterpolatorBase.h.
|
inherited |
TPose2D or TPose3D.
Definition at line 60 of file CPoseInterpolatorBase.h.
using mrpt::poses::CPose2DInterpolator::Ptr = std::shared_ptr< mrpt::poses :: CPose2DInterpolator > |
A type for the associated smart pointer
Definition at line 52 of file CPose2DInterpolator.h.
|
inherited |
Definition at line 70 of file CPoseInterpolatorBase.h.
|
inherited |
Definition at line 67 of file CPoseInterpolatorBase.h.
|
inherited |
Definition at line 66 of file CPoseInterpolatorBase.h.
using mrpt::poses::CPose2DInterpolator::UniquePtr = std::unique_ptr< mrpt::poses :: CPose2DInterpolator > |
Definition at line 52 of file CPose2DInterpolator.h.
|
staticprotected |
|
inlineinherited |
Definition at line 114 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 115 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 73 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 74 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 75 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 78 of file CPoseInterpolatorBase.h.
|
inherited |
Clears the current sequence of poses.
Definition at line 35 of file CPoseInterpolatorBase.hpp.
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
|
inlinestatic |
Definition at line 52 of file CPose2DInterpolator.h.
|
inlinestatic |
Definition at line 52 of file CPose2DInterpolator.h.
|
static |
|
inlinestatic |
Definition at line 52 of file CPose2DInterpolator.h.
|
inlineinherited |
Makes a deep copy of the object and returns a smart pointer to it.
Definition at line 204 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::insert().
|
inlineinherited |
Definition at line 108 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 76 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 77 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 101 of file CPoseInterpolatorBase.h.
|
inherited |
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 374 of file CPoseInterpolatorBase.hpp.
|
inlineinherited |
Definition at line 109 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 110 of file CPoseInterpolatorBase.h.
|
inherited |
Computes the bounding box in all Euclidean coordinates of the whole path.
std::exception | On empty path |
Definition at line 337 of file CPoseInterpolatorBase.hpp.
|
inlinestatic |
Definition at line 52 of file CPose2DInterpolator.h.
|
inherited |
Returns the currently set interpolation method.
Definition at line 368 of file CPoseInterpolatorBase.hpp.
|
inherited |
Set value of the maximum time to consider interpolation.
Definition at line 230 of file CPoseInterpolatorBase.hpp.
|
inherited |
Get the previous CPose3D in the map with a minimum defined distance.
Definition at line 191 of file CPoseInterpolatorBase.hpp.
|
inherited |
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 181 of file CPoseInterpolatorBase.hpp.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::serialization::CSerializable.
|
static |
|
protectedinherited |
Definition at line 45 of file CPose2DInterpolator.cpp.
|
protectedinherited |
Definition at line 56 of file CPose3DInterpolator.cpp.
|
protectedinherited |
|
inherited |
Inserts a new pose in the sequence.
It overwrites any previously existing pose at exactly the same time.
Definition at line 47 of file CPoseInterpolatorBase.hpp.
|
inherited |
Overload (slower)
Definition at line 41 of file CPoseInterpolatorBase.hpp.
|
inherited |
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 70 of file CPoseInterpolatorBase.hpp.
|
inherited |
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 58 of file CPoseInterpolatorBase.hpp.
|
inherited |
Loads from a text file, in the format described by saveToTextFile.
std::exception | On invalid file format |
Definition at line 303 of file CPoseInterpolatorBase.hpp.
|
inlineinherited |
Definition at line 83 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 87 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 79 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 80 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 81 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 82 of file CPoseInterpolatorBase.h.
|
inherited |
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 265 of file CPoseInterpolatorBase.hpp.
|
inherited |
Saves the points in the interpolator to a text file, with this format: Each row contains these elements separated by spaces:
Definition at line 236 of file CPoseInterpolatorBase.hpp.
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 26 of file CPose2DInterpolator.cpp.
References mrpt::poses::CPoseInterpolatorBase< 2 >::m_path, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
|
inlineprotectedvirtualinherited |
Virtual method for reading (deserializing) from an abstract schema based archive.
Definition at line 74 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
overrideprotectedvirtual |
Must return the current versioning number of the object.
Start in zero for new classes, and increments each time there is a change in the stored format.
Implements mrpt::serialization::CSerializable.
Definition at line 21 of file CPose2DInterpolator.cpp.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 22 of file CPose2DInterpolator.cpp.
References mrpt::poses::CPoseInterpolatorBase< 2 >::m_path, and out.
|
inlineprotectedvirtualinherited |
Virtual method for writing (serializing) to an abstract schema based archive.
Definition at line 64 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
inherited |
Change the method used to interpolate the robot path.
The default method at construction is "imSpline".
Definition at line 361 of file CPoseInterpolatorBase.hpp.
|
inherited |
Set value of the maximum time to consider interpolation.
If set to a negative value, the check is disabled (default behavior).
Definition at line 222 of file CPoseInterpolatorBase.hpp.
|
inlineinherited |
Definition at line 107 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 92 of file CPoseInterpolatorBase.h.
|
inlineinherited |
Definition at line 96 of file CPoseInterpolatorBase.h.
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB. Definition at line 90 of file CSerializable.h.
|
static |
Definition at line 52 of file CPose2DInterpolator.h.
|
protectedinherited |
Definition at line 212 of file CPoseInterpolatorBase.h.
|
protectedinherited |
The sequence of poses.
Definition at line 207 of file CPoseInterpolatorBase.h.
Referenced by serializeFrom(), and serializeTo().
|
protectedinherited |
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 211 of file CPoseInterpolatorBase.h.
|
staticprotected |
Definition at line 52 of file CPose2DInterpolator.h.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020 |