g2o
Public Slots | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MainWindow Class Reference

main window of the g2o viewer More...

#include <main_window.h>

Inheritance diagram for MainWindow:
Inheritance graph
[legend]
Collaboration diagram for MainWindow:
Collaboration graph
[legend]

Public Slots

void on_actionLoad_triggered (bool)
 
void on_actionSave_triggered (bool)
 
void on_actionQuit_triggered (bool)
 
void on_actionWhite_Background_triggered (bool)
 
void on_actionDefault_Background_triggered (bool)
 
void on_actionProperties_triggered (bool)
 
void on_actionSave_Screenshot_triggered (bool)
 
void on_actionLoad_Viewer_State_triggered (bool)
 
void on_actionSave_Viewer_State_triggered (bool)
 
void on_btnOptimize_clicked ()
 
void on_btnInitialGuess_clicked ()
 
void on_btnSetZero_clicked ()
 
void on_btnForceStop_clicked ()
 
void on_btnOptimizerParamaters_clicked ()
 
void on_actionLoad_triggered (bool)
 
void on_actionSave_triggered (bool)
 
void on_actionQuit_triggered (bool)
 
void on_btnOptimize_clicked ()
 
void on_btnInitialGuess_clicked ()
 

Public Member Functions

 MainWindow (QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~MainWindow ()
 
void updateDisplayedSolvers ()
 
void updateRobustKernels ()
 
bool loadFromFile (const QString &filename)
 
 MainWindow (QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~MainWindow ()
 

Public Attributes

g2o::OptimizationAlgorithmsolverGaussNewton
 
g2o::OptimizationAlgorithmsolverLevenberg
 

Protected Member Functions

void fixGraph ()
 
bool allocateSolver (bool &allocatedNewSolver)
 
bool prepare ()
 
void setRobustKernel ()
 
bool load (const QString &filename)
 
void fixGraph ()
 

Protected Attributes

std::vector< g2o::OptimizationAlgorithmProperty_knownSolvers
 
int _lastSolver
 
bool _forceStopFlag
 
g2o::OptimizationAlgorithmProperty _currentOptimizationAlgorithmProperty
 
g2o::OptimizationAlgorithm_currentSolver
 
ViewerPropertiesWidget_viewerPropertiesWidget
 
PropertiesWidget_optimizerPropertiesWidget
 

Detailed Description

main window of the g2o viewer

Definition at line 40 of file main_window.h.

Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

Definition at line 41 of file main_window.cpp.

41  :
42  QMainWindow(parent, flags),
44 {
45  setupUi(this);
46  leKernelWidth->setValidator(new QDoubleValidator(-numeric_limits<double>::max(), numeric_limits<double>::max(), 7, this));
47  plainTextEdit->setMaximumBlockCount(1000);
48  btnForceStop->hide();
49  QObject::connect(cbDrawAxis, SIGNAL(toggled(bool)), viewer, SLOT(setAxisIsDrawn(bool)));
50 }
PropertiesWidget * _optimizerPropertiesWidget
Definition: main_window.h:94
g2o::OptimizationAlgorithm * _currentSolver
Definition: main_window.h:91
int _lastSolver
Definition: main_window.h:88
ViewerPropertiesWidget * _viewerPropertiesWidget
Definition: main_window.h:93
MainWindow::~MainWindow ( )

Definition at line 52 of file main_window.cpp.

53 {
54 }
MainWindow::MainWindow ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)
MainWindow::~MainWindow ( )

Member Function Documentation

bool MainWindow::allocateSolver ( bool &  allocatedNewSolver)
protected

Definition at line 255 of file main_window.cpp.

References _currentOptimizationAlgorithmProperty, _currentSolver, _lastSolver, and g2o::OptimizationAlgorithmFactory::construct().

Referenced by on_btnOptimize_clicked(), and on_btnOptimizerParamaters_clicked().

256 {
257  if (coOptimizer->count() == 0) {
258  cerr << "No solvers available" << endl;
259  return false;
260  }
261  int currentIndex = coOptimizer->currentIndex();
262  bool enabled = qobject_cast<QStandardItemModel *>(coOptimizer->model())->item(currentIndex)->isEnabled();
263 
264  if (! enabled) {
265  cerr << "selected solver is not enabled" << endl;
266  return false;
267  }
268 
269  if (currentIndex == _lastSolver)
270  return true;
271 
272  allocatedNewSolver = true;
273  QString strSolver = coOptimizer->currentText();
274 
275  // delete the old optimization algorithm
276  OptimizationAlgorithm* algorithmPointer = const_cast<OptimizationAlgorithm*>(viewer->graph->algorithm());
277  viewer->graph->setAlgorithm(0);
278  delete algorithmPointer;
279 
280  // create the new algorithm
281  OptimizationAlgorithmFactory* solverFactory = OptimizationAlgorithmFactory::instance();
282  _currentSolver = solverFactory->construct(strSolver.toStdString(), _currentOptimizationAlgorithmProperty);
283  viewer->graph->setAlgorithm(_currentSolver);
284 
285  _lastSolver = currentIndex;
286  return true;
287 }
create solvers based on their short name
g2o::OptimizationAlgorithmProperty _currentOptimizationAlgorithmProperty
Definition: main_window.h:90
g2o::OptimizationAlgorithm * _currentSolver
Definition: main_window.h:91
Generic interface for a non-linear solver operating on a graph.
int _lastSolver
Definition: main_window.h:88
OptimizationAlgorithm * construct(const std::string &tag, OptimizationAlgorithmProperty &solverProperty) const
void MainWindow::fixGraph ( )
protected
void MainWindow::fixGraph ( )
protected

Definition at line 150 of file main_window.cpp.

References g2o::OptimizableGraph::Vertex::graph(), g2o::HyperGraph::Vertex::id(), and g2o::OptimizableGraph::Vertex::setFixed().

Referenced by loadFromFile().

151 {
152  if (viewer->graph->vertices().size() == 0 || viewer->graph->edges().size() == 0) {
153  return;
154  }
155 
156  // check for vertices to fix to remove DoF
157  bool gaugeFreedom = viewer->graph->gaugeFreedom();
158  g2o::OptimizableGraph::Vertex* gauge = viewer->graph->findGauge();
159  if (gaugeFreedom) {
160  if (! gauge) {
161  cerr << "cannot find a vertex to fix in this thing" << endl;
162  return;
163  } else {
164  cerr << "graph is fixed by node " << gauge->id() << endl;
165  gauge->setFixed(true);
166  }
167  } else {
168  cerr << "graph is fixed by priors or nodes are already fixed" << endl;
169  }
170 
171  viewer->graph->setVerbose(true);
172  //viewer->graph->computeActiveErrors();
173 }
int id() const
returns the id
Definition: hyper_graph.h:148
const OptimizableGraph * graph() const
A general case Vertex for optimization.
void setFixed(bool fixed)
true => this node should be considered fixed during the optimization
bool MainWindow::load ( const QString &  filename)
protected

Definition at line 229 of file main_window.cpp.

References _knownSolvers, _lastSolver, g2o::OptimizationAlgorithmProperty::desc, g2o::OptimizableGraph::dimensions(), g2o::OptimizableGraph::isSolverSuitable(), and g2o::OptimizationAlgorithmProperty::name.

Referenced by loadFromFile().

230 {
231  ifstream ifs(filename.toStdString().c_str());
232  if (! ifs)
233  return false;
234  viewer->graph->clear();
235  bool loadStatus = viewer->graph->load(ifs);
236  if (! loadStatus)
237  return false;
238  _lastSolver = -1;
239  viewer->setUpdateDisplay(true);
240  SparseOptimizer* optimizer = viewer->graph;
241 
242  // update the solvers which are suitable for this graph
243  set<int> vertDims = optimizer->dimensions();
244  for (size_t i = 0; i < _knownSolvers.size(); ++i) {
246  if (sp.name == "" && sp.desc == "")
247  continue;
248 
249  bool suitableSolver = optimizer->isSolverSuitable(sp, vertDims);
250  qobject_cast<QStandardItemModel *>(coOptimizer->model())->item(i)->setEnabled(suitableSolver);
251  }
252  return loadStatus;
253 }
std::string name
name of the solver, e.g., var
describe the properties of a solver
bool isSolverSuitable(const OptimizationAlgorithmProperty &solverProperty, const std::set< int > &vertDims=std::set< int >()) const
std::vector< g2o::OptimizationAlgorithmProperty > _knownSolvers
Definition: main_window.h:87
std::string desc
short description of the solver
std::set< int > dimensions() const
int _lastSolver
Definition: main_window.h:88
bool MainWindow::loadFromFile ( const QString &  filename)

load a graph on which we will operate from a file

Definition at line 352 of file main_window.cpp.

References fixGraph(), and load().

Referenced by on_actionLoad_triggered(), and g2o::RunG2OViewer::run().

353 {
354  viewer->graph->clear();
355  bool loadStatus = load(filename);
356  cerr << "loaded " << filename.toStdString() << " with " << viewer->graph->vertices().size()
357  << " vertices and " << viewer->graph->edges().size() << " measurements" << endl;
358  viewer->updateGL();
359  fixGraph();
360  return loadStatus;
361 }
void fixGraph()
bool load(const QString &filename)
void MainWindow::on_actionDefault_Background_triggered ( bool  )
slot

Definition at line 369 of file main_window.cpp.

370 {
371  viewer->setBackgroundColor(QColor::fromRgb(51, 51, 51));
372  viewer->updateGL();
373 }
void MainWindow::on_actionLoad_triggered ( bool  )
slot
void MainWindow::on_actionLoad_triggered ( bool  )
slot

Definition at line 56 of file main_window.cpp.

References loadFromFile().

57 {
58  QString filename = QFileDialog::getOpenFileName(this, "Load g2o file", "", "g2o files (*.g2o);;All Files (*)");
59  if (! filename.isNull()) {
60  loadFromFile(filename);
61  }
62 }
bool loadFromFile(const QString &filename)
void MainWindow::on_actionLoad_Viewer_State_triggered ( bool  )
slot

Definition at line 430 of file main_window.cpp.

431 {
432  QString filename = QFileDialog::getOpenFileName(this, "Load State", "camera.xml", "Camera/State file (*.xml)");
433  if (!filename.isEmpty()) {
434  viewer->setStateFileName(filename);
435  viewer->restoreStateFromFile();
436  viewer->setStateFileName(QString::null);
437  viewer->updateGL();
438  cerr << "Loaded state from " << filename.toStdString() << endl;
439  }
440 }
void MainWindow::on_actionProperties_triggered ( bool  )
slot

Definition at line 375 of file main_window.cpp.

References _viewerPropertiesWidget, and ViewerPropertiesWidget::setViewer().

376 {
377  if (! _viewerPropertiesWidget) {
379  _viewerPropertiesWidget->setWindowTitle(tr("Drawing Options"));
380  }
382  _viewerPropertiesWidget->show();
383 }
void setViewer(g2o::G2oQGLViewer *viewer)
ViewerPropertiesWidget * _viewerPropertiesWidget
Definition: main_window.h:93
void MainWindow::on_actionQuit_triggered ( bool  )
slot
void MainWindow::on_actionQuit_triggered ( bool  )
slot

Definition at line 175 of file main_window.cpp.

176 {
177  close();
178 }
void MainWindow::on_actionSave_Screenshot_triggered ( bool  )
slot

Definition at line 407 of file main_window.cpp.

408 {
409  QString selectedFilter;
410  QString filename = QFileDialog::getSaveFileName(this, "Save screen to a file", "viewer.png",
411  "PNG files (*.png);;JPG files (*.jpg);;EPS files (*.eps)", &selectedFilter);
412 
413  if (! filename.isNull()) {
414  // extract the file format from the filter options
415  int spacePos = selectedFilter.indexOf(' ');
416  assert(spacePos > 0 && "extracting the image format failed");
417  QString format = selectedFilter.left(spacePos);
418  // setting up the snapshot and save to file
419  if (format == "JPG") {
420  viewer->setSnapshotQuality(90);
421  } else {
422  viewer->setSnapshotQuality(-1);
423  }
424  viewer->setSnapshotFormat(format);
425  viewer->saveSnapshot(filename);
426  cerr << "saved snapshot " << filename.toStdString() << "(" << format.toStdString() << ")" << endl;
427  }
428 }
void MainWindow::on_actionSave_triggered ( bool  )
slot
void MainWindow::on_actionSave_triggered ( bool  )
slot

Definition at line 64 of file main_window.cpp.

65 {
66  QString filename = QFileDialog::getSaveFileName(this, "Save g2o file", "", "g2o files (*.g2o)");
67  if (! filename.isNull()) {
68  ofstream fout(filename.toStdString().c_str());
69  viewer->graph->save(fout);
70  if (fout.good())
71  cerr << "Saved " << filename.toStdString() << endl;
72  else
73  cerr << "Error while saving file" << endl;
74  }
75 }
void MainWindow::on_actionSave_Viewer_State_triggered ( bool  )
slot

Definition at line 442 of file main_window.cpp.

443 {
444  QString filename = QFileDialog::getSaveFileName(this, "Save State", "camera.xml", "Camera/State file (*.xml)");
445  if (!filename.isEmpty()) {
446  viewer->setStateFileName(filename);
447  viewer->saveStateToFile();
448  viewer->setStateFileName(QString::null);
449  cerr << "Saved state to " << filename.toStdString() << endl;
450  }
451 }
void MainWindow::on_actionWhite_Background_triggered ( bool  )
slot

Definition at line 363 of file main_window.cpp.

364 {
365  viewer->setBackgroundColor(QColor::fromRgb(255, 255, 255));
366  viewer->updateGL();
367 }
void MainWindow::on_btnForceStop_clicked ( )
slot

Definition at line 347 of file main_window.cpp.

References _forceStopFlag.

348 {
349  _forceStopFlag = true;
350 }
bool _forceStopFlag
Definition: main_window.h:89
void MainWindow::on_btnInitialGuess_clicked ( )
slot
void MainWindow::on_btnInitialGuess_clicked ( )
slot

Definition at line 114 of file main_window.cpp.

References __PRETTY_FUNCTION__.

115 {
116  if (viewer->graph->activeEdges().size() == 0)
117  viewer->graph->initializeOptimization();
118 
119  switch (cbxIniitialGuessMethod->currentIndex()) {
120  case 0:
121  // spanning tree
122  viewer->graph->computeInitialGuess();
123  break;
124  case 1:
125  // odometry
126  {
127  EstimatePropagatorCostOdometry costFunction(viewer->graph);
128  viewer->graph->computeInitialGuess(costFunction);
129  }
130  break;
131  default:
132  cerr << __PRETTY_FUNCTION__ << " Unknown initialization method" << endl;
133  break;
134  }
135 
136  viewer->setUpdateDisplay(true);
137  viewer->updateGL();
138 }
#define __PRETTY_FUNCTION__
Definition: macros.h:89
cost for traversing only odometry edges.
void MainWindow::on_btnOptimize_clicked ( )
slot
void MainWindow::on_btnOptimize_clicked ( )
slot

Definition at line 77 of file main_window.cpp.

References _forceStopFlag, allocateSolver(), prepare(), and setRobustKernel().

78 {
79  if (viewer->graph->vertices().size() == 0 || viewer->graph->edges().size() == 0) {
80  cerr << "Graph has no vertices / egdes" << endl;
81  return;
82  }
83 
84  bool allocatedNewSolver;
85  bool allocateStatus = allocateSolver(allocatedNewSolver);
86  if (! allocateStatus) {
87  cerr << "Error while allocating solver" << endl;
88  return;
89  }
90  if (allocatedNewSolver)
91  prepare();
93 
94  btnOptimize->hide();
95  btnForceStop->show();
96 
97  _forceStopFlag = false;
98  viewer->graph->setForceStopFlag(&_forceStopFlag);
99 
100  int maxIterations = spIterations->value();
101  int iter = viewer->graph->optimize(maxIterations);
102  if (maxIterations > 0 && !iter){
103  cerr << "Optimization failed, result might be invalid" << endl;
104  }
105 
106  btnOptimize->show();
107  btnForceStop->hide();
108 
109  viewer->setUpdateDisplay(true);
110  viewer->updateGL();
111  _forceStopFlag = false;
112 }
bool prepare()
bool allocateSolver(bool &allocatedNewSolver)
void setRobustKernel()
bool _forceStopFlag
Definition: main_window.h:89
void MainWindow::on_btnOptimizerParamaters_clicked ( )
slot

Definition at line 385 of file main_window.cpp.

References _currentSolver, _optimizerPropertiesWidget, allocateSolver(), prepare(), g2o::OptimizationAlgorithm::properties(), and PropertiesWidget::setProperties().

386 {
389  _optimizerPropertiesWidget->setWindowTitle(tr("Internal Solver Properties"));
390  }
391  bool allocatedNewSolver;
392  bool allocateStatus = allocateSolver(allocatedNewSolver);
393  if (! allocateStatus) {
394  cerr << "Error while allocating solver" << endl;
395  return;
396  }
397  if (allocatedNewSolver)
398  prepare();
399  if (_currentSolver) {
400  _optimizerPropertiesWidget->setProperties(const_cast<g2o::PropertyMap*>(&_currentSolver->properties()));
401  } else {
403  }
405 }
const PropertyMap & properties() const
return the properties of the solver
bool prepare()
bool allocateSolver(bool &allocatedNewSolver)
PropertiesWidget * _optimizerPropertiesWidget
Definition: main_window.h:94
void setProperties(g2o::PropertyMap *properties)
g2o::OptimizationAlgorithm * _currentSolver
Definition: main_window.h:91
void MainWindow::on_btnSetZero_clicked ( )
slot

Definition at line 140 of file main_window.cpp.

141 {
142  if (viewer->graph->activeEdges().size() == 0)
143  viewer->graph->initializeOptimization();
144 
145  viewer->graph->setToOrigin();
146  viewer->setUpdateDisplay(true);
147  viewer->updateGL();
148 }
bool MainWindow::prepare ( )
protected

Definition at line 289 of file main_window.cpp.

References _currentOptimizationAlgorithmProperty, g2o::OptimizableGraph::Vertex::dimension(), g2o::OptimizationAlgorithmProperty::landmarkDim, g2o::OptimizationAlgorithmProperty::requiresMarginalize, g2o::OptimizableGraph::Vertex::setMarginalized(), and g2o::HyperGraph::vertices().

Referenced by on_btnOptimize_clicked(), and on_btnOptimizerParamaters_clicked().

290 {
291  SparseOptimizer* optimizer = viewer->graph;
293  cerr << "Marginalizing Landmarks" << endl;
294  for (SparseOptimizer::VertexIDMap::const_iterator it = optimizer->vertices().begin(); it != optimizer->vertices().end(); ++it) {
295  OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(it->second);
296  int vdim = v->dimension();
298  }
299  }
300  else {
301  cerr << "Preparing (no marginalization of Landmarks)" << endl;
302  for (SparseOptimizer::VertexIDMap::const_iterator it = optimizer->vertices().begin(); it != optimizer->vertices().end(); ++it) {
303  OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(it->second);
304  v->setMarginalized(false);
305  }
306  }
307  viewer->graph->initializeOptimization();
308  return true;
309 }
int landmarkDim
dimension of the landmar vertices (-1 if variable)
const VertexIDMap & vertices() const
Definition: hyper_graph.h:225
g2o::OptimizationAlgorithmProperty _currentOptimizationAlgorithmProperty
Definition: main_window.h:90
int dimension() const
dimension of the estimated state belonging to this node
A general case Vertex for optimization.
void setMarginalized(bool marginalized)
true => this node should be marginalized out during the optimization
bool requiresMarginalize
whether the solver requires marginalization of landmarks
void MainWindow::setRobustKernel ( )
protected

Definition at line 311 of file main_window.cpp.

References g2o::AbstractRobustKernelCreator::construct(), g2o::HyperGraph::edges(), g2o::HyperGraph::Vertex::id(), g2o::OptimizableGraph::Edge::robustKernel(), g2o::RobustKernel::setDelta(), g2o::OptimizableGraph::Edge::setRobustKernel(), g2o::HyperGraph::Edge::vertex(), and g2o::HyperGraph::Edge::vertices().

Referenced by on_btnOptimize_clicked().

312 {
313  SparseOptimizer* optimizer = viewer->graph;
314  bool robustKernel = cbRobustKernel->isChecked();
315  double huberWidth = leKernelWidth->text().toDouble();
316  //odometry edges are those whose node ids differ by 1
317 
318  bool onlyLoop = cbOnlyLoop->isChecked();
319 
320  if (robustKernel) {
321  QString strRobustKernel = coRobustKernel->currentText();
322  AbstractRobustKernelCreator* creator = RobustKernelFactory::instance()->creator(strRobustKernel.toStdString());
323  if (! creator) {
324  cerr << strRobustKernel.toStdString() << " is not a valid robust kernel" << endl;
325  return;
326  }
327  for (SparseOptimizer::EdgeSet::const_iterator it = optimizer->edges().begin(); it != optimizer->edges().end(); ++it) {
328  OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
329  if (onlyLoop) {
330  if (e->vertices().size() >= 2 && std::abs(e->vertex(0)->id() - e->vertex(1)->id()) != 1) {
331  e->setRobustKernel(creator->construct());
332  e->robustKernel()->setDelta(huberWidth);
333  }
334  } else {
335  e->setRobustKernel(creator->construct());
336  e->robustKernel()->setDelta(huberWidth);
337  }
338  }
339  } else {
340  for (SparseOptimizer::EdgeSet::const_iterator it = optimizer->edges().begin(); it != optimizer->edges().end(); ++it) {
341  OptimizableGraph::Edge* e = static_cast<OptimizableGraph::Edge*>(*it);
342  e->setRobustKernel(0);
343  }
344  }
345 }
int id() const
returns the id
Definition: hyper_graph.h:148
const Vertex * vertex(size_t i) const
Definition: hyper_graph.h:186
Abstract interface for allocating a robust kernel.
void setRobustKernel(RobustKernel *ptr)
const VertexContainer & vertices() const
Definition: hyper_graph.h:178
RobustKernel * robustKernel() const
if NOT NULL, error of this edge will be robustifed with the kernel
const EdgeSet & edges() const
Definition: hyper_graph.h:230
virtual void setDelta(double delta)
virtual RobustKernel * construct()=0
void MainWindow::updateDisplayedSolvers ( )

list the available solvers in the GUI

Definition at line 180 of file main_window.cpp.

References _knownSolvers, g2o::OptimizationAlgorithmProperty::name, and g2o::OptimizationAlgorithmProperty::type.

Referenced by g2o::RunG2OViewer::run().

181 {
182  coOptimizer->clear();
183  _knownSolvers.clear();
184  const OptimizationAlgorithmFactory::CreatorList& knownSolvers = OptimizationAlgorithmFactory::instance()->creatorList();
185 
186  bool varFound = false;
187  string varType = "";
188  for (OptimizationAlgorithmFactory::CreatorList::const_iterator it = knownSolvers.begin(); it != knownSolvers.end(); ++it) {
189  const OptimizationAlgorithmProperty& sp = (*it)->property();
190  if (sp.name == "gn_var" || sp.name == "gn_var_cholmod") {
191  varType = sp.type;
192  varFound = true;
193  break;
194  }
195  }
196 
197  if (varFound) {
198  for (OptimizationAlgorithmFactory::CreatorList::const_iterator it = knownSolvers.begin(); it != knownSolvers.end(); ++it) {
199  const OptimizationAlgorithmProperty& sp = (*it)->property();
200  if (sp.type == varType) {
201  coOptimizer->addItem(QString::fromStdString(sp.name));
202  _knownSolvers.push_back(sp);
203  }
204  }
205  }
206 
207  map<string, vector<OptimizationAlgorithmProperty> > solverLookUp;
208 
209  for (OptimizationAlgorithmFactory::CreatorList::const_iterator it = knownSolvers.begin(); it != knownSolvers.end(); ++it) {
210  const OptimizationAlgorithmProperty& sp = (*it)->property();
211  if (varFound && varType == sp.type)
212  continue;
213  solverLookUp[sp.type].push_back(sp);
214  }
215 
216  for (map<string, vector<OptimizationAlgorithmProperty> >::iterator it = solverLookUp.begin(); it != solverLookUp.end(); ++it) {
217  if (_knownSolvers.size() > 0) {
218  coOptimizer->insertSeparator(coOptimizer->count());
220  }
221  const vector<OptimizationAlgorithmProperty>& vsp = it->second;
222  for (size_t j = 0; j < vsp.size(); ++j) {
223  coOptimizer->addItem(QString::fromStdString(vsp[j].name));
224  _knownSolvers.push_back(vsp[j]);
225  }
226  }
227 }
std::string name
name of the solver, e.g., var
describe the properties of a solver
std::vector< g2o::OptimizationAlgorithmProperty > _knownSolvers
Definition: main_window.h:87
std::list< AbstractOptimizationAlgorithmCreator * > CreatorList
std::string type
type of solver, e.g., "CSparse Cholesky", "PCG"
void MainWindow::updateRobustKernels ( )

list the available robust kernels in the GUI

Definition at line 453 of file main_window.cpp.

Referenced by g2o::RunG2OViewer::run().

454 {
455  coRobustKernel->clear();
456  std::vector<std::string> kernels;
457  RobustKernelFactory::instance()->fillKnownKernels(kernels);
458  for (size_t i = 0; i < kernels.size(); ++i) {
459  coRobustKernel->addItem(QString::fromStdString(kernels[i]));
460  }
461 }

Member Data Documentation

g2o::OptimizationAlgorithmProperty MainWindow::_currentOptimizationAlgorithmProperty
protected

Definition at line 90 of file main_window.h.

Referenced by allocateSolver(), and prepare().

g2o::OptimizationAlgorithm* MainWindow::_currentSolver
protected

Definition at line 91 of file main_window.h.

Referenced by allocateSolver(), and on_btnOptimizerParamaters_clicked().

bool MainWindow::_forceStopFlag
protected

Definition at line 89 of file main_window.h.

Referenced by on_btnForceStop_clicked(), and on_btnOptimize_clicked().

std::vector<g2o::OptimizationAlgorithmProperty> MainWindow::_knownSolvers
protected

Definition at line 87 of file main_window.h.

Referenced by load(), and updateDisplayedSolvers().

int MainWindow::_lastSolver
protected

Definition at line 88 of file main_window.h.

Referenced by allocateSolver(), and load().

PropertiesWidget* MainWindow::_optimizerPropertiesWidget
protected

Definition at line 94 of file main_window.h.

Referenced by on_btnOptimizerParamaters_clicked().

ViewerPropertiesWidget* MainWindow::_viewerPropertiesWidget
protected

Definition at line 93 of file main_window.h.

Referenced by on_actionProperties_triggered().

g2o::OptimizationAlgorithm* MainWindow::solverGaussNewton

Definition at line 35 of file main_window.h.

Referenced by main().

g2o::OptimizationAlgorithm* MainWindow::solverLevenberg

Definition at line 36 of file main_window.h.

Referenced by main().


The documentation for this class was generated from the following files: