g2o
Functions
line3d_test.cpp File Reference
#include "line3d.h"
#include "g2o/types/slam3d/isometry3d_mappings.h"
#include "g2o/types/slam3d/isometry3d_gradients.h"
#include <iostream>
Include dependency graph for line3d_test.cpp:

Go to the source code of this file.

Functions

template<typename T >
ostream & printVector (ostream &os, const T &t)
 
int main (int, char **)
 

Function Documentation

int main ( int  ,
char **   
)

Definition at line 20 of file line3d_test.cpp.

References g2o::internal::fromVectorMQT(), g2o::internal::normalizeCartesianLine(), printVector(), g2o::Line3D::toCartesian(), and g2o::internal::transformCartesianLine().

21 {
22  Vector6d t;
23  t << -3, -2, -4, .2, .1, .3;
25  cout << "transform" << endl;
26  cout << T.matrix() << endl;
27 
28  Vector6d cl1;
29  cl1 << 20, 50, -70, .1, .2, .3;
30  cl1 =normalizeCartesianLine(cl1);
31  cout << "cartesian line L1: "; printVector(cout, cl1); cout << endl;
32  Line3D pl1 = Line3D::fromCartesian(cl1);
33  cout << "pluecker line L1: "; printVector(cout, pl1); cout << endl;
34  cout << "cartesian line L1, reconstructed from puecker: "; printVector(cout, pl1.toCartesian()); cout << endl;
35 
37  Line3D pl2 = T*pl1;;
38 
39  cout << "transformed line L2: "; printVector(cout, cl2); cout << endl;
40  cout << "transformed pline L2: "; printVector(cout, pl2); cout << endl;
41  cout << "error of cartesian line L2, reconstructed from puecker: "; printVector(cout, cl2 - pl2.toCartesian());
42  cout << endl;
43 
44  return 0;
45 }
Vector6d transformCartesianLine(const Isometry3D &t, const Vector6d &line)
Definition: line3d.cpp:108
ostream & printVector(ostream &os, const T &t)
Definition: line3d_test.cpp:12
Eigen::Transform< double, 3, Eigen::Isometry, Eigen::ColMajor > Isometry3D
Definition: eigen_types.h:66
G2O_TYPES_SLAM3D_ADDONS_API Vector6d toCartesian() const
Definition: line3d.cpp:51
Eigen::Matrix< double, 6, 1 > Vector6d
Isometry3D fromVectorMQT(const Vector6d &v)
Vector6d normalizeCartesianLine(const Vector6d &line)
Definition: line3d.cpp:115
template<typename T >
ostream& printVector ( ostream &  os,
const T &  t 
)

Definition at line 12 of file line3d_test.cpp.

Referenced by main().

13 {
14  for (int i=0; i<t.rows(); i++){
15  os << t(i) << " ";
16  }
17  return os;
18 }