33 using namespace Eigen;
49 Edge_V_V_GICP::dRidx << 0.0,0.0,0.0,
52 Edge_V_V_GICP::dRidy << 0.0,0.0,-2.0,
55 Edge_V_V_GICP::dRidz << 0.0,2.0,0.0,
59 VertexSCam::dRidx << 0.0,0.0,0.0,
62 VertexSCam::dRidy << 0.0,0.0,-2.0,
65 VertexSCam::dRidz << 0.0,2.0,0.0,
74 using namespace Eigen;
75 typedef Matrix<double, 6, 1, Eigen::ColMajor>
Vector6d;
84 double VertexSCam::baseline;
129 for (
int i=0; i<3; i++)
131 for (
int i=0; i<3; i++)
135 for (
int i=0; i<3; i++)
137 for (
int i=0; i<3; i++)
169 #ifdef GICP_ANALYTIC_JACOBIANS 211 for (
int i=0; i<3; i++)
213 for (
int i=0; i<3; i++)
217 for (
int i=0; i<3; i++)
219 for (
int i=0; i<3; i++)
240 #ifdef SCAM_ANALYTIC_JACOBIANS 252 trans.head<3>() = vc->
estimate().translation();
256 Eigen::Matrix<double,3,1,Eigen::ColMajor> pc = vc->
w2n * pt;
263 double ipz2 = 1.0/(pz*pz);
266 std::cout <<
"[SetJac] infinite jac" << std::endl;
270 double ipz2fx = ipz2*vc->
Kcam(0,0);
271 double ipz2fy = ipz2*vc->
Kcam(1,1);
274 Eigen::Matrix<double,3,1,Eigen::ColMajor> pwt;
277 pwt = (pt-trans).head<3>();
280 Eigen::Matrix<double,3,1,Eigen::ColMajor> dp = vc->
dRdx * pwt;
281 _jacobianOplusXj(0,3) = (pz*dp(0) - px*dp(2))*ipz2fx;
282 _jacobianOplusXj(1,3) = (pz*dp(1) - py*dp(2))*ipz2fy;
283 _jacobianOplusXj(2,3) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
286 _jacobianOplusXj(0,4) = (pz*dp(0) - px*dp(2))*ipz2fx;
287 _jacobianOplusXj(1,4) = (pz*dp(1) - py*dp(2))*ipz2fy;
288 _jacobianOplusXj(2,4) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
291 _jacobianOplusXj(0,5) = (pz*dp(0) - px*dp(2))*ipz2fx;
292 _jacobianOplusXj(1,5) = (pz*dp(1) - py*dp(2))*ipz2fy;
293 _jacobianOplusXj(2,5) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
296 dp = -vc->
w2n.col(0);
297 _jacobianOplusXj(0,0) = (pz*dp(0) - px*dp(2))*ipz2fx;
298 _jacobianOplusXj(1,0) = (pz*dp(1) - py*dp(2))*ipz2fy;
299 _jacobianOplusXj(2,0) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
300 dp = -vc->
w2n.col(1);
301 _jacobianOplusXj(0,1) = (pz*dp(0) - px*dp(2))*ipz2fx;
302 _jacobianOplusXj(1,1) = (pz*dp(1) - py*dp(2))*ipz2fy;
303 _jacobianOplusXj(2,1) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
304 dp = -vc->
w2n.col(2);
305 _jacobianOplusXj(0,2) = (pz*dp(0) - px*dp(2))*ipz2fx;
306 _jacobianOplusXj(1,2) = (pz*dp(1) - py*dp(2))*ipz2fy;
307 _jacobianOplusXj(2,2) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
312 _jacobianOplusXi(0,0) = (pz*dp(0) - px*dp(2))*ipz2fx;
313 _jacobianOplusXi(1,0) = (pz*dp(1) - py*dp(2))*ipz2fy;
314 _jacobianOplusXi(2,0) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
316 _jacobianOplusXi(0,1) = (pz*dp(0) - px*dp(2))*ipz2fx;
317 _jacobianOplusXi(1,1) = (pz*dp(1) - py*dp(2))*ipz2fy;
318 _jacobianOplusXi(2,1) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
320 _jacobianOplusXi(0,2) = (pz*dp(0) - px*dp(2))*ipz2fx;
321 _jacobianOplusXi(1,2) = (pz*dp(1) - py*dp(2))*ipz2fy;
322 _jacobianOplusXi(2,2) = (pz*dp(0) - (px-
b)*dp(2))*ipz2fx;
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
const Vertex * vertex(size_t i) const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexSCam()
Eigen::Matrix< double, 3, 1, Eigen::ColMajor > Vector3D
virtual void linearizeOplus()
Eigen::Matrix< double, 4, 1, Eigen::ColMajor > Vector4D
virtual void linearizeOplus()
virtual bool write(std::ostream &os) const
write the vertex to a stream
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Edge_XYZ_VSC()
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
#define G2O_REGISTER_TYPE(name, classname)
JacobianXiOplusType _jacobianOplusXi
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
#define G2O_REGISTER_TYPE_GROUP(typeGroupName)
Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b()
return right hand side b of the constructed linear system
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor > Isometry3D
virtual bool write(std::ostream &os) const
write the vertex to a stream
Eigen::Matrix< double, 3, 3, Eigen::ColMajor > Matrix3D
abstract Vertex, your types must derive from that one
Eigen::Matrix< double, 3, 4, Eigen::ColMajor > w2n
EIGEN_STRONG_INLINE const InformationType & information() const
information matrix of the constraint
bool fixed() const
true => this node is fixed during the optimization
const EstimateType & estimate() const
return the current estimate of the vertex
Eigen::Matrix< double, 6, 1 > Vector6d
3D pose Vertex, represented as an Isometry3D
JacobianXjOplusType _jacobianOplusXj
virtual bool write(std::ostream &os) const
write the vertex to a stream
Stereo camera vertex, derived from SE3 class. Note that we use the actual pose of the vertex as its p...
EIGEN_STRONG_INLINE const Measurement & measurement() const
accessor functions for the measurement represented by the edge
#define G2O_ATTRIBUTE_CONSTRUCTOR(func)
VertexContainer _vertices