30 #include <Eigen/Geometry> 35 _measurement(0., 0.), _dt(0.)
63 if (fabs(m.
theta()) > 1e-7) {
64 Eigen::Rotation2Dd rot(m.
theta());
68 const double& y2 = px2.y();
69 const double& x3 = px3.x();
70 const double& y3 = px3.y();
71 const double& x4 = px4.x();
72 const double& y4 = px4.y();
74 double R = (y2 * (x3*y4 - y3*x4)) / (y2 * (x3 - x4));
76 if (fabs(m.
dt()) > 1e-7)
81 double vl = (2.*R*w - w) / 2.;
87 if (fabs(m.
dt()) > 1e-7)
98 if (fabs(v.
vr() - v.
vl()) > 1e-7) {
99 double R = l * 0.5 * ((v.
vl() + v.
vr()) / (v.
vr() - v.
vl()));
100 double w = (v.
vr() - v.
vl()) / l;
103 Eigen::Rotation2Dd rot(theta);
109 double tv = 0.5 * (v.
vr() + v.
vl());
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Eigen::Matrix< double, 3, 1, Eigen::ColMajor > Vector3D
velocity measurement of a differential robot
static MotionMeasurement convertToMotion(const VelocityMeasurement &vi, double l=1.0)
A 2D odometry measurement expressed as a transformation.
static VelocityMeasurement convertToVelocity(const MotionMeasurement &m)