Upgraded trunk version to 0.7.1

Added version in ini config file
Fixed rtabmap-console for loop closure detection-only

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1823 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-10-02 15:12:56 +00:00
parent c441cc1d0f
commit 2badfb5faf
5 changed files with 80 additions and 12 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
####################### #######################
SET(RTABMAP_MAJOR_VERSION 0) SET(RTABMAP_MAJOR_VERSION 0)
SET(RTABMAP_MINOR_VERSION 7) SET(RTABMAP_MINOR_VERSION 7)
SET(RTABMAP_PATCH_VERSION 0) SET(RTABMAP_PATCH_VERSION 1)
SET(RTABMAP_VERSION SET(RTABMAP_VERSION
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION}) ${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
+5 -5
View File
@@ -29,13 +29,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define VERSION_H_ #define VERSION_H_
// This is auto-generated! // This is auto-generated!
#define RTABMAP_VERSION "@PROJECT_VERSION@"; #define RTABMAP_VERSION "@PROJECT_VERSION@"
#define RTABMAP_VERSION_MAJOR @PROJECT_VERSION_MAJOR@; #define RTABMAP_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define RTABMAP_VERSION_MINOR @PROJECT_VERSION_MINOR@; #define RTABMAP_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define RTABMAP_VERSION_PATCH @PROJECT_VERSION_PATCH@; #define RTABMAP_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define RTABMAP_VERSION_COMPARE(major, minor, patch) major>=@PROJECT_VERSION_MAJOR@ && minor>=@PROJECT_VERSION_MINOR@ && patch >=@PROJECT_VERSION_PATCH@ #define RTABMAP_VERSION_COMPARE(major, minor, patch) (major>=@PROJECT_VERSION_MAJOR@ && minor>=@PROJECT_VERSION_MINOR@ && patch >=@PROJECT_VERSION_PATCH@)
#endif /* VERSION_H_ */ #endif /* VERSION_H_ */
+35
View File
@@ -2390,6 +2390,37 @@ void Rtabmap::readParameters(const std::string & configFile, ParametersMap & par
for(CSimpleIniA::TKeyVal::const_iterator iter=keyValMap->begin(); iter!=keyValMap->end(); ++iter) for(CSimpleIniA::TKeyVal::const_iterator iter=keyValMap->begin(); iter!=keyValMap->end(); ++iter)
{ {
std::string key = (*iter).first.pItem; std::string key = (*iter).first.pItem;
if(key.compare("Version") == 0)
{
// Compare version in ini with the current RTAB-Map version
std::vector<std::string> version = uListToVector(uSplit((*iter).second, '.'));
if(version.size() == 3)
{
if(!RTABMAP_VERSION_COMPARE(std::atoi(version[0].c_str()), std::atoi(version[1].c_str()), std::atoi(version[2].c_str())))
{
if(configFile.find(".rtabmap") != std::string::npos)
{
UWARN("Version in the config file \"%s\" is more recent (\"%s\") than "
"current RTAB-Map version used (\"%s\"). The config file will be upgraded "
"to new version.",
configFile.c_str(),
(*iter).second,
RTABMAP_VERSION);
}
else
{
UERROR("Version in the config file \"%s\" is more recent (\"%s\") than "
"current RTAB-Map version used (\"%s\"). New parameters (if there are some) will "
"be ignored.",
configFile.c_str(),
(*iter).second,
RTABMAP_VERSION);
}
}
}
}
else
{
key = uReplaceChar(key, '\\', '/'); // Ini files use \ by default for separators, so replace them key = uReplaceChar(key, '\\', '/'); // Ini files use \ by default for separators, so replace them
ParametersMap::iterator jter = parameters.find(key); ParametersMap::iterator jter = parameters.find(key);
if(jter != parameters.end()) if(jter != parameters.end())
@@ -2399,6 +2430,7 @@ void Rtabmap::readParameters(const std::string & configFile, ParametersMap & par
parameters.insert(ParametersPair(key, (*iter).second)); parameters.insert(ParametersPair(key, (*iter).second));
} }
} }
}
else else
{ {
ULOGGER_WARN("Section \"Core\" in %s doesn't exist... " ULOGGER_WARN("Section \"Core\" in %s doesn't exist... "
@@ -2412,6 +2444,9 @@ void Rtabmap::writeParameters(const std::string & configFile, const ParametersMa
CSimpleIniA ini; CSimpleIniA ini;
ini.LoadFile(configFile.c_str()); ini.LoadFile(configFile.c_str());
// Save current version
ini.SetValue("Core", "Version", RTABMAP_VERSION, NULL, true);
for(ParametersMap::const_iterator i=parameters.begin(); i!=parameters.end(); ++i) for(ParametersMap::const_iterator i=parameters.begin(); i!=parameters.end(); ++i)
{ {
std::string key = (*i).first; std::string key = (*i).first;
+32
View File
@@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ui_preferencesDialog.h" #include "ui_preferencesDialog.h"
#include "rtabmap/core/Version.h"
#include "rtabmap/core/Rtabmap.h" #include "rtabmap/core/Rtabmap.h"
#include "rtabmap/core/Parameters.h" #include "rtabmap/core/Parameters.h"
#include "rtabmap/core/Odometry.h" #include "rtabmap/core/Odometry.h"
@@ -1101,6 +1102,34 @@ bool PreferencesDialog::readCoreSettings(const QString & filePath)
settings.beginGroup("Core"); settings.beginGroup("Core");
// Compare version in ini with the current RTAB-Map version
QStringList version = settings.value("Version", "").toString().split('.');
if(version.size() == 3)
{
if(!RTABMAP_VERSION_COMPARE(version[0].toInt(), version[1].toInt(), version[2].toInt()))
{
if(path.contains(".rtabmap"))
{
UWARN("Version in the config file \"%s\" is more recent (\"%s\") than "
"current RTAB-Map version used (\"%s\"). The config file will be upgraded "
"to new version.",
path.toStdString().c_str(),
settings.value("Version", "").toString().toStdString().c_str(),
RTABMAP_VERSION);
}
else
{
UERROR("Version in the config file \"%s\" is more recent (\"%s\") than "
"current RTAB-Map version used (\"%s\"). New parameters (if there are some) will "
"be ignored.",
path.toStdString().c_str(),
settings.value("Version", "").toString().toStdString().c_str(),
RTABMAP_VERSION);
}
}
}
QStringList keys = settings.allKeys(); QStringList keys = settings.allKeys();
// Get profile // Get profile
const rtabmap::ParametersMap & parameters = Parameters::getDefaultParameters(); const rtabmap::ParametersMap & parameters = Parameters::getDefaultParameters();
@@ -1304,6 +1333,9 @@ void PreferencesDialog::writeCoreSettings(const QString & filePath)
QSettings settings(path, QSettings::IniFormat); QSettings settings(path, QSettings::IniFormat);
settings.beginGroup("Core"); settings.beginGroup("Core");
// save current RTAB-Map version
settings.setValue("Version", QString(RTABMAP_VERSION));
const rtabmap::ParametersMap & parameters = Parameters::getDefaultParameters(); const rtabmap::ParametersMap & parameters = Parameters::getDefaultParameters();
for(rtabmap::ParametersMap::const_iterator iter=parameters.begin(); iter!=parameters.end(); ++iter) for(rtabmap::ParametersMap::const_iterator iter=parameters.begin(); iter!=parameters.end(); ++iter)
{ {
+2 -1
View File
@@ -370,9 +370,10 @@ int main(int argc, char * argv[])
// Create tasks : memory is deleted // Create tasks : memory is deleted
Rtabmap rtabmap; Rtabmap rtabmap;
// Disable statistics (we don't need them) // Disable statistics (we don't need them)
pm.insert(ParametersPair(Parameters::kRtabmapPublishStats(), uBool2Str(false))); pm.insert(ParametersPair(Parameters::kRtabmapPublishStats(), "false"));
// use default working directory // use default working directory
pm.insert(ParametersPair(Parameters::kRtabmapWorkingDirectory(), Parameters::defaultRtabmapWorkingDirectory())); pm.insert(ParametersPair(Parameters::kRtabmapWorkingDirectory(), Parameters::defaultRtabmapWorkingDirectory()));
pm.insert(ParametersPair(Parameters::kRGBDEnabled(), "false"));
rtabmap.init(pm); rtabmap.init(pm);
rtabmap.setTimeThreshold(timeThreshold); // in ms rtabmap.setTimeThreshold(timeThreshold); // in ms