rtabmap-report: added loc_delay option. Db info: added unused space

This commit is contained in:
matlabbe
2020-09-03 15:23:48 -04:00
parent 23d8353540
commit 1db17dd118
3 changed files with 8 additions and 6 deletions

View File

@@ -2038,7 +2038,7 @@ void DatabaseViewer::updateInfo()
total+=mem; total+=mem;
ui_->textEdit_info->append(tr("Statistics size:\t%1 %2\t%3%").arg(mem>1000000?mem/1000000:mem>1000?mem/1000:mem).arg(mem>1000000?"MB":mem>1000?"KB":"Bytes").arg(dbSize>0?QString::number(double(mem)/double(dbSize)*100.0, 'f', 2 ):"0")); ui_->textEdit_info->append(tr("Statistics size:\t%1 %2\t%3%").arg(mem>1000000?mem/1000000:mem>1000?mem/1000:mem).arg(mem>1000000?"MB":mem>1000?"KB":"Bytes").arg(dbSize>0?QString::number(double(mem)/double(dbSize)*100.0, 'f', 2 ):"0"));
mem = dbSize - total; mem = dbSize - total;
ui_->textEdit_info->append(tr("Other (indexing):\t%1 %2\t%3%").arg(mem>1000000?mem/1000000:mem>1000?mem/1000:mem).arg(mem>1000000?"MB":mem>1000?"KB":"Bytes").arg(dbSize>0?QString::number(double(mem)/double(dbSize)*100.0, 'f', 2 ):"0")); ui_->textEdit_info->append(tr("Other (indexing, unused):\t%1 %2\t%3%").arg(mem>1000000?mem/1000000:mem>1000?mem/1000:mem).arg(mem>1000000?"MB":mem>1000?"KB":"Bytes").arg(dbSize>0?QString::number(double(mem)/double(dbSize)*100.0, 'f', 2 ):"0"));
ui_->textEdit_info->append(""); ui_->textEdit_info->append("");
std::set<int> idsWithoutBad; std::set<int> idsWithoutBad;
dbDriver_->getAllNodeIds(idsWithoutBad, false, true); dbDriver_->getAllNodeIds(idsWithoutBad, false, true);

View File

@@ -379,7 +379,7 @@ int main(int argc, char * argv[])
total+=mem; total+=mem;
std::cout << (uFormat("%s%d %s\t(%.2f%%)\n", pad("Statistics size:").c_str(), mem>1000000?mem/1000000:mem>1000?mem/1000:mem, mem>1000000?"MB":mem>1000?"KB":"Bytes", dbSize>0?double(mem)/double(dbSize)*100.0:0.0)); std::cout << (uFormat("%s%d %s\t(%.2f%%)\n", pad("Statistics size:").c_str(), mem>1000000?mem/1000000:mem>1000?mem/1000:mem, mem>1000000?"MB":mem>1000?"KB":"Bytes", dbSize>0?double(mem)/double(dbSize)*100.0:0.0));
mem = dbSize - total; mem = dbSize - total;
std::cout << (uFormat("%s%d %s\t(%.2f%%)\n", pad("Other (indexing):").c_str(), mem>1000000?mem/1000000:mem>1000?mem/1000:mem, mem>1000000?"MB":mem>1000?"KB":"Bytes", dbSize>0?double(mem)/double(dbSize)*100.0:0.0)); std::cout << (uFormat("%s%d %s\t(%.2f%%)\n", pad("Other (indexing, unused):").c_str(), mem>1000000?mem/1000000:mem>1000?mem/1000:mem, mem>1000000?"MB":mem>1000?"KB":"Bytes", dbSize>0?double(mem)/double(dbSize)*100.0:0.0));
std::cout << ("\n"); std::cout << ("\n");
} }

View File

@@ -71,8 +71,9 @@ void showUsage()
" --start # Start from this node ID for the figures.\n" " --start # Start from this node ID for the figures.\n"
#endif #endif
" --report Export all evaluation statistics values in report.txt \n" " --report Export all evaluation statistics values in report.txt \n"
" --loc # Show localization statistics for each \"Statistic/Id\" per " " --loc # Show localization statistics for each \"Statistic/Id\" per\n"
" session for 1=min,2=max,4=mean,8=stddev,16=total,32=nonnull%% " " session for 1=min,2=max,4=mean,8=stddev,16=total,32=nonnull%%\n"
" --loc_delay # Delay to split sessions for localization statistics (default 60 seconds)\n"
" (it is a mask, we can combine those numbers, e.g., 63 for all) \n" " (it is a mask, we can combine those numbers, e.g., 63 for all) \n"
" --help Show usage\n\n"); " --help Show usage\n\n");
exit(1); exit(1);
@@ -134,6 +135,7 @@ int main(int argc, char * argv[])
bool useIds = false; bool useIds = false;
int startId = 0; int startId = 0;
int showLoc = 0; int showLoc = 0;
float locDelay = 60;
std::vector<std::string> statsToShow; std::vector<std::string> statsToShow;
#ifdef WITH_QT #ifdef WITH_QT
std::map<std::string, UPlot*> figures; std::map<std::string, UPlot*> figures;
@@ -276,7 +278,6 @@ int main(int argc, char * argv[])
if(UFile::getExtension(currentPath).compare("db") == 0) if(UFile::getExtension(currentPath).compare("db") == 0)
{ {
currentPathIsDatabase=true; currentPathIsDatabase=true;
localizationMultiStats.clear();
printf("Database: %s\n", currentPath.c_str()); printf("Database: %s\n", currentPath.c_str());
} }
else else
@@ -318,6 +319,7 @@ int main(int argc, char * argv[])
if(currentPathIsDatabase) if(currentPathIsDatabase)
{ {
filePath = currentPath; filePath = currentPath;
fileName = UFile::getName(currentPath);
} }
else else
{ {
@@ -531,7 +533,7 @@ int main(int argc, char * argv[])
if(!localizationMultiStats.empty()) if(!localizationMultiStats.empty())
{ {
if(previousStamp > 0 && s - previousStamp > 10 && uContains(localizationSessionStats, jter->first)) if(previousStamp > 0 && s - previousStamp > locDelay && uContains(localizationSessionStats, jter->first))
{ {
// changed session // changed session
LocStats values = LocStats::from(localizationSessionStats.at(jter->first)); LocStats values = LocStats::from(localizationSessionStats.at(jter->first));