mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
rtabmap-console: added "skip" option for convenience
This commit is contained in:
@@ -55,6 +55,7 @@ void showUsage()
|
|||||||
" -createGT Generate a ground truth file\n"
|
" -createGT Generate a ground truth file\n"
|
||||||
" -start_at # When \"path\" is a directory of images, set this parameter\n"
|
" -start_at # When \"path\" is a directory of images, set this parameter\n"
|
||||||
" to start processing at image # (default 0).\n"
|
" to start processing at image # (default 0).\n"
|
||||||
|
" -skip # Skip X images while reading directory (default 0).\n"
|
||||||
" -v Get version of RTAB-Map\n"
|
" -v Get version of RTAB-Map\n"
|
||||||
" -input \"path\" Load previous database if it exists.\n"
|
" -input \"path\" Load previous database if it exists.\n"
|
||||||
"%s\n",
|
"%s\n",
|
||||||
@@ -100,6 +101,7 @@ int main(int argc, char * argv[])
|
|||||||
bool createGT = false;
|
bool createGT = false;
|
||||||
std::string inputDbPath;
|
std::string inputDbPath;
|
||||||
int startAt = 0;
|
int startAt = 0;
|
||||||
|
int skip = 0;
|
||||||
|
|
||||||
for(int i=1; i<argc; ++i)
|
for(int i=1; i<argc; ++i)
|
||||||
{
|
{
|
||||||
@@ -187,6 +189,23 @@ int main(int argc, char * argv[])
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (strcmp(argv[i], "-skip") == 0)
|
||||||
|
{
|
||||||
|
++i;
|
||||||
|
if (i < argc)
|
||||||
|
{
|
||||||
|
skip = std::atoi(argv[i]);
|
||||||
|
if (skip < 0)
|
||||||
|
{
|
||||||
|
showUsage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showUsage();
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(strcmp(argv[i], "-createGT") == 0)
|
if(strcmp(argv[i], "-createGT") == 0)
|
||||||
{
|
{
|
||||||
createGT = true;
|
createGT = true;
|
||||||
@@ -283,6 +302,7 @@ int main(int argc, char * argv[])
|
|||||||
printf(" Image rate = %1.2f s (%1.2f Hz)\n", rate, 1/rate);
|
printf(" Image rate = %1.2f s (%1.2f Hz)\n", rate, 1/rate);
|
||||||
printf(" Repeating data set = %s\n", repeat?"true":"false");
|
printf(" Repeating data set = %s\n", repeat?"true":"false");
|
||||||
printf(" Camera starts at image %d (default 0)\n", startAt);
|
printf(" Camera starts at image %d (default 0)\n", startAt);
|
||||||
|
printf(" Skip image = %d\n", skip);
|
||||||
if(createGT)
|
if(createGT)
|
||||||
{
|
{
|
||||||
printf(" Creating the ground truth matrix.\n");
|
printf(" Creating the ground truth matrix.\n");
|
||||||
@@ -324,7 +344,10 @@ int main(int argc, char * argv[])
|
|||||||
{
|
{
|
||||||
++countLoopDetected;
|
++countLoopDetected;
|
||||||
}
|
}
|
||||||
|
for(int i=0; i<=skip; ++i)
|
||||||
|
{
|
||||||
data = camera->takeImage();
|
data = camera->takeImage();
|
||||||
|
}
|
||||||
if(++count % 100 == 0)
|
if(++count % 100 == 0)
|
||||||
{
|
{
|
||||||
printf(" count = %d, loop closures = %d, max time (at %d) = %fs\n",
|
printf(" count = %d, loop closures = %d, max time (at %d) = %fs\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user