Skip to content

Commit

Permalink
DBViewer/Matcher tool: Fixed crash when python feature/matcher is used
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Apr 29, 2024
1 parent 36304b2 commit 9505a21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/DatabaseViewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QApplication>
#include "rtabmap/gui/DatabaseViewer.h"
#include "rtabmap/utilite/ULogger.h"
#ifdef RTABMAP_PYTHON
#include <rtabmap/core/PythonInterface.h>
#endif

#include <vtkObject.h>
#include <vtkVersionMacros.h>
Expand All @@ -50,6 +53,10 @@ int main(int argc, char * argv[])
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
#endif

#ifdef RTABMAP_PYTHON
rtabmap::PythonInterface pythonInterface;
#endif

QApplication * app = new QApplication(argc, argv);
rtabmap::DatabaseViewer * mainWindow = new rtabmap::DatabaseViewer();

Expand Down
7 changes: 7 additions & 0 deletions tools/Matcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/utilite/UFile.h>
#include <rtabmap/utilite/UStl.h>
#include <rtabmap/utilite/UTimer.h>
#ifdef RTABMAP_PYTHON
#include <rtabmap/core/PythonInterface.h>
#endif
#include <fstream>
#include <string>
#include <QApplication>
Expand Down Expand Up @@ -169,6 +172,10 @@ int main(int argc, char * argv[])
printf(" --from_depth = \"%s\"\n", fromDepthPath.c_str());
printf(" --to_depth = \"%s\"\n", toDepthPath.c_str());

#ifdef RTABMAP_PYTHON
rtabmap::PythonInterface pythonInterface;
#endif

ParametersMap parameters = Parameters::parseArguments(argc, argv);
parameters.insert(ParametersPair(Parameters::kRegRepeatOnce(), "false"));

Expand Down

0 comments on commit 9505a21

Please sign in to comment.