Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "bagloader.h"
00018 #include "qtros.h"
00019 #include <QApplication>
00020 #include <QObject>
00021 #include "qt_gui.h"
00022 #include <Eigen/Core>
00023 #include "parameter_server.h"
00024 #include "ros_service_ui.h"
00025
00026
00027
00028
00029
00030
00031
00032
00034 void gui_connections(Graphical_UI* gui, BagLoader* loader)
00035 {
00036 QObject::connect(gui, SIGNAL(openBagFile(QString)), loader, SLOT(loadBagFileAsync(QString)));
00037 if (ParameterServer::instance()->get<bool>("use_glwidget") && gui->getGLViewer() != NULL) {
00038 GLViewer* glv = gui->getGLViewer();
00039 QObject::connect(loader, SIGNAL(setPointCloud(pointcloud_type *, QMatrix4x4)), glv, SLOT(addPointCloud(pointcloud_type *, QMatrix4x4)), Qt::BlockingQueuedConnection );
00040 typedef const std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >* cnst_ft_vectors;
00041 QObject::connect(glv, SIGNAL(cloudRendered(pointcloud_type *)), loader, SLOT(clearPointCloud(pointcloud_type *)));
00042 }
00043 QObject::connect(loader, SIGNAL(setGUIInfo(QString)), gui, SLOT(setInfo(QString)));
00044 QObject::connect(loader, SIGNAL(setGUIInfo2(QString)), gui, SLOT(setInfo2(QString)));
00045 QObject::connect(loader, SIGNAL(setGUIStatus(QString)), gui, SLOT(setStatus(QString)));
00046 QObject::connect(gui, SIGNAL(togglePause()), loader, SLOT(togglePause()));
00047 }
00048
00057 int main(int argc, char** argv)
00058 {
00059 setlocale(LC_NUMERIC,"C");
00060
00061
00062 QtROS qtRos(argc, argv, "rgbdslam_bag_viewer");
00063
00064
00065 QApplication app(argc, argv);
00066
00067
00068 BagLoader loader;
00069
00070 Graphical_UI* gui = new Graphical_UI("RGBDSLAM's Bagviewer");
00071 gui->show();
00072 gui->set2DStream(false);
00073 gui_connections(gui, &loader);
00074
00075
00076
00077 QObject::connect(&app, SIGNAL(aboutToQuit()), &qtRos, SLOT(quitNow()));
00078 QObject::connect(&qtRos, SIGNAL(rosQuits()), &app, SLOT(quit()));
00079
00080 qtRos.start();
00081
00082 std::string bagfile_name = ParameterServer::instance()->get<std::string>("bagfile_name");
00083 if(!bagfile_name.empty()){
00084 loader.loadBagFileAsync(bagfile_name);
00085 }
00086 app.exec();
00087 }
00088
00089