G2O optimization

This is going to be a really quick tutorial on how to visualize the results of the sphere optimizatino and the slam2d optimization of G2O.

Sphere

We first are going to run the sphere optimization. We start by creating the sphere.

./create_sphere -o sphere.g2o

Running this program will create a sphere.g2o file that hold a sphere object to optimize.

./g2o_viewer sphere.g2o

Will load the sphere object in the g2o_viewer. Then you can just play with the interface to see the result of the optimization.

Slam

For visualizing tutorial_slam2d, run the program first.

./tutorial_slam2d

This will create two output files tutorial_before.g2o and tutorial_after.g2o that, as one can guess represent the graph of the slam before and after the optimization.

Now the next step is to visualize the results.

Open the output files are remove TUTORIAL_ from every node and edge names. For example :

TUTORIAL_VERTEX_POINT_XY 1 -2.16519 -0.515911

Becomes :

VERTEX_POINT_XY 1 -2.16519 -0.515911

Finally, open each of the two files generated in g2o_viwer with

./g2o_viewer tutorial_before.g2o

You should see this as a result :

Skärmbild från 2016-06-20 19-23-06
Before optimisation
Skärmbild från 2016-06-20 19-22-54
After optimization
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s