g2o
edge_se2_segment2d_pointLine.cpp
Go to the documentation of this file.
1 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
3 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
5 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 
8 
9 #ifdef WINDOWS
10 #include <windows.h>
11 #endif
12 
13 #ifdef G2O_HAVE_OPENGL
14 #ifdef __APPLE__
15 #include <OpenGL/gl.h>
16 #else
17 #include <GL/gl.h>
18 #endif
19 #endif
20 
21 namespace g2o {
22 
25  {
26  _pointNum = 0;
27  }
28 
29  bool EdgeSE2Segment2DPointLine::read(std::istream& is)
30  {
31  is >> _pointNum;
32  for (size_t i = 0; i < 3 ; i++)
33  is >> _measurement[i];
34  for (size_t i = 0; i < 3 ; i++)
35  for (size_t j = i; j < 3 ; j++) {
36  is >> _information (i,j);
37  _information (j,i) = _information (i,j);
38  }
39  return true;
40  }
41 
42  bool EdgeSE2Segment2DPointLine::write(std::ostream& os) const
43  {
44  os << _pointNum << " ";
45  for (size_t i = 0; i < 3 ; i++)
46  os << _measurement[i] << " ";
47  for (size_t i = 0; i < 3 ; i++)
48  for (size_t j = i; j < 3 ; j++) {
49  os << _information (i,j) << " ";
50  }
51  return os.good();
52  }
53 
54 } // end namespace
EIGEN_MAKE_ALIGNED_OPERATOR_NEW EdgeSE2Segment2DPointLine()
Eigen::Matrix< double, 3, 1, Eigen::ColMajor > Vector3D
Definition: eigen_types.h:46
InformationType _information
Definition: base_edge.h:88
2D pose Vertex, (x,y,theta)
Definition: vertex_se2.h:41
virtual bool write(std::ostream &os) const
write the vertex to a stream
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex