Main Page
Namespaces
Classes
Files
File List
File Members
gui
gfs_simplegui.cpp
Go to the documentation of this file.
1
/*****************************************************************
2
*
3
* This file is part of the GMAPPING project
4
*
5
* GMAPPING Copyright (c) 2004 Giorgio Grisetti,
6
* Cyrill Stachniss, and Wolfram Burgard
7
*
8
* This software is licensed under the "Creative Commons
9
* License (Attribution-NonCommercial-ShareAlike 2.0)"
10
* and is copyrighted by Giorgio Grisetti, Cyrill Stachniss,
11
* and Wolfram Burgard.
12
*
13
* Further information on this license can be found at:
14
* http://creativecommons.org/licenses/by-nc-sa/2.0/
15
*
16
* GMAPPING is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied
18
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19
* PURPOSE.
20
*
21
*****************************************************************/
22
23
24
#include "
qparticleviewer.h
"
25
#include "
qgraphpainter.h
"
26
#include <qapplication.h>
27
#include <qframe.h>
28
#include <qlabel.h>
29
#include <qlayout.h>
30
#include <QVBoxLayout>
31
#include <qmainwindow.h>
32
33
class
GFSMainWindow
:
public
QMainWindow{
34
public
:
35
GFSMainWindow
(
GridSlamProcessorThread
* t){
36
gsp_thread
=t;
37
QVBoxLayout*
layout
=
new
QVBoxLayout(
this
);
38
pviewer
=
new
QParticleViewer
(
this
,0,0,
gsp_thread
);
39
pviewer
->setGeometry(0,0,500,500);
40
pviewer
->setFocusPolicy(Qt::ClickFocus);
41
layout->addWidget(
pviewer
);
42
43
gpainter
=
new
QGraphPainter
(
this
);
44
gpainter
->setFixedHeight(100);
45
layout->addWidget(
gpainter
);
46
gpainter
->
setRange
(0,1);
47
gpainter
->
setTitle
(
"Neff"
);
48
49
help
=
new
QLabel(QString(
"+/- - zoom | b - show/hide best path | p - show/hide all paths | c - center robot "
),
this
);
50
help
->setMaximumHeight(30);
51
layout->addWidget(
help
);
52
53
QObject::connect(
pviewer
, SIGNAL(neffChanged(
double
) ),
gpainter
, SLOT(valueAdded(
double
)) );
54
setTabOrder(
pviewer
,
pviewer
);
55
}
56
57
void
start
(
int
c
){
58
pviewer
->
start
(c);
59
gpainter
->
start
(c);
60
}
61
62
protected
:
63
GridSlamProcessorThread
*
gsp_thread
;
64
QVBoxLayout*
layout
;
65
QParticleViewer
*
pviewer
;
66
QGraphPainter
*
gpainter
;
67
QLabel*
help
;
68
};
69
70
71
int
main
(
int
argc,
char
** argv){
72
cerr <<
"GMAPPING copyright 2004 by Giorgio Grisetti, Cyrill Stachniss,"
<< endl ;
73
cerr <<
"and Wolfram Burgard. To be published under the CreativeCommons license,"
<< endl;
74
cerr <<
"see: http://creativecommons.org/licenses/by-nc-sa/2.0/"
<< endl << endl;
75
76
77
GridSlamProcessorThread
* gsp=
new
GridSlamProcessorThread
;
78
if
(gsp->
init
(argc, argv)){
79
cerr <<
"GridFastSlam: Initialization Error!"
<< endl;
80
cerr <<
"(Did you specified an input file for reading?)"
<< endl;
81
return
-1;
82
}
83
if
(gsp->
loadFiles
()){
84
cerr <<
"Error reading file!"
<< endl;
85
return
-2;
86
}
87
cerr <<
"File successfully loaded!"
<< endl;
88
QApplication app(argc, argv);
89
GFSMainWindow
* mainWin=
new
GFSMainWindow
(gsp);
90
mainWin->show();
91
gsp->
setEventBufferSize
(10000);
92
gsp->
start
();
93
mainWin->
start
(1000);
94
return
app.exec();
95
}
96
GridSlamProcessorThread::init
int init(int argc, const char *const *argv)
Definition:
gsp_thread.cpp:37
GFSMainWindow::GFSMainWindow
GFSMainWindow(GridSlamProcessorThread *t)
Definition:
gfs_simplegui.cpp:35
main
int main(int argc, char **argv)
Definition:
gfs_simplegui.cpp:71
GridSlamProcessorThread::loadFiles
int loadFiles(const char *fn=0)
Definition:
gsp_thread.cpp:154
GFSMainWindow::help
QLabel * help
Definition:
gfs_simplegui.cpp:67
QGraphPainter::setRange
void setRange(double min, double max)
Definition:
qgraphpainter.cpp:72
GFSMainWindow::layout
QVBoxLayout * layout
Definition:
gfs_simplegui.cpp:64
GFSMainWindow::gpainter
QGraphPainter * gpainter
Definition:
gfs_simplegui.cpp:66
GridSlamProcessorThread
Definition:
gsp_thread.h:43
qparticleviewer.h
QGraphPainter
Definition:
qgraphpainter.h:37
c
unsigned int c
Definition:
gfs2stream.cpp:41
GFSMainWindow::gsp_thread
GridSlamProcessorThread * gsp_thread
Definition:
gfs_simplegui.cpp:63
GFSMainWindow
Definition:
gfs_simplegui.cpp:33
GridSlamProcessorThread::start
void start()
Definition:
gsp_thread.cpp:500
GFSMainWindow::start
void start(int c)
Definition:
gfs_simplegui.cpp:57
QGraphPainter::setTitle
void setTitle(const char *title)
Definition:
qgraphpainter.cpp:68
GridSlamProcessorThread::setEventBufferSize
void setEventBufferSize(unsigned int length)
Definition:
gsp_thread.cpp:631
qgraphpainter.h
GFSMainWindow::pviewer
QParticleViewer * pviewer
Definition:
gfs_simplegui.cpp:65
GMapping::QParticleViewer::start
void start(int period)
Definition:
qparticleviewer.cpp:365
GMapping::QParticleViewer
Definition:
qparticleviewer.h:44
QGraphPainter::start
void start(int period)
Definition:
qgraphpainter.cpp:90
openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22