mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-09-14 15:20:19 +08:00
Updated error messages in Preferences dialog (ROS part)
Fixed a compilation error ChangeImageRate service not found git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@573 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include <rtabmap/core/SensorimotorEvent.h>
|
||||
|
||||
#include "PreferencesDialogROS.h"
|
||||
#include "rtabmap/ChangeCameraImgRate.h"
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
@@ -44,7 +43,6 @@ GuiWrapper::GuiWrapper(int & argc, char** argv)
|
||||
dumpMemoryClient_ = nh.serviceClient<std_srvs::Empty>("rtabmap/dumpMemory");
|
||||
dumpPredictionClient_ = nh.serviceClient<std_srvs::Empty>("rtabmap/dumpPrediction");
|
||||
deleteMemoryClient_ = nh.serviceClient<std_srvs::Empty>("rtabmap/deleteMemory");
|
||||
changeCameraImgRateClient_ = nh.serviceClient<rtabmap::ChangeCameraImgRate>("camera/changeImgRate");
|
||||
|
||||
nh = ros::NodeHandle("~");
|
||||
parametersUpdatedPub_ = nh.advertise<std_msgs::Empty>("parameters_updated", 1);
|
||||
|
||||
@@ -29,10 +29,7 @@ PreferencesDialogROS::~PreferencesDialogROS()
|
||||
|
||||
void PreferencesDialogROS::readCameraSettings(const QString & filePath)
|
||||
{
|
||||
double imgRate = 0;
|
||||
ros::NodeHandle nh;
|
||||
nh.getParam("camera/image_hz", imgRate);
|
||||
this->setInputRate(imgRate);
|
||||
this->setInputRate(0);
|
||||
}
|
||||
|
||||
QString PreferencesDialogROS::getParamMessage()
|
||||
@@ -40,7 +37,7 @@ QString PreferencesDialogROS::getParamMessage()
|
||||
return tr("Reading parameters from the ROS server...");
|
||||
}
|
||||
|
||||
void PreferencesDialogROS::readCoreSettings(const QString & filePath)
|
||||
bool PreferencesDialogROS::readCoreSettings(const QString & filePath)
|
||||
{
|
||||
if(filePath.isEmpty())
|
||||
{
|
||||
@@ -69,14 +66,16 @@ void PreferencesDialogROS::readCoreSettings(const QString & filePath)
|
||||
else
|
||||
{
|
||||
validParameters = false;
|
||||
QString warning = tr("Failed to get some RTAB-Map parameters from ROS server, the rtabmap/core_node may be not started or some parameters won't work...");
|
||||
QString warning = tr("Failed to get some RTAB-Map parameters from ROS server, the rtabmap node may be not started or some parameters won't work...");
|
||||
ROS_ERROR("%s", warning.toStdString().c_str());
|
||||
QMessageBox::warning(this, tr("Can't read parameters from ROS server."), warning);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PreferencesDialog::readCoreSettings(filePath);
|
||||
return PreferencesDialog::readCoreSettings(filePath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ protected:
|
||||
virtual QString getParamMessage();
|
||||
|
||||
virtual void readCameraSettings(const QString & filePath);
|
||||
virtual void readCoreSettings(const QString & filePath);
|
||||
virtual bool readCoreSettings(const QString & filePath);
|
||||
virtual void writeSettings(const QString & filePath);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user