mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 16:57:46 +08:00
rtabmapviz: added "-d" option to load gui settings from the specifed file (like rviz)
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@791 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -30,7 +30,22 @@ GuiWrapper::GuiWrapper(int & argc, char** argv)
|
|||||||
ros::NodeHandle nh;
|
ros::NodeHandle nh;
|
||||||
infoExTopic_ = nh.subscribe("rtabmap/infoEx", 1, &GuiWrapper::infoExReceivedCallback, this);
|
infoExTopic_ = nh.subscribe("rtabmap/infoEx", 1, &GuiWrapper::infoExReceivedCallback, this);
|
||||||
app_ = new QApplication(argc, argv);
|
app_ = new QApplication(argc, argv);
|
||||||
mainWindow_ = new MainWindow(new PreferencesDialogROS());
|
|
||||||
|
QString configFile;
|
||||||
|
for(int i=1; i<argc; ++i)
|
||||||
|
{
|
||||||
|
if(strcmp(argv[i], "-d") == 0)
|
||||||
|
{
|
||||||
|
++i;
|
||||||
|
if(i < argc)
|
||||||
|
{
|
||||||
|
configFile = argv[i];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mainWindow_ = new MainWindow(new PreferencesDialogROS(configFile));
|
||||||
mainWindow_->show();
|
mainWindow_->show();
|
||||||
mainWindow_->changeState(MainWindow::kMonitoring);
|
mainWindow_->changeState(MainWindow::kMonitoring);
|
||||||
app_->connect( app_, SIGNAL( lastWindowClosed() ), app_, SLOT( quit() ) );
|
app_->connect( app_, SIGNAL( lastWindowClosed() ), app_, SLOT( quit() ) );
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
|
|
||||||
using namespace rtabmap;
|
using namespace rtabmap;
|
||||||
|
|
||||||
PreferencesDialogROS::PreferencesDialogROS()
|
PreferencesDialogROS::PreferencesDialogROS(const QString & configFile) :
|
||||||
|
configFile_(configFile)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferencesDialogROS::~PreferencesDialogROS()
|
PreferencesDialogROS::~PreferencesDialogROS()
|
||||||
@@ -27,6 +29,15 @@ PreferencesDialogROS::~PreferencesDialogROS()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString PreferencesDialogROS::getIniFilePath()
|
||||||
|
{
|
||||||
|
if(configFile_.isEmpty())
|
||||||
|
{
|
||||||
|
return PreferencesDialog::getIniFilePath();
|
||||||
|
}
|
||||||
|
return configFile_;
|
||||||
|
}
|
||||||
|
|
||||||
void PreferencesDialogROS::readCameraSettings(const QString & filePath)
|
void PreferencesDialogROS::readCameraSettings(const QString & filePath)
|
||||||
{
|
{
|
||||||
this->setInputRate(0);
|
this->setInputRate(0);
|
||||||
|
|||||||
@@ -16,15 +16,20 @@ using namespace rtabmap;
|
|||||||
class PreferencesDialogROS : public PreferencesDialog
|
class PreferencesDialogROS : public PreferencesDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PreferencesDialogROS();
|
PreferencesDialogROS(const QString & configFile);
|
||||||
virtual ~PreferencesDialogROS();
|
virtual ~PreferencesDialogROS();
|
||||||
|
|
||||||
|
virtual QString getIniFilePath();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QString getParamMessage();
|
virtual QString getParamMessage();
|
||||||
|
|
||||||
virtual void readCameraSettings(const QString & filePath);
|
virtual void readCameraSettings(const QString & filePath);
|
||||||
virtual bool readCoreSettings(const QString & filePath);
|
virtual bool readCoreSettings(const QString & filePath);
|
||||||
virtual void writeSettings(const QString & filePath);
|
virtual void writeSettings(const QString & filePath);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString configFile_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PREFERENCESDIALOGROS_H_ */
|
#endif /* PREFERENCESDIALOGROS_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user