37 std::map<mrpt::system::TTimeStamp, mrpt::poses::CPose3D> old_path;
40 for (
const auto &
p: old_path) {
67 X[0] = p1.second.x; Y[0] = p1.second.y; Z[0] = p1.second.z;
68 X[1] = p2.second.x; Y[1] = p2.second.y; Z[1] = p2.second.z;
69 X[2] = p3.second.x; Y[2] = p3.second.y; Z[2] = p3.second.z;
70 X[3] = p4.second.x; Y[3] = p4.second.y; Z[3] = p4.second.z;
72 yaw[0] = p1.second.yaw;
pitch[0] = p1.second.pitch;
roll[0] = p1.second.roll;
73 yaw[1] = p2.second.yaw;
pitch[1] = p2.second.pitch;
roll[1] = p2.second.roll;
74 yaw[2] = p3.second.yaw;
pitch[2] = p3.second.pitch;
roll[2] = p3.second.roll;
75 yaw[3] = p4.second.yaw;
pitch[3] = p4.second.pitch;
roll[3] = p4.second.roll;
111 out_interp.x = math::leastSquareLinearFit<double,decltype(ts), 4>(td, ts, X);
112 out_interp.y = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Y);
113 out_interp.z = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
114 out_interp.yaw = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, yaw, true );
115 out_interp.pitch = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
pitch, true );
116 out_interp.roll = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
roll, true );
124 out_interp.z = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
125 out_interp.yaw = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, yaw, true );
126 out_interp.pitch = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
pitch, true );
127 out_interp.roll = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
roll, true );
135 out_interp.z = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts, Z);
137 out_interp.pitch = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
pitch, true );
138 out_interp.roll = math::leastSquareLinearFit<double, decltype(ts), 4>(td, ts,
roll, true );
144 const double ratio = (td-ts[1])/(ts[2]-ts[1]);
145 mrpt::math::slerp_ypr(TPose3D(0,0,0,yaw[1],
pitch[1],
roll[1]), TPose3D(0, 0, 0, yaw[2],
pitch[2],
roll[2]), ratio, out_interp);
155 const double ratio = (td - ts[1]) / (ts[2] - ts[1]);
156 mrpt::math::slerp_ypr(TPose3D(0, 0, 0, yaw[1],
pitch[1],
roll[1]), 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 BASE_IMPEXP 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 BASE_IMPEXP 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. ...