mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
DBDriver: when an empty database url is provided, an empty database "in memory" is used by default. Tango: fixed second database not recorded in Data Recorder mode (now creating a new one on save). Mapping parameters are saved in database instead of the one used to record data (Data Recorder mode).
This commit is contained in:
@@ -1020,9 +1020,24 @@ void RTABMapApp::resetMapping()
|
||||
void RTABMapApp::save(const std::string & databasePath)
|
||||
{
|
||||
rtabmapThread_->join(true);
|
||||
|
||||
if(dataRecorderMode_)
|
||||
{
|
||||
// to save mapping parameters in the database
|
||||
dataRecorderMode_ = false;
|
||||
rtabmap::ParametersMap parameters = getRtabmapParameters();
|
||||
rtabmap_->parseParameters(parameters);
|
||||
dataRecorderMode_ = true;
|
||||
}
|
||||
|
||||
rtabmap_->close(true, databasePath);
|
||||
rtabmap_->init(getRtabmapParameters(), databasePath);
|
||||
rtabmap_->init(getRtabmapParameters(), dataRecorderMode_?"":databasePath);
|
||||
if(dataRecorderMode_)
|
||||
{
|
||||
clearSceneOnNextRender_ = true;
|
||||
}
|
||||
rtabmapThread_->start();
|
||||
|
||||
}
|
||||
|
||||
bool RTABMapApp::exportMesh(const std::string & filePath)
|
||||
|
||||
@@ -52,7 +52,7 @@ class RTABMapApp : public UEventsHandler {
|
||||
|
||||
void onCreate(JNIEnv* env, jobject caller_activity);
|
||||
|
||||
void openDatabase(const std::string & databasePath);
|
||||
void openDatabase(const std::string & databasePath = "");
|
||||
|
||||
bool onTangoServiceConnected(JNIEnv* env, jobject iBinder);
|
||||
|
||||
|
||||
@@ -55,6 +55,13 @@ Java_com_introlab_rtabmap_RTABMapLib_onCreate(
|
||||
return app.onCreate(env, activity);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_introlab_rtabmap_RTABMapLib_openEmptyDatabase(
|
||||
JNIEnv* env, jobject)
|
||||
{
|
||||
return app.openDatabase();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_introlab_rtabmap_RTABMapLib_openDatabase(
|
||||
JNIEnv* env, jobject, jstring databasePath)
|
||||
|
||||
Reference in New Issue
Block a user