class mrpt::poses::CPose2DInterpolator
Python API: mrpt.poses.CPose2DInterpolator
Overview
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:
Insert new poses into the sequence with CPose2DInterpolator::insert()
Query an exact/interpolated pose with CPose2DInterpolator::interpolate(). Example:
CPose2DInterpolator path; path.setInterpolationMethod( CPose2DInterpolator::imSplineSlerp ); path.insert( t0, mrpt::math::TPose2D(...) ); path.insert( t1, mrpt::math::TPose2D(...) ); mrpt::math::TPose2D p; bool valid; std::cout << "Pose at t: " << path.interpolate(t,p,valid).asString() << "\n";
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”.
See also:
#include <mrpt/poses/CPose2DInterpolator.h> class CPose2DInterpolator: public mrpt::serialization::CSerializable, public mrpt::poses::CPoseInterpolatorBase { public: // typedefs typedef std::shared_ptr<mrpt::poses ::CPose2DInterpolator> Ptr; typedef std::shared_ptr<const mrpt::poses ::CPose2DInterpolator> ConstPtr; typedef std::unique_ptr<mrpt::poses ::CPose2DInterpolator> UniquePtr; typedef std::unique_ptr<const mrpt::poses ::CPose2DInterpolator> ConstUniquePtr; // fields static constexpr const char* className = "mrpt::poses" "::" "CPose2DInterpolator"; // methods 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; virtual mrpt::rtti::CObject* clone() const; };
Inherited Members
public: // typedefs typedef std::shared_ptr<CObject> Ptr; typedef std::shared_ptr<const CObject> ConstPtr; typedef std::unique_ptr<CObject> UniquePtr; typedef std::unique_ptr<const CObject> ConstUniquePtr; typedef std::shared_ptr<CSerializable> Ptr; typedef std::shared_ptr<const CSerializable> ConstPtr; typedef typename Lie::SE<DIM>::light_type pose_t; typedef typename Lie::SE<DIM>::type cpose_t; typedef typename Lie::Euclidean<DIM>::light_type point_t; typedef std::pair<mrpt::Clock::time_point, pose_t> TTimePosePair; typedef std::map<mrpt::Clock::time_point, pose_t> TPath; typedef typename TPath::iterator iterator; typedef typename TPath::const_iterator const_iterator; typedef typename TPath::reverse_iterator reverse_iterator; typedef typename TPath::const_reverse_iterator const_reverse_iterator; // methods mrpt::rtti::CObject::Ptr duplicateGetSmartPtr() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual CObject* clone() const = 0; virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); iterator begin(); const_iterator begin() const; const_iterator cbegin() const; iterator end(); const_iterator end() const; const_iterator cend() const; reverse_iterator rbegin(); const_reverse_iterator rbegin() const; reverse_iterator rend(); const_reverse_iterator rend() const; iterator lower_bound(const mrpt::Clock::time_point& t); const_iterator lower_bound(const mrpt::Clock::time_point& t) const; iterator upper_bound(const mrpt::Clock::time_point& t); const_iterator upper_bound(const mrpt::Clock::time_point& t) const; iterator erase(iterator element_to_erase); size_t size() const; bool empty() const; iterator find(const mrpt::Clock::time_point& t); const_iterator find(const mrpt::Clock::time_point& t) const; pose_t& at(const mrpt::Clock::time_point& t); const pose_t& at(const mrpt::Clock::time_point& t) const; void insert(const mrpt::Clock::time_point& t, const pose_t& p); void insert(const mrpt::Clock::time_point& t, const cpose_t& p); pose_t& interpolate(const mrpt::Clock::time_point& t, pose_t& out_interp, bool& out_valid_interp) const; cpose_t& interpolate(const mrpt::Clock::time_point& t, cpose_t& out_interp, bool& out_valid_interp) const; void clear(); void setMaxTimeInterpolation(const mrpt::Clock::duration& time); mrpt::Clock::duration getMaxTimeInterpolation(); bool getPreviousPoseWithMinDistance(const mrpt::Clock::time_point& t, double distance, pose_t& out_pose); bool getPreviousPoseWithMinDistance(const mrpt::Clock::time_point& t, double distance, cpose_t& out_pose); bool saveToTextFile(const std::string& s) const; bool saveToTextFile_TUM(const std::string& s) const; bool saveInterpolatedToTextFile(const std::string& s, const mrpt::Clock::duration& period) const; bool loadFromTextFile(const std::string& s); bool loadFromTextFile_TUM(const std::string& s); void getBoundingBox(point_t& minCorner, point_t& maxCorner) const; void setInterpolationMethod(TInterpolatorMethod method); TInterpolatorMethod getInterpolationMethod() const; void filter(unsigned int component, unsigned int samples);
Typedefs
typedef std::shared_ptr<mrpt::poses ::CPose2DInterpolator> Ptr
A type for the associated smart pointer.
Methods
virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const
Returns information about the class of an object in runtime.
virtual mrpt::rtti::CObject* clone() const
Returns a deep copy (clone) of the object, indepently of its class.