mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
fixing flaky tests on windows and mac
This commit is contained in:
@@ -8,12 +8,13 @@
|
|||||||
|
|
||||||
#include <rtabmap/core/GlobalDescriptorExtractor.h>
|
#include <rtabmap/core/GlobalDescriptorExtractor.h>
|
||||||
#include "rtabmap/core/PythonInterface.h"
|
#include "rtabmap/core/PythonInterface.h"
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h"
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
class PyDescriptor : public GlobalDescriptorExtractor
|
class RTABMAP_CORE_EXPORT PyDescriptor : public GlobalDescriptorExtractor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PyDescriptor(const ParametersMap & parameters = ParametersMap());
|
PyDescriptor(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -12,12 +12,13 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "rtabmap/core/PythonInterface.h"
|
#include "rtabmap/core/PythonInterface.h"
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h"
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
class PyDetector : public Feature2D
|
class RTABMAP_CORE_EXPORT PyDetector : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PyDetector(const ParametersMap & parameters = ParametersMap());
|
PyDetector(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -10,13 +10,14 @@
|
|||||||
#include <opencv2/core/types.hpp>
|
#include <opencv2/core/types.hpp>
|
||||||
#include <opencv2/core/mat.hpp>
|
#include <opencv2/core/mat.hpp>
|
||||||
#include "rtabmap/core/PythonInterface.h"
|
#include "rtabmap/core/PythonInterface.h"
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
class PyMatcher
|
class RTABMAP_CORE_EXPORT PyMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PyMatcher(const std::string & pythonMatcherPath,
|
PyMatcher(const std::string & pythonMatcherPath,
|
||||||
|
|||||||
@@ -649,14 +649,14 @@ TEST_F(RtabmapIntegrationFixture, PR2_Scan2D_RGBD)
|
|||||||
EXPECT_GE(result.gridObstacleCells, 4200);
|
EXPECT_GE(result.gridObstacleCells, 4200);
|
||||||
EXPECT_LE(result.gridObstacleCells, 5100);
|
EXPECT_LE(result.gridObstacleCells, 5100);
|
||||||
#ifdef RTABMAP_OCTOMAP
|
#ifdef RTABMAP_OCTOMAP
|
||||||
// Observed: empty 6072-8037, obstacle 39924-42883. Bounds are wide
|
// Observed: empty 6072-8037, obstacle 39924-44130. Bounds are wide
|
||||||
// because without g2o (OdomF2M/BundleAdjustment disabled) visual
|
// because visual odometry drifts a bit differently run-to-run across
|
||||||
// odometry drifts a bit differently run-to-run, which propagates into
|
// platforms (different OpenCV versions and g2o-vs-no-g2o BA), which
|
||||||
// the assembled occupancy grid.
|
// propagates into the assembled occupancy grid.
|
||||||
EXPECT_GE(result.octomapEmptyCells, 5500);
|
EXPECT_GE(result.octomapEmptyCells, 5500);
|
||||||
EXPECT_LE(result.octomapEmptyCells, 8500);
|
EXPECT_LE(result.octomapEmptyCells, 8500);
|
||||||
EXPECT_GE(result.octomapObstacleCells, 38000);
|
EXPECT_GE(result.octomapObstacleCells, 38000);
|
||||||
EXPECT_LE(result.octomapObstacleCells, 44000);
|
EXPECT_LE(result.octomapObstacleCells, 44500);
|
||||||
#endif
|
#endif
|
||||||
// RGB-D F2M visual odom + visual loop closure -- observed RMSE ~13 cm
|
// RGB-D F2M visual odom + visual loop closure -- observed RMSE ~13 cm
|
||||||
// (less stable than the stereo/ICP paths), 20 cm bound gives ~50%
|
// (less stable than the stereo/ICP paths), 20 cm bound gives ~50%
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ TEST(TransformTest, GetTransformFromBuffer)
|
|||||||
std::map<double, Transform> tfBuffer;
|
std::map<double, Transform> tfBuffer;
|
||||||
|
|
||||||
tfBuffer[1.0] = Transform(0, 0, 0, 0, 0, 0); // t=1.0
|
tfBuffer[1.0] = Transform(0, 0, 0, 0, 0, 0); // t=1.0
|
||||||
tfBuffer[2.0] = Transform(1, 0, 0, 0, 0, M_PI/2.0); // t=2.0
|
tfBuffer[2.0] = Transform(1, 0, 0, 0, 0, CV_PI/2.0); // t=2.0
|
||||||
tfBuffer[3.0] = Transform(2, 0, 0, 0, 0, M_PI); // t=3.0
|
tfBuffer[3.0] = Transform(2, 0, 0, 0, 0, CV_PI); // t=3.0
|
||||||
|
|
||||||
// Test exact timestamp
|
// Test exact timestamp
|
||||||
Transform tExact = Transform::getTransform(tfBuffer, 2.0);
|
Transform tExact = Transform::getTransform(tfBuffer, 2.0);
|
||||||
@@ -199,12 +199,12 @@ TEST(TransformTest, GetTransformFromBuffer)
|
|||||||
// Test below
|
// Test below
|
||||||
Transform tBelow = Transform::getTransform(tfBuffer, 1.5);
|
Transform tBelow = Transform::getTransform(tfBuffer, 1.5);
|
||||||
EXPECT_NEAR(tBelow.x(), 0.5f, 1e-5);
|
EXPECT_NEAR(tBelow.x(), 0.5f, 1e-5);
|
||||||
EXPECT_NEAR(tBelow.theta(), M_PI/4.0, 1e-5);
|
EXPECT_NEAR(tBelow.theta(), CV_PI/4.0, 1e-5);
|
||||||
|
|
||||||
// Test above
|
// Test above
|
||||||
Transform tAbove = Transform::getTransform(tfBuffer, 2.5);
|
Transform tAbove = Transform::getTransform(tfBuffer, 2.5);
|
||||||
EXPECT_NEAR(tAbove.x(), 1.5f, 1e-5);
|
EXPECT_NEAR(tAbove.x(), 1.5f, 1e-5);
|
||||||
EXPECT_NEAR(tAbove.theta(), 3.0*M_PI/4.0, 1e-5);
|
EXPECT_NEAR(tAbove.theta(), 3.0*CV_PI/4.0, 1e-5);
|
||||||
|
|
||||||
// Test very close to a border
|
// Test very close to a border
|
||||||
Transform tNear = Transform::getTransform(tfBuffer, 2.0001);
|
Transform tNear = Transform::getTransform(tfBuffer, 2.0001);
|
||||||
|
|||||||
Reference in New Issue
Block a user