38 std::map<mrpt::system::TTimeStamp, mrpt::poses::CPose3D> old_path;
41 for (
const auto&
p : old_path)
83 yaw[0] = p1.second.yaw;
84 pitch[0] = p1.second.pitch;
85 roll[0] = p1.second.roll;
86 yaw[1] = p2.second.yaw;
87 pitch[1] = p2.second.pitch;
88 roll[1] = p2.second.roll;
89 yaw[2] = p3.second.yaw;
90 pitch[2] = p3.second.pitch;
91 roll[2] = p3.second.roll;
92 yaw[3] = p4.second.yaw;
93 pitch[3] = p4.second.pitch;
94 roll[3] = p4.second.roll;
126 td, ts[1], yaw[1], ts[2], yaw[2],
true);
130 td, ts[1],
roll[1], ts[2],
roll[2],
true);
137 math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, X);
139 math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Y);
141 math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
143 math::leastSquareLinearFit<double, decltype(ts), 4>(
146 math::leastSquareLinearFit<double, decltype(ts), 4>(
147 td, ts,
pitch,
true);
149 math::leastSquareLinearFit<double, decltype(ts), 4>(
159 math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
161 math::leastSquareLinearFit<double, decltype(ts), 4>(
164 math::leastSquareLinearFit<double, decltype(ts), 4>(
165 td, ts,
pitch,
true);
167 math::leastSquareLinearFit<double, decltype(ts), 4>(
177 math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
180 math::leastSquareLinearFit<double, decltype(ts), 4>(
181 td, ts,
pitch,
true);
183 math::leastSquareLinearFit<double, decltype(ts), 4>(
190 const double ratio = (td - ts[1]) / (ts[2] - ts[1]);
192 TPose3D(0, 0, 0, yaw[1],
pitch[1],
roll[1]),
193 TPose3D(0, 0, 0, yaw[2],
pitch[2],
roll[2]), ratio, out_interp);
206 const double ratio = (td - ts[1]) / (ts[2] - ts[1]);
208 TPose3D(0, 0, 0, yaw[1],
pitch[1],
roll[1]),
209 TPose3D(0, 0, 0, yaw[2],
pitch[2],
roll[2]), ratio, out_interp);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Base class for SE(2)/SE(3) interpolators.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
#define THROW_EXCEPTION(msg)
void slerp_ypr(const mrpt::math::TPose3D &q0, const mrpt::math::TPose3D &q1, const double t, mrpt::math::TPose3D &p)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
mrpt::poses::SE_traits< DIM >::lightweight_pose_t pose_t
TPose2D or TPose3D.
std::pair< mrpt::system::TTimeStamp, pose_t > TTimePosePair
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void unwrap2PiSequence(VECTOR &x)
Modify a sequence of angle values such as no consecutive values have a jump larger than PI in absolut...
NUMTYPE spline(const NUMTYPE t, const VECTORLIKE &x, const VECTORLIKE &y, bool wrap2pi=false)
Interpolates the value of a function in a point "t" given 4 SORTED points where "t" is between the tw...
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
A partial specialization of CArrayNumeric for double numbers.
This class stores a time-stamped trajectory in SE(3) (CPose3D poses).
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
double interpolate2points(const double x, const double x0, const double y0, const double x1, const double y1, bool wrap2pi=false)
Linear interpolation/extrapolation: evaluates at "x" the line (x0,y0)-(x1,y1).
TInterpolatorMethod
Type to select the interpolation method in CPoseInterpolatorBase derived classes. ...