30#define GICP_ANALYTIC_JACOBIANS
33#include <Eigen/Geometry>
86 y = y - normal0(1) * normal0;
89 R0.row(0) = normal0.cross(R0.row(1));
100 y = y - normal1(1) * normal1;
103 R1.row(0) = normal1.cross(R1.row(1));
110 prec << e, 0, 0, 0, e, 0, 0, 0, 1;
111 return R0.transpose() * prec * R0;
118 prec << e, 0, 0, 0, e, 0, 0, 0, 1;
119 return R1.transpose() * prec * R1;
126 cov << 1, 0, 0, 0, 1, 0, 0, 0, e;
127 return R0.transpose() * cov * R0;
134 cov << 1, 0, 0, 0, 1, 0, 0, 0, e;
135 return R1.transpose() * cov * R1;
155 virtual bool read(std::istream& is);
156 virtual bool write(std::ostream& os)
const;
175 cout << _transforms[_cnum] << endl;
177 p1 = _transforms[_cnum].map(measurement().pos1);
182 p1 = vp1->
estimate() * measurement().pos1;
183 p1 = vp0->
estimate().inverse() * p1;
192 _error = p1 - measurement().pos0;
195 cout <<
"vp0" << endl << vp0->
estimate() << endl;
196 cout <<
"vp1" << endl << vp1->
estimate() << endl;
197 cout <<
"e Jac Xj" << endl << _jacobianOplusXj << endl << endl;
198 cout <<
"e Jac Xi" << endl << _jacobianOplusXi << endl << endl;
207 .topLeftCorner<3, 3>();
212#ifdef GICP_ANALYTIC_JACOBIANS
213 virtual void linearizeOplus();
230 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
235 virtual bool read(std::istream& is);
236 virtual bool write(std::ostream& os)
const;
240 VertexSE3::oplusImpl(update);
249 Eigen::Matrix<double, 3, 4, Eigen::ColMajor>
251 Eigen::Matrix<double, 3, 4, Eigen::ColMajor>
259 static void transformW2F(Eigen::Matrix<double, 3, 4, Eigen::ColMajor>& m,
261 m.block<3, 3>(0, 0) = qrot.toRotationMatrix().transpose();
269 static void transformF2W(Eigen::Matrix<double, 3, 4, Eigen::ColMajor>& m,
271 m.block<3, 3>(0, 0) = qrot.toRotationMatrix();
276 static void setKcam(
double fx,
double fy,
double cx,
double cy,
double tx) {
288 w2n = estimate().inverse().matrix().block<3, 4>(0, 0);
301 dRdx = dRidx * w2n.block<3, 3>(0, 0);
302 dRdy = dRidy * w2n.block<3, 3>(0, 0);
303 dRdz = dRidz * w2n.block<3, 3>(0, 0);
322 double invp1 =
cst(1.0) / p1(2);
323 res.head<2>() = p1.head<2>() * invp1;
326 p2 = Kcam * (p2 - pb);
327 res(2) = p2(0) / p2(2);
344 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
348 virtual bool read(std::istream& is);
349 virtual bool write(std::ostream& os)
const;
372 _error = kp - _measurement;
374#ifdef SCAM_ANALYTIC_JACOBIANS
376 virtual void linearizeOplus();
const EstimateType & estimate() const
return the current estimate of the vertex
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Point vertex, XYZ, is in types_sba.
Vertex for a tracked point in space.
Stereo camera vertex, derived from SE3 class. Note that we use the actual pose of the vertex as its p...
static void transformW2F(Eigen::Matrix< double, 3, 4, Eigen::ColMajor > &m, const Vector3 &trans, const Quaternion &qrot)
static void transformF2W(Eigen::Matrix< double, 3, 4, Eigen::ColMajor > &m, const Vector3 &trans, const Quaternion &qrot)
virtual void oplusImpl(const double *update)
static void setKcam(double fx, double fy, double cx, double cy, double tx)
Eigen::Matrix< double, 3, 4, Eigen::ColMajor > w2n
void mapPoint(Vector3 &res, const Vector3 &pt3)
Eigen::Matrix< double, 3, 4, Eigen::ColMajor > w2i
3D pose Vertex, represented as an Isometry3
#define G2O_TYPES_ICP_API
constexpr double cst(long double v)
Eigen::Quaternion< double > Quaternion
void transform(PlaneList &l, const SE3Quat &t)