Giter VIP home page Giter VIP logo

g2o_tutorial's Introduction

g2o tutorial

g2o is an open source c++ general graph optimization framework. It has been developed in the context of robotics and simultaneous localization and mapping however it is a general optimization framework and may easily be used for other purposes.

g2o github:

https://github.com/RainerKuemmerle/g2o

Original publication:

http://ais.informatik.uni-freiburg.de/publications/papers/kuemmerle11icra.pdf

Introduction/tutorial paper:

http://openslam.informatik.uni-freiburg.de/data/svn/g2o/trunk/g2o/doc/g2o.pdf

I found the example code in g2o not to be the best for getting started because there are no examples with visualizations, and all the code resides in the library, that is, they do not show how to use the library and related tools in your own project. This repository attempts to provide such examples.

I have just one example so far: 3D keyframe SLAM with a monocular camera. Bundle adjusts keyframe positions and landmarks using reprojection error assuming a pinhole camera model. Keyframe poses, landmarks and landmark observations are all synthetically generated

Installation

This has been programmed for ROS groovy using rosbuild. Should work for older versions of ROS too.

I don't know anything about this catkin business so please don't ask!

First install the sys debs:

sudo apt-get install libglew1.6-dev libglewmx1.6-dev glew-utils
sudo apt-get install libqt4-dev libqglviewer-qt4-dev
sudo apt-get install libsuitesparse-dev

Then compile:

g2o_tutorial/g2o_viewer$ rosmake

or compile one by one (g2o takes forever to compile and the compile output is less boring)

g2o_tutorial/g2o$ make
g2o_tutorial/g2o_example$ make
g2o_tutorial/g2o_viewer$ make

Run the example

Create a g2o graph using synthetic data

rosrun g2o_example example

View and optimize

rosrun g2o_viewer g2o_viewer example_g2o.g2o

Select a variant of lm for optimizing!

Understand the Code

Read g2o_example/src/main.cpp to see how to populate a g2o graph.

Read g2o_example/src/custom_types/* to see how to define your own types for g2o

Take note that g2o_viewer depends on g2o_example to pull in custom types. If you make your own types and want to visualize your graph with g2o_viewer, you will need to include an equivalent of register_types.h in g2o_viewer/g2o_viewer/g2o_view.cpp as well as link against your custom types lib in CMakeLists.txt

TODO

  • Include code to show how to optimize the graph (so far only optimizing with g2o viewer)
  • Bundle adjustment with real data
  • Example of optimization for extrinsic calibration

g2o_tutorial's People

Contributors

rosskidson avatar

Watchers

Tom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.