00001 /* This file is part of RGBDSLAM. 00002 * 00003 * RGBDSLAM is free software: you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License as published by 00005 * the Free Software Foundation, either version 3 of the License, or 00006 * (at your option) any later version. 00007 * 00008 * RGBDSLAM is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with RGBDSLAM. If not, see <http://www.gnu.org/licenses/>. 00015 */ 00016 #ifndef ROS_UI_H 00017 #define ROS_UI_H 00018 00019 #include <QMainWindow> 00020 #include <QGridLayout> 00021 #include "glviewer.h" 00022 #include "parameter_server.h" 00023 #include <QObject> 00024 #include "rgbdslam/rgbdslam_ros_ui.h" 00025 #include "rgbdslam/rgbdslam_ros_ui_b.h" 00026 #include "rgbdslam/rgbdslam_ros_ui_f.h" 00027 00028 class QAction; 00029 00031 00032 class RosUi: public QObject{ 00033 Q_OBJECT 00034 00035 public: 00036 RosUi(const char* service_namespace); 00037 00039 bool services(rgbdslam::rgbdslam_ros_ui::Request &req, rgbdslam::rgbdslam_ros_ui::Response &res); 00041 bool services_b(rgbdslam::rgbdslam_ros_ui_b::Request &req, rgbdslam::rgbdslam_ros_ui_b::Response &res); 00043 bool services_f(rgbdslam::rgbdslam_ros_ui_f::Request &req, rgbdslam::rgbdslam_ros_ui_f::Response &res); 00044 Q_SIGNALS: 00046 void reset(); 00048 void togglePause(); 00050 void toggleMapping(bool); 00052 void toggleBagRecording(); 00054 void getOneFrame(); 00056 void deleteLastFrame(); 00057 void sendAllClouds(); 00058 00059 void saveAllClouds(QString filename); 00061 void saveAllFeatures(QString filename); 00063 void saveIndividualClouds(QString file_basename); 00064 void setMaxDepth(float max_depth); 00066 void saveTrajectory(QString); 00067 void optimizeGraph(); 00068 00069 public Q_SLOTS: 00070 void sendFinished(); 00071 00072 private: 00073 void resetCmd(); 00074 void sendAll(); 00075 void setMax(float val); 00076 void saveAll(); 00077 void saveFeatures(); 00078 void saveIndividual(); 00079 void quickSaveAll(); 00080 void pause(bool); 00081 void bagRecording(bool); 00082 void toggleCloudStorage(bool); 00083 void getOneFrameCmd(); 00084 void deleteLastFrameCmd(); 00085 private: 00086 void createActions(const char* service_namespace); 00087 bool pause_on; 00088 QString filename; 00089 bool record_on; 00090 ros::ServiceServer server; 00091 ros::ServiceServer server_b; 00092 ros::ServiceServer server_f; 00093 }; 00094 00095 #endif