used dbu extension for update files

This commit is contained in:
matlabbe
2026-07-10 20:54:51 -07:00
parent e61a45e44f
commit b532319885
9 changed files with 65 additions and 32 deletions

View File

@@ -37,13 +37,12 @@ using namespace rtabmap;
void showUsage()
{
printf("\nUpdate a database with a set of changes recorded while another database was opened with\n"
"change tracking enabled (the --track-changes option of rtabmap-reprocess,\n"
"rtabmap-detectMoreLoopClosures or rtabmap-reduceGraph). This applies the data changes\n"
"only; it does NOT upgrade the database schema/version.\n"
printf("\nUpdate a database with a set of changes recorded in a \".dbu\" (db update) file, produced with\n"
"the --track-changes option of used by other tools. This applies the data changes only; it does NOT upgrade the database\n"
"schema/version.\n"
"\n"
"Usage:\n"
" rtabmap-dbupdate [--rewind] \"database.db\" \"changes.update\"\n"
" rtabmap-dbupdate [--rewind] \"database.db\" \"changes.dbu\"\n"
"\n"
"Options:\n"
" --rewind Undo a previously applied update instead of applying it (the changeset is\n"

View File

@@ -59,9 +59,10 @@ void showUsage()
" --intra Add only intra-session loop closures.\n"
" --inter Add only inter-session loop closures.\n"
" --session # Add loop closures only from/to that map session ID (use -1 for last session).\n"
" --track-changes \"changes.update\"\n"
" --track-changes \"changes.dbu\"\n"
" Record the changes made to the database (added loop closures) and write a compact\n"
" delta to the given file, applied later on another copy with rtabmap-dbupdate.\n"
" delta to the given file. Apply it later on another copy with rtabmap-dbupdate, or\n"
" revert the loop closures added to this database with \"rtabmap-dbupdate --rewind\".\n"
" Requires the database to be version 0.24 or newer.\n"
"\n%s", Parameters::showUsage());
exit(1);
@@ -127,6 +128,11 @@ int main(int argc, char * argv[])
if(i<argc-1)
{
trackChangesOutput = argv[i];
if(UFile::getExtension(trackChangesOutput).compare("dbu") != 0)
{
printf("--track-changes file \"%s\" must have a \".dbu\" (db update) extension!\n", trackChangesOutput.c_str());
showUsage();
}
}
else
{

View File

@@ -59,10 +59,11 @@ void showUsage(const char * exec)
" --keep_linked Keep reduced nodes linked to graph.\n"
" --pre_cleanup Remove all user loop closures linking nodes closer than %s in the graph before reducing the graph.\n"
" --radius #.# Maximum loop closure distance that can be merged. Default is 1 m. Should be > 0.\n"
" --track-changes \"changes.update\"\n"
" --track-changes \"changes.dbu\"\n"
" Record the changes made to the database (reduced nodes, removed links) and write a\n"
" compact delta to the given file, applied later on another copy with rtabmap-dbupdate.\n"
" Requires the database to be version 0.24 or newer.\n"
" compact delta to the given file. Apply it later on another copy with\n"
" rtabmap-dbupdate, or revert the reduction done to this database with\n"
" \"rtabmap-dbupdate --rewind\". Requires the database to be version 0.24 or newer.\n"
" --udebug/--uinfo/--warn can also be used to change verbosity.\n"
"\n", exec, Parameters::kMemSTMSize().c_str());
exit(1);
@@ -95,6 +96,11 @@ int main(int argc, char * argv[])
if(i < argc-1)
{
trackChangesOutput = argv[i];
if(UFile::getExtension(trackChangesOutput).compare("dbu") != 0)
{
printf("--track-changes file \"%s\" must have a \".dbu\" (db update) extension!\n", trackChangesOutput.c_str());
showUsage(argv[0]);
}
}
else
{

View File

@@ -85,11 +85,12 @@ void showUsage()
" -stop_loop Stop after the first loop closure is detected.\n"
" -a Append mode: if Mem/IncrementalMemory is true, RTAB-Map is initialized with the first input database,\n"
" then next databases are reprocessed on top of the first one.\n"
" --track-changes \"changes.update\"\n"
" --track-changes \"changes.dbu\"\n"
" Only with append mode (-a): record the changes made on top of the first (copied) database and\n"
" write a compact delta to the given file. Apply it later on the original database with\n"
" rtabmap-dbupdate. Requires the database to be version 0.24 or newer. Note: the recorded\n"
" changes are held in memory until closing, so use this only when appending a small amount.\n"
" write a compact delta to the given file. Apply\n"
" it later on the original database with rtabmap-dbupdate. Requires the database to be version\n"
" 0.24 or newer. Note: the recorded changes are held in memory until closing, so use this only\n"
" when appending a small amount.\n"
" -cam # Camera index to stream. Ignored if a database doesn't contain multi-camera data. Can also be multiple \n"
" indices split by spaces in a string like \"0 2\" to stream cameras 0 and 2 only.\n"
" -cam_tf \"x y z roll pitch yaw\" Camera local transform override(s) without optical rotation. For multi-cameras, \n"
@@ -442,6 +443,11 @@ int main(int argc, char * argv[])
if(i < argc - 2)
{
trackChangesOutput = argv[i];
if(UFile::getExtension(trackChangesOutput).compare("dbu") != 0)
{
printf("--track-changes file \"%s\" must have a \".dbu\" (db update) extension!\n", trackChangesOutput.c_str());
showUsage();
}
printf("Change tracking enabled, delta will be written to \"%s\" (apply later with rtabmap-dbupdate).\n", trackChangesOutput.c_str());
}
else