mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
uniformized test names
This commit is contained in:
@@ -1829,13 +1829,13 @@ pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_CORE_EXPORT extractIndices(
|
||||
* @note If the `coefficientsOut` is not null, it will be filled with the model coefficients of the plane.
|
||||
*
|
||||
*/
|
||||
pcl::IndicesPtr extractPlane(
|
||||
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractPlane(
|
||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||
const pcl::IndicesPtr & indices,
|
||||
float distanceThreshold,
|
||||
int maxIterations = 100,
|
||||
pcl::ModelCoefficients * coefficientsOut = 0);
|
||||
pcl::IndicesPtr extractPlane(
|
||||
pcl::IndicesPtr RTABMAP_CORE_EXPORT extractPlane(
|
||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||
float distanceThreshold,
|
||||
int maxIterations = 100,
|
||||
|
||||
@@ -273,7 +273,7 @@ TEST_F(StereoTest, GetterMethods)
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(StereoTest, StereoOpticalFlow_IsGpuEnabled)
|
||||
TEST_F(StereoTest, StereoOpticalFlowIsGpuEnabled)
|
||||
{
|
||||
// Test GPU enable/disable for optical flow
|
||||
ParametersMap params;
|
||||
@@ -297,7 +297,7 @@ TEST_F(StereoTest, StereoOpticalFlow_IsGpuEnabled)
|
||||
(void)gpuEnabled; // Suppress unused variable warning
|
||||
}
|
||||
|
||||
TEST_F(StereoTest, StereoOpticalFlow_Epsilon)
|
||||
TEST_F(StereoTest, StereoOpticalFlowEpsilon)
|
||||
{
|
||||
// Test epsilon parameter for optical flow
|
||||
ParametersMap params;
|
||||
|
||||
@@ -12,14 +12,14 @@ static bool approxEqual(float a, float b, float epsilon = 1e-5f)
|
||||
|
||||
// ---------- TEST CASES ----------
|
||||
|
||||
TEST(TransformTests, DefaultConstructor)
|
||||
TEST(TransformTest, DefaultConstructor)
|
||||
{
|
||||
Transform t;
|
||||
EXPECT_TRUE(t.isNull());
|
||||
EXPECT_FALSE(t.isIdentity());
|
||||
}
|
||||
|
||||
TEST(TransformTests, Identity)
|
||||
TEST(TransformTest, Identity)
|
||||
{
|
||||
Transform t = Transform::getIdentity();
|
||||
EXPECT_TRUE(t.isIdentity());
|
||||
@@ -30,7 +30,7 @@ TEST(TransformTests, Identity)
|
||||
EXPECT_TRUE(result.isIdentity());
|
||||
}
|
||||
|
||||
TEST(TransformTests, EqualityOperators)
|
||||
TEST(TransformTest, EqualityOperators)
|
||||
{
|
||||
Transform t1 = Transform::getIdentity();
|
||||
Transform t2 = Transform::getIdentity();
|
||||
@@ -43,7 +43,7 @@ TEST(TransformTests, EqualityOperators)
|
||||
EXPECT_TRUE(t1 != t2);
|
||||
}
|
||||
|
||||
TEST(TransformTests, TranslationConstructor)
|
||||
TEST(TransformTest, TranslationConstructor)
|
||||
{
|
||||
Transform t(1.0f, 2.0f, 3.0f, 0, 0, 0);
|
||||
EXPECT_TRUE(approxEqual(t.x(), 1.0f));
|
||||
@@ -51,7 +51,7 @@ TEST(TransformTests, TranslationConstructor)
|
||||
EXPECT_TRUE(approxEqual(t.z(), 3.0f));
|
||||
}
|
||||
|
||||
TEST(TransformTests, MatrixConstructor)
|
||||
TEST(TransformTest, MatrixConstructor)
|
||||
{
|
||||
cv::Mat mat = (cv::Mat_<float>(3, 4) <<
|
||||
1, 0, 0, 1,
|
||||
@@ -63,7 +63,7 @@ TEST(TransformTests, MatrixConstructor)
|
||||
EXPECT_TRUE(approxEqual(t.z(), 3.0f));
|
||||
}
|
||||
|
||||
TEST(TransformTests, Inverse)
|
||||
TEST(TransformTest, Inverse)
|
||||
{
|
||||
Transform t(1, 0, 0, 1,
|
||||
0, 1, 0, 2,
|
||||
@@ -73,7 +73,7 @@ TEST(TransformTests, Inverse)
|
||||
EXPECT_TRUE(id.isIdentity());
|
||||
}
|
||||
|
||||
TEST(TransformTests, Interpolation)
|
||||
TEST(TransformTest, Interpolation)
|
||||
{
|
||||
Transform t1(0, 0, 0, 0, 0, 0);
|
||||
Transform t2(0, 0, 1, 0, 0, 0);
|
||||
@@ -81,7 +81,7 @@ TEST(TransformTests, Interpolation)
|
||||
EXPECT_TRUE(approxEqual(mid.z(), 0.5f));
|
||||
}
|
||||
|
||||
TEST(TransformTests, NormAndDistance)
|
||||
TEST(TransformTest, NormAndDistance)
|
||||
{
|
||||
Transform t1(0, 0, 0, 0, 0, 0);
|
||||
Transform t2(1, 2, 2, 0, 0, 0);
|
||||
@@ -91,7 +91,7 @@ TEST(TransformTests, NormAndDistance)
|
||||
EXPECT_TRUE(approxEqual(t1.getDistanceSquared(t2), 9.0f));
|
||||
}
|
||||
|
||||
TEST(TransformTests, EulerAndQuaternionConversion)
|
||||
TEST(TransformTest, EulerAndQuaternionConversion)
|
||||
{
|
||||
Transform t(1, 2, 3, 0.1f, 0.2f, 0.3f);
|
||||
float roll, pitch, yaw;
|
||||
@@ -107,14 +107,14 @@ TEST(TransformTests, EulerAndQuaternionConversion)
|
||||
EXPECT_TRUE(std::isfinite(q.w()));
|
||||
}
|
||||
|
||||
TEST(TransformTests, StringConversion)
|
||||
TEST(TransformTest, StringConversion)
|
||||
{
|
||||
Transform original(1.0f, 2.0f, 3.0f, 0.1f, 0.2f, 0.3f);
|
||||
Transform parsed = Transform::fromString("1.0 2.0 3.0 0.1 0.2 0.3");
|
||||
EXPECT_TRUE(original.getDistance(parsed) < 1e-4f);
|
||||
}
|
||||
|
||||
TEST(TransformTests, DoFConversion)
|
||||
TEST(TransformTest, DoFConversion)
|
||||
{
|
||||
// 6DoF transform
|
||||
Transform t6(1, 2, 3, 0.1f, 0.2f, 0.3f);
|
||||
@@ -135,7 +135,7 @@ TEST(TransformTests, DoFConversion)
|
||||
EXPECT_TRUE(approxEqual(t4dof.r33(), 1.0f));
|
||||
}
|
||||
|
||||
TEST(TransformTests, OpenGLToRTABMap)
|
||||
TEST(TransformTest, OpenGLToRTABMap)
|
||||
{
|
||||
// Multiplying should return identity
|
||||
Transform result = Transform::opengl_T_rtabmap() * Transform::rtabmap_T_opengl();
|
||||
@@ -152,7 +152,7 @@ TEST(TransformTests, OpenGLToRTABMap)
|
||||
EXPECT_NEAR((Transform::opengl_T_rtabmap() * Transform(0,0,1,0,0,0)).y(), 1, 1e-5);
|
||||
}
|
||||
|
||||
TEST(TransformTests, EigenConversions)
|
||||
TEST(TransformTest, EigenConversions)
|
||||
{
|
||||
Transform t(1.0f, 2.0f, 3.0f, 0.1f, 0.2f, 0.3f);
|
||||
|
||||
@@ -184,7 +184,7 @@ TEST(TransformTests, EigenConversions)
|
||||
EXPECT_NEAR(qd.norm(), 1.0, 1e-5);
|
||||
}
|
||||
|
||||
TEST(TransformTests, GetTransformFromBuffer)
|
||||
TEST(TransformTest, GetTransformFromBuffer)
|
||||
{
|
||||
std::map<double, Transform> tfBuffer;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util2dTest, ssdIdenticalImages)
|
||||
TEST(Util2dTest, SsdIdenticalImages)
|
||||
{
|
||||
cv::Mat img1 = (cv::Mat_<uint8_t>(3,3) << 10, 20, 30, 40, 50, 60, 70, 80, 90);
|
||||
cv::Mat img2 = img1.clone();
|
||||
@@ -16,7 +16,7 @@ TEST(Util2dTest, ssdIdenticalImages)
|
||||
EXPECT_FLOAT_EQ(score, 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, ssdDifferentImages)
|
||||
TEST(Util2dTest, SsdDifferentImages)
|
||||
{
|
||||
cv::Mat img1 = (cv::Mat_<uint8_t>(2,2) << 10, 20, 30, 40);
|
||||
cv::Mat img2 = (cv::Mat_<uint8_t>(2,2) << 11, 19, 31, 39);
|
||||
@@ -25,7 +25,7 @@ TEST(Util2dTest, ssdDifferentImages)
|
||||
EXPECT_FLOAT_EQ(score, expected);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, ssdStereoLikeInput)
|
||||
TEST(Util2dTest, SsdStereoLikeInput)
|
||||
{
|
||||
cv::Mat left = (cv::Mat_<cv::Vec2s>(1,1) << cv::Vec2s(10, 20));
|
||||
cv::Mat right = (cv::Mat_<cv::Vec2s>(1,1) << cv::Vec2s(11, 19));
|
||||
@@ -35,7 +35,7 @@ TEST(Util2dTest, ssdStereoLikeInput)
|
||||
EXPECT_FLOAT_EQ(util2d::ssd(left, right), expected);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, sadIdenticalImages)
|
||||
TEST(Util2dTest, SadIdenticalImages)
|
||||
{
|
||||
cv::Mat img1 = (cv::Mat_<float>(2,2) << 1.0, 2.0, 3.0, 4.0);
|
||||
cv::Mat img2 = img1.clone();
|
||||
@@ -43,7 +43,7 @@ TEST(Util2dTest, sadIdenticalImages)
|
||||
EXPECT_FLOAT_EQ(score, 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, sadDifferentImages)
|
||||
TEST(Util2dTest, SadDifferentImages)
|
||||
{
|
||||
cv::Mat img1 = (cv::Mat_<float>(2,2) << 1.0, 2.0, 3.0, 4.0);
|
||||
cv::Mat img2 = (cv::Mat_<float>(2,2) << 0.5, 2.5, 2.5, 5.0);
|
||||
@@ -51,7 +51,7 @@ TEST(Util2dTest, sadDifferentImages)
|
||||
EXPECT_FLOAT_EQ(util2d::sad(img1, img2), score);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, sadStereoLikeInput)
|
||||
TEST(Util2dTest, SadStereoLikeInput)
|
||||
{
|
||||
cv::Mat left = (cv::Mat_<cv::Vec2s>(1,1) << cv::Vec2s(5, 15));
|
||||
cv::Mat right = (cv::Mat_<cv::Vec2s>(1,1) << cv::Vec2s(10, 10));
|
||||
@@ -61,7 +61,7 @@ TEST(Util2dTest, sadStereoLikeInput)
|
||||
EXPECT_FLOAT_EQ(util2d::sad(left, right), expected);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, calcStereoCorrespondencesCheckInputs) {
|
||||
TEST(Util2dTest, CalcStereoCorrespondencesCheckInputs) {
|
||||
|
||||
// Create synthetic images
|
||||
cv::Mat left = cv::Mat::zeros(100, 100, CV_8UC1);
|
||||
@@ -84,7 +84,7 @@ TEST(Util2dTest, calcStereoCorrespondencesCheckInputs) {
|
||||
ASSERT_TRUE(util2d::calcStereoCorrespondences(left, right, emptyCorners, status).empty());
|
||||
}
|
||||
|
||||
TEST(Util2dTest, calcStereoCorrespondencesSSD) {
|
||||
TEST(Util2dTest, CalcStereoCorrespondencesSSD) {
|
||||
|
||||
// Create synthetic images
|
||||
cv::Mat left = cv::Mat::zeros(100, 100, CV_8UC1);
|
||||
@@ -119,7 +119,7 @@ TEST(Util2dTest, calcStereoCorrespondencesSSD) {
|
||||
ASSERT_NEAR(leftCorners[1].x - rightCorners[1].x, 6.75f, 0.1f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, calcStereoCorrespondencesSAD) {
|
||||
TEST(Util2dTest, CalcStereoCorrespondencesSAD) {
|
||||
|
||||
// Create synthetic images
|
||||
cv::Mat left = cv::Mat::zeros(100, 100, CV_8UC1);
|
||||
@@ -154,7 +154,7 @@ TEST(Util2dTest, calcStereoCorrespondencesSAD) {
|
||||
ASSERT_NEAR(leftCorners[1].x - rightCorners[1].x, 6.75f, 0.1f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, calcOpticalFlowPyrLKStereo)
|
||||
TEST(Util2dTest, CalcOpticalFlowPyrLKStereo)
|
||||
{
|
||||
// Create synthetic images
|
||||
cv::Mat left = cv::Mat::zeros(100, 100, CV_8UC1);
|
||||
@@ -189,7 +189,7 @@ TEST(Util2dTest, calcOpticalFlowPyrLKStereo)
|
||||
ASSERT_NEAR(leftPoint.x - nextPts[0].x, 5.0f, 0.1f) << "X displacement should be close to 5.";
|
||||
}
|
||||
|
||||
TEST(Util2dTest, disparityFromStereoImages)
|
||||
TEST(Util2dTest, DisparityFromStereoImages)
|
||||
{
|
||||
// Check inputs
|
||||
ASSERT_THROW(util2d::disparityFromStereoImages(cv::Mat(), cv::Mat(2,2,CV_8UC1)), UException);
|
||||
@@ -217,7 +217,7 @@ TEST(Util2dTest, disparityFromStereoImages)
|
||||
EXPECT_NEAR(maxVal, 388, 0.5);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, depthFromDisparityFloat32) {
|
||||
TEST(Util2dTest, DepthFromDisparityFloat32) {
|
||||
const int rows = 2;
|
||||
const int cols = 3;
|
||||
const float fx = 500.0f; // focal length in pixels
|
||||
@@ -239,7 +239,7 @@ TEST(Util2dTest, depthFromDisparityFloat32) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, depthFromDisparityUInt16) {
|
||||
TEST(Util2dTest, DepthFromDisparityUInt16) {
|
||||
const int rows = 2;
|
||||
const int cols = 3;
|
||||
const float fx = 500.0f;
|
||||
@@ -261,7 +261,7 @@ TEST(Util2dTest, depthFromDisparityUInt16) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, depthFromStereoImages)
|
||||
TEST(Util2dTest, DepthFromStereoImages)
|
||||
{
|
||||
// Parameters
|
||||
const int width = 20;
|
||||
@@ -305,7 +305,7 @@ TEST(Util2dTest, depthFromStereoImages)
|
||||
ASSERT_NEAR(actualDepth, expectedDepth, 1e-3);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, disparityFromStereoCorrespondencesDisparityComputation)
|
||||
TEST(Util2dTest, DisparityFromStereoCorrespondencesDisparityComputation)
|
||||
{
|
||||
// Test setup
|
||||
cv::Size disparitySize(5, 5);
|
||||
@@ -340,7 +340,7 @@ TEST(Util2dTest, disparityFromStereoCorrespondencesDisparityComputation)
|
||||
EXPECT_EQ(disparity.at<float>(4, 0), 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, disparityFromStereoCorrespondencesEmptyMask)
|
||||
TEST(Util2dTest, DisparityFromStereoCorrespondencesEmptyMask)
|
||||
{
|
||||
// Test with empty mask (all points should be included)
|
||||
cv::Size disparitySize(4, 4);
|
||||
@@ -365,7 +365,7 @@ TEST(Util2dTest, disparityFromStereoCorrespondencesEmptyMask)
|
||||
EXPECT_EQ(disparity.at<float>(3, 1), 0.5f); // 3.0f - 2.5f = 0.5f
|
||||
}
|
||||
|
||||
TEST(Util2dTest, disparityFromStereoCorrespondencesInconsistentCornersSize)
|
||||
TEST(Util2dTest, DisparityFromStereoCorrespondencesInconsistentCornersSize)
|
||||
{
|
||||
// Test with inconsistent corners size (should fail)
|
||||
cv::Size disparitySize(5, 5);
|
||||
@@ -388,7 +388,7 @@ TEST(Util2dTest, disparityFromStereoCorrespondencesInconsistentCornersSize)
|
||||
ASSERT_THROW(util2d::disparityFromStereoCorrespondences(disparitySize, leftCorners, rightCorners, mask), UException);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, depthFromStereoCorrespondences)
|
||||
TEST(Util2dTest, DepthFromStereoCorrespondences)
|
||||
{
|
||||
// Create a dummy left image (only used for size)
|
||||
cv::Mat leftImage = cv::Mat::zeros(10, 10, CV_8UC1);
|
||||
@@ -418,7 +418,7 @@ TEST(Util2dTest, depthFromStereoCorrespondences)
|
||||
ASSERT_NEAR(actualDepth, expectedDepth, 1e-4);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, cvtDepthFromFloat) {
|
||||
TEST(Util2dTest, CvtDepthFromFloat) {
|
||||
// Create a simple 3x3 depth image in meters
|
||||
cv::Mat depth32F = (cv::Mat_<float>(3, 3) <<
|
||||
0.5f, 1.0f, 1.5f,
|
||||
@@ -437,7 +437,7 @@ TEST(Util2dTest, cvtDepthFromFloat) {
|
||||
EXPECT_EQ(depth16U.at<unsigned short>(2, 2), 7000); // 7.0m -> 7000mm
|
||||
}
|
||||
|
||||
TEST(Util2dTest, cvtDepthToFloat) {
|
||||
TEST(Util2dTest, CvtDepthToFloat) {
|
||||
// Create a simple 3x3 depth image in millimeters
|
||||
cv::Mat depth16U = (cv::Mat_<unsigned short>(3, 3) <<
|
||||
500, 1000, 1500,
|
||||
@@ -456,7 +456,7 @@ TEST(Util2dTest, cvtDepthToFloat) {
|
||||
EXPECT_FLOAT_EQ(depth32F.at<float>(2, 2), 7.0f); // 7000mm -> 7.0m
|
||||
}
|
||||
|
||||
TEST(Util2dTest, cvtDepthRoundTripConversion) {
|
||||
TEST(Util2dTest, CvtDepthRoundTripConversion) {
|
||||
// Test round-trip conversion
|
||||
cv::Mat original = (cv::Mat_<float>(2, 2) << 0.25f, 1.0f, 2.5f, 3.3f);
|
||||
|
||||
@@ -471,7 +471,7 @@ TEST(Util2dTest, cvtDepthRoundTripConversion) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, getDepthCenterDepthValue32FNoSmoothingNoEstimation) {
|
||||
TEST(Util2dTest, GetDepthCenterDepthValue32FNoSmoothingNoEstimation) {
|
||||
cv::Mat depth = cv::Mat::zeros(5, 5, CV_32FC1);
|
||||
depth.at<float>(2, 2) = 1.5f;
|
||||
|
||||
@@ -479,7 +479,7 @@ TEST(Util2dTest, getDepthCenterDepthValue32FNoSmoothingNoEstimation) {
|
||||
EXPECT_FLOAT_EQ(result, 1.5f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, getDepthCenterDepthValue16UNoSmoothingNoEstimation) {
|
||||
TEST(Util2dTest, GetDepthCenterDepthValue16UNoSmoothingNoEstimation) {
|
||||
cv::Mat depth = cv::Mat::zeros(5, 5, CV_16UC1);
|
||||
depth.at<unsigned short>(2, 2) = 1500; // 1.5 meters
|
||||
|
||||
@@ -487,7 +487,7 @@ TEST(Util2dTest, getDepthCenterDepthValue16UNoSmoothingNoEstimation) {
|
||||
EXPECT_FLOAT_EQ(result, 1.5f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, getDepthSmoothing32F) {
|
||||
TEST(Util2dTest, GetDepthSmoothing32F) {
|
||||
cv::Mat depth = cv::Mat::zeros(5, 5, CV_32FC1);
|
||||
depth.at<float>(2, 2) = 1.0f;
|
||||
depth.at<float>(2, 1) = 1.0f;
|
||||
@@ -499,7 +499,7 @@ TEST(Util2dTest, getDepthSmoothing32F) {
|
||||
EXPECT_NEAR(result, 1.0f, 1e-5f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, getDepthEstimationFromNeighbors16U) {
|
||||
TEST(Util2dTest, GetDepthEstimationFromNeighbors16U) {
|
||||
cv::Mat depth = cv::Mat::zeros(5, 5, CV_16UC1);
|
||||
depth.at<unsigned short>(2, 1) = 1500; // 1.5m
|
||||
depth.at<unsigned short>(1, 2) = 1500;
|
||||
@@ -508,14 +508,14 @@ TEST(Util2dTest, getDepthEstimationFromNeighbors16U) {
|
||||
EXPECT_NEAR(result, 1.5f, 1e-3f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, getDepthOutOfBounds) {
|
||||
TEST(Util2dTest, GetDepthOutOfBounds) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
|
||||
float result = util2d::getDepth(depth, 5.5f, 5.5f, false, 0.1f, false);
|
||||
EXPECT_FLOAT_EQ(result, 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, computeRoiValidStringInput)
|
||||
TEST(Util2dTest, ComputeRoiValidStringInput)
|
||||
{
|
||||
cv::Size imageSize(200, 100);
|
||||
cv::Mat image = cv::Mat::zeros(imageSize, CV_8UC1);
|
||||
@@ -531,14 +531,14 @@ TEST(Util2dTest, computeRoiValidStringInput)
|
||||
EXPECT_EQ(roi.height, 60);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, computeRoiInvalidStringInput)
|
||||
TEST(Util2dTest, ComputeRoiInvalidStringInput)
|
||||
{
|
||||
cv::Mat image = cv::Mat::zeros(100, 200, CV_8UC1);
|
||||
cv::Rect roi = util2d::computeRoi(image, "0.5 0.6"); // Invalid format
|
||||
EXPECT_EQ(roi, cv::Rect()); // Expect empty ROI
|
||||
}
|
||||
|
||||
TEST(Util2dTest, computeRoiValidVectorInput)
|
||||
TEST(Util2dTest, ComputeRoiValidVectorInput)
|
||||
{
|
||||
cv::Size imageSize(300, 150);
|
||||
cv::Mat image = cv::Mat::zeros(imageSize, CV_8UC1);
|
||||
@@ -555,7 +555,7 @@ TEST(Util2dTest, computeRoiValidVectorInput)
|
||||
EXPECT_EQ(roi.height, 120);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, computeRoiInvalidVectorSize)
|
||||
TEST(Util2dTest, ComputeRoiInvalidVectorSize)
|
||||
{
|
||||
cv::Size imageSize(300, 150);
|
||||
std::vector<float> invalidRatios = {0.1f, 0.2f}; // Invalid size
|
||||
@@ -563,7 +563,7 @@ TEST(Util2dTest, computeRoiInvalidVectorSize)
|
||||
EXPECT_EQ(roi, cv::Rect());
|
||||
}
|
||||
|
||||
TEST(Util2dTest, computeRoiZeroImageSize)
|
||||
TEST(Util2dTest, ComputeRoiZeroImageSize)
|
||||
{
|
||||
cv::Size imageSize(0, 0);
|
||||
cv::Mat image = cv::Mat::zeros(imageSize, CV_8UC1);
|
||||
@@ -574,7 +574,7 @@ TEST(Util2dTest, computeRoiZeroImageSize)
|
||||
EXPECT_EQ(roi, cv::Rect());
|
||||
}
|
||||
|
||||
TEST(Util2dTest, decimateFloatDepthImage)
|
||||
TEST(Util2dTest, DecimateFloatDepthImage)
|
||||
{
|
||||
// Create a 4x4 depth image with increasing values
|
||||
cv::Mat depth = (cv::Mat_<float>(4, 4) <<
|
||||
@@ -594,7 +594,7 @@ TEST(Util2dTest, decimateFloatDepthImage)
|
||||
EXPECT_FLOAT_EQ(decimated.at<float>(1,1), 11);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, decimate16UDepthImage)
|
||||
TEST(Util2dTest, Decimate16UDepthImage)
|
||||
{
|
||||
cv::Mat depth = (cv::Mat_<uint16_t>(4, 4) <<
|
||||
100, 200, 300, 400,
|
||||
@@ -612,7 +612,7 @@ TEST(Util2dTest, decimate16UDepthImage)
|
||||
EXPECT_EQ(decimated.at<uint16_t>(1,1), 1100);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, interpolateFloatDepthImage)
|
||||
TEST(Util2dTest, InterpolateFloatDepthImage)
|
||||
{
|
||||
// Create a simple 2x2 image to interpolate into 4x4
|
||||
cv::Mat input = (cv::Mat_<float>(2,2) <<
|
||||
@@ -637,7 +637,7 @@ TEST(Util2dTest, interpolateFloatDepthImage)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, interpolate16UDepthImage)
|
||||
TEST(Util2dTest, Interpolate16UDepthImage)
|
||||
{
|
||||
cv::Mat input = (cv::Mat_<uint16_t>(2,2) <<
|
||||
1000, 1000,
|
||||
@@ -660,7 +660,7 @@ TEST(Util2dTest, interpolate16UDepthImage)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, registerDepth)
|
||||
TEST(Util2dTest, RegisterDepth)
|
||||
{
|
||||
// Create a 2x2 synthetic depth image in meters
|
||||
cv::Mat depth = (cv::Mat_<float>(2,2) << 1.0f, 1.0f,
|
||||
@@ -693,7 +693,7 @@ TEST(Util2dTest, registerDepth)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, registerDepthWithOverlap)
|
||||
TEST(Util2dTest, RegisterDepthWithOverlap)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(11,11,CV_32FC1);
|
||||
cv::Mat depthK = (cv::Mat_<double>(3,3) <<
|
||||
@@ -724,7 +724,7 @@ TEST(Util2dTest, registerDepthWithOverlap)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillDepthHoles) {
|
||||
TEST(Util2dTest, FillDepthHoles) {
|
||||
cv::Mat depth = (cv::Mat_<float>(3,3) <<
|
||||
1, 0, 2,
|
||||
0, 3, 0,
|
||||
@@ -750,7 +750,7 @@ TEST(Util2dTest, fillDepthHoles) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillDepthHolesLargeHoleTest) {
|
||||
TEST(Util2dTest, FillDepthHolesLargeHoleTest) {
|
||||
|
||||
cv::Mat depth = (cv::Mat_<float>(5,5) <<
|
||||
1, 0, 2, 3, 5,
|
||||
@@ -780,7 +780,7 @@ TEST(Util2dTest, fillDepthHolesLargeHoleTest) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillDepthHolesInvalidInputTest) {
|
||||
TEST(Util2dTest, FillDepthHolesInvalidInputTest) {
|
||||
cv::Mat depth(5, 5, CV_32FC1);
|
||||
|
||||
// Test with invalid maximumHoleSize (<= 0)
|
||||
@@ -800,7 +800,7 @@ cv::Mat createTestDepthImage()
|
||||
return img;
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillRegisteredDepthHolesVerticalFilling)
|
||||
TEST(Util2dTest, FillRegisteredDepthHolesVerticalFilling)
|
||||
{
|
||||
cv::Mat input = createTestDepthImage();
|
||||
cv::Mat original = input.clone();
|
||||
@@ -820,7 +820,7 @@ TEST(Util2dTest, fillRegisteredDepthHolesVerticalFilling)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillRegisteredDepthHolesHorizontalFilling)
|
||||
TEST(Util2dTest, FillRegisteredDepthHolesHorizontalFilling)
|
||||
{
|
||||
cv::Mat input = createTestDepthImage();
|
||||
cv::Mat original = input.clone();
|
||||
@@ -840,7 +840,7 @@ TEST(Util2dTest, fillRegisteredDepthHolesHorizontalFilling)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fillRegisteredDepthHolesDoubleHoleFilling)
|
||||
TEST(Util2dTest, FillRegisteredDepthHolesDoubleHoleFilling)
|
||||
{
|
||||
cv::Mat input = (cv::Mat_<unsigned short>(5, 5) <<
|
||||
1000, 1005, 0, 1020, 1030,
|
||||
@@ -865,12 +865,12 @@ TEST(Util2dTest, fillRegisteredDepthHolesDoubleHoleFilling)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fastBilateralFilteringEmptyInput) {
|
||||
TEST(Util2dTest, FastBilateralFilteringEmptyInput) {
|
||||
cv::Mat empty;
|
||||
EXPECT_THROW(util2d::fastBilateralFiltering(empty, 2.0f, 0.1f, false), UException);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fastBilateralFilteringAllZeroInput) {
|
||||
TEST(Util2dTest, FastBilateralFilteringAllZeroInput) {
|
||||
cv::Mat depth = cv::Mat::zeros(10, 10, CV_32FC1);
|
||||
cv::Mat result = util2d::fastBilateralFiltering(depth, 2.0f, 0.1f, false);
|
||||
// All values should still be 0
|
||||
@@ -881,7 +881,7 @@ TEST(Util2dTest, fastBilateralFilteringAllZeroInput) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fastBilateralFilteringSimpleFloatInput) {
|
||||
TEST(Util2dTest, FastBilateralFilteringSimpleFloatInput) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1) * 1.0f;
|
||||
depth.at<float>(2,2) = 1.05f;
|
||||
cv::Mat result = util2d::fastBilateralFiltering(depth, 3.0f, 0.05f, false);
|
||||
@@ -899,7 +899,7 @@ TEST(Util2dTest, fastBilateralFilteringSimpleFloatInput) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util2dTest, fastBilateralFilteringSimpleUShortInput) {
|
||||
TEST(Util2dTest, FastBilateralFilteringSimpleUShortInput) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_16UC1) * 1000; // 1 meter
|
||||
depth.at<unsigned short>(2,2) = 1050;
|
||||
cv::Mat result = util2d::fastBilateralFiltering(depth, 2.0f, 0.05f, true);
|
||||
@@ -917,7 +917,7 @@ TEST(Util2dTest, fastBilateralFilteringSimpleUShortInput) {
|
||||
}
|
||||
|
||||
// High Depth Variation (should preserve edge due to sigmaR)
|
||||
TEST(Util2dTest, fastBilateralFilteringPreservesEdgesWithLowSigmaR) {
|
||||
TEST(Util2dTest, FastBilateralFilteringPreservesEdgesWithLowSigmaR) {
|
||||
// Create a step edge: left side = 1.0f, right side = 3.0f
|
||||
cv::Mat depth = cv::Mat::ones(5, 10, CV_32FC1);
|
||||
depth.colRange(5, 10).setTo(3.0f);
|
||||
@@ -938,7 +938,7 @@ TEST(Util2dTest, fastBilateralFilteringPreservesEdgesWithLowSigmaR) {
|
||||
}
|
||||
|
||||
// High sigmaR (should blur across the edge)
|
||||
TEST(Util2dTest, fastBilateralFilteringBlursEdgesWithHighSigmaR) {
|
||||
TEST(Util2dTest, FastBilateralFilteringBlursEdgesWithHighSigmaR) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 10, CV_32FC1);
|
||||
depth.colRange(5, 10).setTo(3.0f);
|
||||
|
||||
@@ -958,7 +958,7 @@ TEST(Util2dTest, fastBilateralFilteringBlursEdgesWithHighSigmaR) {
|
||||
}
|
||||
|
||||
// Random Depth Values with NaNs or Invalids
|
||||
TEST(Util2dTest, fastBilateralFilteringHandlesInvalidDepthValues) {
|
||||
TEST(Util2dTest, FastBilateralFilteringHandlesInvalidDepthValues) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
depth.at<float>(2, 2) = std::numeric_limits<float>::quiet_NaN();
|
||||
depth.at<float>(1, 3) = -1.0f;
|
||||
@@ -978,7 +978,7 @@ TEST(Util2dTest, fastBilateralFilteringHandlesInvalidDepthValues) {
|
||||
}
|
||||
|
||||
// Early Division Toggle
|
||||
TEST(Util2dTest, fastBilateralFilteringEarlyDivisionOptionConsistency) {
|
||||
TEST(Util2dTest, FastBilateralFilteringEarlyDivisionOptionConsistency) {
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1) * 2.0f;
|
||||
depth.at<float>(2,2) = 2.1f;
|
||||
cv::Mat result1 = util2d::fastBilateralFiltering(depth, 2.0f, 0.1f, true);
|
||||
@@ -995,14 +995,14 @@ TEST(Util2dTest, fastBilateralFilteringEarlyDivisionOptionConsistency) {
|
||||
}
|
||||
|
||||
// Test for empty input
|
||||
TEST(Util2dTest, depthBleedingFilteringHandlesEmptyInput)
|
||||
TEST(Util2dTest, DepthBleedingFilteringHandlesEmptyInput)
|
||||
{
|
||||
cv::Mat empty;
|
||||
EXPECT_NO_THROW(util2d::depthBleedingFiltering(empty, 0.1f));
|
||||
}
|
||||
|
||||
// Test that borders are zeroed out
|
||||
TEST(Util2dTest, depthBleedingFilteringBordersAreZeroed)
|
||||
TEST(Util2dTest, DepthBleedingFilteringBordersAreZeroed)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
util2d::depthBleedingFiltering(depth, 0.1f);
|
||||
@@ -1017,7 +1017,7 @@ TEST(Util2dTest, depthBleedingFilteringBordersAreZeroed)
|
||||
}
|
||||
|
||||
// Test that valid depths are not removed
|
||||
TEST(Util2dTest, depthBleedingFilteringKeepsValidDepths)
|
||||
TEST(Util2dTest, DepthBleedingFilteringKeepsValidDepths)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
depth.at<float>(2,2) = 1.01f; // Within threshold of 0.1
|
||||
@@ -1026,7 +1026,7 @@ TEST(Util2dTest, depthBleedingFilteringKeepsValidDepths)
|
||||
}
|
||||
|
||||
// Test that invalid depth is removed
|
||||
TEST(Util2dTest, depthBleedingFilteringFiltersInvalidDepths)
|
||||
TEST(Util2dTest, DepthBleedingFilteringFiltersInvalidDepths)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
depth.at<float>(2,2) = 5.0f; // Large depth jump
|
||||
@@ -1035,7 +1035,7 @@ TEST(Util2dTest, depthBleedingFilteringFiltersInvalidDepths)
|
||||
}
|
||||
|
||||
// Repeat the above for CV_16UC1
|
||||
TEST(Util2dTest, depthBleedingFilteringFiltersInvalidDepths16U)
|
||||
TEST(Util2dTest, DepthBleedingFilteringFiltersInvalidDepths16U)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_16UC1) * 1000; // 1.0m in mm
|
||||
depth.at<uint16_t>(2,2) = 5000; // 5.0m
|
||||
@@ -1043,7 +1043,7 @@ TEST(Util2dTest, depthBleedingFilteringFiltersInvalidDepths16U)
|
||||
EXPECT_EQ(depth.at<uint16_t>(2,2), 0);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, depthBleedingFilteringKeepsValidDepths16U)
|
||||
TEST(Util2dTest, DepthBleedingFilteringKeepsValidDepths16U)
|
||||
{
|
||||
cv::Mat depth = cv::Mat::ones(5, 5, CV_16UC1) * 1000;
|
||||
depth.at<uint16_t>(2,2) = 1090; // 0.09m difference, within 0.1m
|
||||
@@ -1259,7 +1259,7 @@ cv::Mat createTestImage(int width, int height, uchar value = 100) {
|
||||
return cv::Mat(height, width, CV_8UC3, cv::Scalar(value, value, value));
|
||||
}
|
||||
|
||||
TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryNoRotation) {
|
||||
TEST(Util2dTest, RotateImagesUpsideUpIfNecessaryNoRotation) {
|
||||
CameraModel model(500, 500, 320, 240, CameraModel::opticalRotation(), 0, cv::Size(640, 480));
|
||||
cv::Mat rgb = createTestImage(640, 480);
|
||||
cv::Mat depth = createTestImage(640, 480);
|
||||
@@ -1278,7 +1278,7 @@ TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryNoRotation) {
|
||||
EXPECT_EQ(yaw, 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation90Degrees) {
|
||||
TEST(Util2dTest, RotateImagesUpsideUpIfNecessaryRotation90Degrees) {
|
||||
// Simulate 90° roll
|
||||
Transform rot = Transform(0,0,0, M_PI / 2, 0, 0);
|
||||
CameraModel model(500, 500, 320, 240, rot*CameraModel::opticalRotation(), 0, cv::Size(640, 480));
|
||||
@@ -1301,7 +1301,7 @@ TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation90Degrees) {
|
||||
EXPECT_NEAR(yaw, 0.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation180Degrees) {
|
||||
TEST(Util2dTest, RotateImagesUpsideUpIfNecessaryRotation180Degrees) {
|
||||
Transform rot = Transform(0,0,0, M_PI, 0, 0);
|
||||
CameraModel model(500, 500, 320, 240, rot*CameraModel::opticalRotation(), 0, cv::Size(640, 480));
|
||||
cv::Mat rgb = createTestImage(640, 480, 123);
|
||||
@@ -1323,7 +1323,7 @@ TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation180Degrees) {
|
||||
EXPECT_NEAR(yaw, 0.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation270Degrees) {
|
||||
TEST(Util2dTest, RotateImagesUpsideUpIfNecessaryRotation270Degrees) {
|
||||
Transform rot = Transform(0,0,0, 3*M_PI/2, 0, 0);
|
||||
CameraModel model(500, 500, 320, 240, rot*CameraModel::opticalRotation(), 0, cv::Size(640, 480));
|
||||
cv::Mat rgb = createTestImage(640, 480, 90);
|
||||
@@ -1345,7 +1345,7 @@ TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryRotation270Degrees) {
|
||||
EXPECT_NEAR(yaw, 0.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util2dTest, rotateImagesUpsideUpIfNecessaryPitchTooHighShouldSkip) {
|
||||
TEST(Util2dTest, RotateImagesUpsideUpIfNecessaryPitchTooHighShouldSkip) {
|
||||
ULogger::setType(ULogger::kTypeConsole);
|
||||
ULogger::setLevel(ULogger::kDebug);
|
||||
// Simulate roll = 90°, but pitch = 90° too (invalid)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3dTest, rgbFromCloudGeneratesCorrectRGB)
|
||||
TEST(Util3dTest, RgbFromCloudGeneratesCorrectRGB)
|
||||
{
|
||||
// Create a 2x2 organized point cloud with known colors
|
||||
pcl::PointCloud<pcl::PointXYZRGBA> cloud;
|
||||
@@ -40,7 +40,7 @@ TEST(Util3dTest, rgbFromCloudGeneratesCorrectRGB)
|
||||
EXPECT_EQ(rgb.at<cv::Vec3b>(1,1), cv::Vec3b(255,255,255)); // White
|
||||
}
|
||||
|
||||
TEST(Util3dTest, depthFromCloudBasic32F)
|
||||
TEST(Util3dTest, DepthFromCloudBasic32F)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZRGBA> cloud;
|
||||
cloud.width = 3;
|
||||
@@ -75,7 +75,7 @@ TEST(Util3dTest, depthFromCloudBasic32F)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, depthFromCloudBasic16U)
|
||||
TEST(Util3dTest, DepthFromCloudBasic16U)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZRGBA> cloud;
|
||||
cloud.width = 2;
|
||||
@@ -105,7 +105,7 @@ TEST(Util3dTest, depthFromCloudBasic16U)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, rgbdFromCloudBasicConversion)
|
||||
TEST(Util3dTest, RgbdFromCloudBasicConversion)
|
||||
{
|
||||
// Create a 2x2 point cloud with synthetic values
|
||||
pcl::PointCloud<pcl::PointXYZRGBA> cloud;
|
||||
@@ -146,7 +146,7 @@ TEST(Util3dTest, rgbdFromCloudBasicConversion)
|
||||
EXPECT_NEAR(d, 1.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, projectDepthTo3D)
|
||||
TEST(Util3dTest, ProjectDepthTo3D)
|
||||
{
|
||||
// Create a synthetic 5x5 depth image with all values set to 1.0 meter
|
||||
cv::Mat depthImage = cv::Mat::ones(5, 5, CV_32FC1);
|
||||
@@ -171,7 +171,7 @@ TEST(Util3dTest, projectDepthTo3D)
|
||||
EXPECT_FLOAT_EQ(pt.z, 1.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, projectDepthTo3DRayBasicRayProjection)
|
||||
TEST(Util3dTest, ProjectDepthTo3DRayBasicRayProjection)
|
||||
{
|
||||
cv::Size imageSize(640, 480);
|
||||
float fx = 525.0f;
|
||||
@@ -192,7 +192,7 @@ TEST(Util3dTest, projectDepthTo3DRayBasicRayProjection)
|
||||
EXPECT_NEAR(ray[2], 1.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDepthWithCameraModel) {
|
||||
TEST(Util3dTest, CloudFromDepthWithCameraModel) {
|
||||
// Create a sample depth image (CV_32FC1 format)
|
||||
cv::Mat depthImage(4, 4, CV_32FC1);
|
||||
for(int j=0;j<depthImage.rows; ++j)
|
||||
@@ -224,7 +224,7 @@ TEST(Util3dTest, cloudFromDepthWithCameraModel) {
|
||||
ASSERT_FLOAT_EQ(pt.z, 1.0f); // Check depth
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDepthRGBValidInputCreatesPointCloud) {
|
||||
TEST(Util3dTest, CloudFromDepthRGBValidInputCreatesPointCloud) {
|
||||
// Create a simple test depth image (e.g., 5x5)
|
||||
cv::Mat imageRgb = cv::Mat::zeros(5, 5, CV_8UC3); // Black RGB image
|
||||
cv::Mat imageDepth = cv::Mat::ones(5, 5, CV_32FC1); // Depth image with all values 1.0
|
||||
@@ -243,7 +243,7 @@ TEST(Util3dTest, cloudFromDepthRGBValidInputCreatesPointCloud) {
|
||||
ASSERT_EQ(validIndices.size(), cloud->size());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDepthRGBEmptyInput) {
|
||||
TEST(Util3dTest, CloudFromDepthRGBEmptyInput) {
|
||||
cv::Mat imageRgb = cv::Mat(); // Empty RGB image
|
||||
cv::Mat imageDepth = cv::Mat(); // Empty Depth image
|
||||
|
||||
@@ -253,7 +253,7 @@ TEST(Util3dTest, cloudFromDepthRGBEmptyInput) {
|
||||
ASSERT_THROW(util3d::cloudFromDepthRGB(imageRgb, imageDepth, model, 1, 10.0f, 0.1f, &validIndices), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDepthRGBDecimationReducesPointCloudSize) {
|
||||
TEST(Util3dTest, CloudFromDepthRGBDecimationReducesPointCloudSize) {
|
||||
// Create a simple test depth image (e.g., 6x6) and RGB image
|
||||
cv::Mat imageRgb = cv::Mat::zeros(6, 6, CV_8UC3);
|
||||
cv::Mat imageDepth = cv::Mat::ones(6, 6, CV_32FC1);
|
||||
@@ -269,7 +269,7 @@ TEST(Util3dTest, cloudFromDepthRGBDecimationReducesPointCloudSize) {
|
||||
}
|
||||
|
||||
// Test depth constraints: points outside the range should not be included in the cloud
|
||||
TEST(Util3dTest, cloudFromDepthRGBDepthConstraintsLimitPointCloud) {
|
||||
TEST(Util3dTest, CloudFromDepthRGBDepthConstraintsLimitPointCloud) {
|
||||
cv::Mat imageRgb = cv::Mat::zeros(5, 5, CV_8UC3);
|
||||
cv::Mat imageDepth = cv::Mat::ones(5, 5, CV_32FC1) * 0.05f; // Depth values smaller than the minimum
|
||||
|
||||
@@ -283,7 +283,7 @@ TEST(Util3dTest, cloudFromDepthRGBDepthConstraintsLimitPointCloud) {
|
||||
ASSERT_EQ(validIndices.size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDepthRGBImageSizeMismatchThrowsError) {
|
||||
TEST(Util3dTest, CloudFromDepthRGBImageSizeMismatchThrowsError) {
|
||||
cv::Mat imageRgb = cv::Mat::zeros(6, 6, CV_8UC3); // 6x6 RGB image
|
||||
cv::Mat imageDepth = cv::Mat::ones(6, 6, CV_32FC1); // 6x6 Depth image
|
||||
|
||||
@@ -293,7 +293,7 @@ TEST(Util3dTest, cloudFromDepthRGBImageSizeMismatchThrowsError) {
|
||||
ASSERT_THROW(util3d::cloudFromDepthRGB(imageRgb, imageDepth, model, 1, 10.0f, 0.1f, nullptr), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDisparityValidInputs) {
|
||||
TEST(Util3dTest, CloudFromDisparityValidInputs) {
|
||||
cv::Mat imageDisparity = cv::Mat::ones(10, 10, CV_32FC1) * 50.0f; // 50.0 as the disparity value
|
||||
StereoCameraModel model(10, 10, 4.5f, 4.5f, 0.05f, CameraModel::opticalRotation(), imageDisparity.size());
|
||||
|
||||
@@ -321,7 +321,7 @@ TEST(Util3dTest, cloudFromDisparityValidInputs) {
|
||||
ASSERT_EQ(validIndices.size(), imageDisparity.total());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDisparityRGBValidInputs) {
|
||||
TEST(Util3dTest, CloudFromDisparityRGBValidInputs) {
|
||||
cv::Mat imageRgb = cv::Mat(10, 10, CV_8UC3, cv::Scalar(255, 200, 150)); // BGR
|
||||
cv::Mat imageDisparity = cv::Mat::ones(10, 10, CV_32FC1) * 50.0f; // 50.0 as the disparity value
|
||||
StereoCameraModel model(10, 10, 4.5f, 4.5f, 0.05f, CameraModel::opticalRotation(), imageDisparity.size());
|
||||
@@ -350,7 +350,7 @@ TEST(Util3dTest, cloudFromDisparityRGBValidInputs) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDisparityInvalidDecimation) {
|
||||
TEST(Util3dTest, CloudFromDisparityInvalidDecimation) {
|
||||
// Create a mock disparity image (CV_32FC1)
|
||||
cv::Mat imageDisparity = cv::Mat::ones(10, 10, CV_32FC1) * 50.0f;
|
||||
StereoCameraModel model(10, 10, 4.5f, 4.5f, 0.05f, CameraModel::opticalRotation(), imageDisparity.size());
|
||||
@@ -370,13 +370,13 @@ TEST(Util3dTest, cloudFromDisparityInvalidDecimation) {
|
||||
ASSERT_GT(cloud->size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromDisparityEmptyImages) {
|
||||
TEST(Util3dTest, CloudFromDisparityEmptyImages) {
|
||||
// Call the function with empty images
|
||||
ASSERT_THROW(util3d::cloudFromDisparity(cv::Mat(), StereoCameraModel()), UException);
|
||||
ASSERT_THROW(util3d::cloudFromDisparityRGB(cv::Mat(), cv::Mat(), StereoCameraModel()), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromStereoImagesBasicTest) {
|
||||
TEST(Util3dTest, CloudFromStereoImagesBasicTest) {
|
||||
cv::Mat imageLeft = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/stereo_rect/left/50.jpg", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat imageRight = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/stereo_rect/right/50.jpg", cv::IMREAD_GRAYSCALE);
|
||||
|
||||
@@ -440,7 +440,7 @@ TEST(Util3dTest, cloudFromStereoImagesBasicTest) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsFromSensorDataBasicCloudGeneration) {
|
||||
TEST(Util3dTest, CloudsFromSensorDataBasicCloudGeneration) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -475,7 +475,7 @@ TEST(Util3dTest, cloudsFromSensorDataBasicCloudGeneration) {
|
||||
ASSERT_GT(clouds[0]->size(), 0) << "First point cloud is empty";
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsFromSensorDataCloudGenerationWithDecimation) {
|
||||
TEST(Util3dTest, CloudsFromSensorDataCloudGenerationWithDecimation) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -508,7 +508,7 @@ TEST(Util3dTest, cloudsFromSensorDataCloudGenerationWithDecimation) {
|
||||
ASSERT_LT(clouds[0]->size(), 640 * 480) << "Cloud size should be smaller due to decimation";
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsFromSensorDataCloudGenerationWithEmptyImages) {
|
||||
TEST(Util3dTest, CloudsFromSensorDataCloudGenerationWithEmptyImages) {
|
||||
// Create empty sensor data
|
||||
SensorData sensorData;
|
||||
|
||||
@@ -533,7 +533,7 @@ TEST(Util3dTest, cloudsFromSensorDataCloudGenerationWithEmptyImages) {
|
||||
ASSERT_EQ(clouds.size(), 0) << "Expected no point clouds for empty input images";
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudFromSensorDataGeneratesPointCloud) {
|
||||
TEST(Util3dTest, CloudFromSensorDataGeneratesPointCloud) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -568,7 +568,7 @@ TEST(Util3dTest, cloudFromSensorDataGeneratesPointCloud) {
|
||||
ASSERT_GT(validIndices.size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsRGBFromSensorDataTestSingleCamera) {
|
||||
TEST(Util3dTest, CloudsRGBFromSensorDataTestSingleCamera) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -604,7 +604,7 @@ TEST(Util3dTest, cloudsRGBFromSensorDataTestSingleCamera) {
|
||||
ASSERT_GT(validIndices[0]->size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsRGBFromSensorDataTestStereoCameras) {
|
||||
TEST(Util3dTest, CloudsRGBFromSensorDataTestStereoCameras) {
|
||||
cv::Mat imageLeft = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/stereo_rect/left/50.jpg", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat imageRight = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/stereo_rect/right/50.jpg", cv::IMREAD_GRAYSCALE);
|
||||
|
||||
@@ -645,7 +645,7 @@ TEST(Util3dTest, cloudsRGBFromSensorDataTestStereoCameras) {
|
||||
ASSERT_GT(validIndices[0]->size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsRGBFromSensorDataTestEmptySensorData) {
|
||||
TEST(Util3dTest, CloudsRGBFromSensorDataTestEmptySensorData) {
|
||||
SensorData sensorData; // Create empty sensor data (or no data at all)
|
||||
int decimation = 1;
|
||||
float maxDepth = 10.0f;
|
||||
@@ -669,7 +669,7 @@ TEST(Util3dTest, cloudsRGBFromSensorDataTestEmptySensorData) {
|
||||
ASSERT_TRUE(clouds.empty());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudsRGBFromSensorDataTestInvalidROIRatios) {
|
||||
TEST(Util3dTest, CloudsRGBFromSensorDataTestInvalidROIRatios) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -704,7 +704,7 @@ TEST(Util3dTest, cloudsRGBFromSensorDataTestInvalidROIRatios) {
|
||||
ASSERT_GT(validIndices[0]->size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudRGBFromSensorDataGeneratesCloudWithValidData) {
|
||||
TEST(Util3dTest, CloudRGBFromSensorDataGeneratesCloudWithValidData) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -766,7 +766,7 @@ TEST(Util3dTest, cloudRGBFromSensorDataGeneratesCloudWithValidData) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudRGBFromSensorDataHandlesEmptyData) {
|
||||
TEST(Util3dTest, CloudRGBFromSensorDataHandlesEmptyData) {
|
||||
SensorData sensorData;
|
||||
int decimation = 1;
|
||||
float maxDepth = 10.0f;
|
||||
@@ -792,7 +792,7 @@ TEST(Util3dTest, cloudRGBFromSensorDataHandlesEmptyData) {
|
||||
EXPECT_EQ(validIndices.size(), 0); // No valid indices due to empty cloud
|
||||
}
|
||||
|
||||
TEST(Util3dTest, cloudRGBFromSensorDataHandlesInvalidROI) {
|
||||
TEST(Util3dTest, CloudRGBFromSensorDataHandlesInvalidROI) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
cv::Mat rgbImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/rgb/17.jpg", cv::IMREAD_COLOR);
|
||||
|
||||
@@ -827,7 +827,7 @@ TEST(Util3dTest, cloudRGBFromSensorDataHandlesInvalidROI) {
|
||||
EXPECT_GT(validIndices.size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, laserScanFromDepthImage) {
|
||||
TEST(Util3dTest, LaserScanFromDepthImage) {
|
||||
cv::Mat depthImage = cv::imread(std::string(RTABMAP_TEST_DATA_ROOT) + "/rgbd/depth/17.png", cv::IMREAD_UNCHANGED);
|
||||
ASSERT_FALSE(depthImage.empty());
|
||||
|
||||
@@ -856,11 +856,11 @@ TEST(Util3dTest, laserScanFromDepthImage) {
|
||||
cv::Mat(), 0, 0, 0, 0, 0, 0, CameraModel::opticalRotation()), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, laserScanFromDepthImageEmptyDepthImage) {
|
||||
TEST(Util3dTest, LaserScanFromDepthImageEmptyDepthImage) {
|
||||
|
||||
}
|
||||
|
||||
TEST(Util3dTest, laserScanFromDepthImages) {
|
||||
TEST(Util3dTest, LaserScanFromDepthImages) {
|
||||
int width = 640;
|
||||
int height = 480;
|
||||
cv::Mat depthImage(height, width*2, CV_32FC1, cv::Scalar(1.0)); // Depth set to 1.0 for all points
|
||||
@@ -901,7 +901,7 @@ TEST(Util3dTest, laserScanFromDepthImages) {
|
||||
ASSERT_THROW(util3d::laserScanFromDepthImages(cv::Mat(), std::vector<CameraModel>(2),0,0), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, laserScanFromPointCloudXYZ) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudXYZ) {
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud;
|
||||
cloud.push_back(pcl::PointXYZ(1.0f, 2.0f, 3.0f));
|
||||
|
||||
@@ -915,7 +915,7 @@ TEST(Util3dTest, laserScanFromPointCloudXYZ) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZRGB
|
||||
TEST(Util3dTest, laserScanFromPointCloudXYZRGB) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudXYZRGB) {
|
||||
pcl::PointCloud<pcl::PointXYZRGB> cloud;
|
||||
pcl::PointXYZRGB point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -936,7 +936,7 @@ TEST(Util3dTest, laserScanFromPointCloudXYZRGB) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointNormal
|
||||
TEST(Util3dTest, laserScanFromPointCloudNormal) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudNormal) {
|
||||
pcl::PointCloud<pcl::PointNormal> cloud;
|
||||
pcl::PointNormal point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -957,7 +957,7 @@ TEST(Util3dTest, laserScanFromPointCloudNormal) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZI
|
||||
TEST(Util3dTest, laserScanFromPointCloudXYZI) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudXYZI) {
|
||||
pcl::PointCloud<pcl::PointXYZI> cloud;
|
||||
pcl::PointXYZI point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f; point.intensity = 100.0f;
|
||||
@@ -975,7 +975,7 @@ TEST(Util3dTest, laserScanFromPointCloudXYZI) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZRGBNormal
|
||||
TEST(Util3dTest, laserScanFromPointCloudXYZRGBNormal) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudXYZRGBNormal) {
|
||||
pcl::PointCloud<pcl::PointXYZRGBNormal> cloud;
|
||||
pcl::PointXYZRGBNormal point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -1001,7 +1001,7 @@ TEST(Util3dTest, laserScanFromPointCloudXYZRGBNormal) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZINormal
|
||||
TEST(Util3dTest, laserScanFromPointCloudXYZINormal) {
|
||||
TEST(Util3dTest, LaserScanFromPointCloudXYZINormal) {
|
||||
pcl::PointCloud<pcl::PointXYZINormal> cloud;
|
||||
pcl::PointXYZINormal point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -1024,7 +1024,7 @@ TEST(Util3dTest, laserScanFromPointCloudXYZINormal) {
|
||||
EXPECT_FLOAT_EQ(pt.normal_z, 1.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, laserScan2dFromPointCloudXYZ) {
|
||||
TEST(Util3dTest, LaserScan2dFromPointCloudXYZ) {
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud;
|
||||
cloud.push_back(pcl::PointXYZ(1.0f, 2.0f, 3.0f));
|
||||
|
||||
@@ -1039,7 +1039,7 @@ TEST(Util3dTest, laserScan2dFromPointCloudXYZ) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointNormal
|
||||
TEST(Util3dTest, laserScan2dFromPointCloudNormal) {
|
||||
TEST(Util3dTest, LaserScan2dFromPointCloudNormal) {
|
||||
pcl::PointCloud<pcl::PointNormal> cloud;
|
||||
pcl::PointNormal point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -1061,7 +1061,7 @@ TEST(Util3dTest, laserScan2dFromPointCloudNormal) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZI
|
||||
TEST(Util3dTest, laserScan2dFromPointCloudXYZI) {
|
||||
TEST(Util3dTest, LaserScan2dFromPointCloudXYZI) {
|
||||
pcl::PointCloud<pcl::PointXYZI> cloud;
|
||||
pcl::PointXYZI point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f; point.intensity = 100.0f;
|
||||
@@ -1080,7 +1080,7 @@ TEST(Util3dTest, laserScan2dFromPointCloudXYZI) {
|
||||
}
|
||||
|
||||
// Test for pcl::PointXYZINormal
|
||||
TEST(Util3dTest, laserScan2dFromPointCloudXYZINormal) {
|
||||
TEST(Util3dTest, LaserScan2dFromPointCloudXYZINormal) {
|
||||
pcl::PointCloud<pcl::PointXYZINormal> cloud;
|
||||
pcl::PointXYZINormal point;
|
||||
point.x = 1.0f; point.y = 2.0f; point.z = 3.0f;
|
||||
@@ -1109,7 +1109,7 @@ TEST(Util3dTest, laserScan2dFromPointCloudXYZINormal) {
|
||||
|
||||
|
||||
|
||||
TEST(Util3dTest, laserScanToPointCloud)
|
||||
TEST(Util3dTest, LaserScanToPointCloud)
|
||||
{
|
||||
// XYZ point
|
||||
cv::Mat dataXYZ = (cv::Mat_<float>(1, 3) << 1.0f, 2.0f, 3.0f);
|
||||
@@ -1243,7 +1243,7 @@ TEST(Util3dTest, laserScanToPointCloud)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dTest, getMinMax3D) {
|
||||
TEST(Util3dTest, GetMinMax3D) {
|
||||
// Create a 3x3 CV matrix of type CV_32FC3 (3D points)
|
||||
cv::Mat laserScan(1, 3, CV_32FC3);
|
||||
float data[9] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, -1.0f, -2.0f, -3.0f};
|
||||
@@ -1279,7 +1279,7 @@ TEST(Util3dTest, getMinMax3D) {
|
||||
}
|
||||
|
||||
// Test with a laser scan that contains only 2D data (no Z values)
|
||||
TEST(Util3dTest, getMinMax3DCVPoint3f_2DData) {
|
||||
TEST(Util3dTest, GetMinMax3DCVPoint3f2DData) {
|
||||
// Create a 2x3 CV matrix of type CV_32FC2 (2D points)
|
||||
cv::Mat laserScan(1, 2, CV_32FC2);
|
||||
float data[6] = {1.0f, 2.0f, 4.0f, 5.0f}; // No Z values
|
||||
@@ -1300,7 +1300,7 @@ TEST(Util3dTest, getMinMax3DCVPoint3f_2DData) {
|
||||
}
|
||||
|
||||
// Test with a matrix where all points are the same (edge case)
|
||||
TEST(Util3dTest, getMinMax3DSamePoints) {
|
||||
TEST(Util3dTest, GetMinMax3DSamePoints) {
|
||||
// Create a 1x3 CV matrix of type CV_32FC3 where all points are the same
|
||||
cv::Mat laserScan(1, 3, CV_32FC3);
|
||||
float data[9] = {2.0f, 3.0f, 4.0f, 2.0f, 3.0f, 4.0f, 2.0f, 3.0f, 4.0f};
|
||||
@@ -1321,7 +1321,7 @@ TEST(Util3dTest, getMinMax3DSamePoints) {
|
||||
}
|
||||
|
||||
// Test with an empty laser scan (should trigger an error or assertion)
|
||||
TEST(Util3dTest, getMinMax3DEmptyLaserScan) {
|
||||
TEST(Util3dTest, GetMinMax3DEmptyLaserScan) {
|
||||
// Create an empty CV matrix
|
||||
cv::Mat laserScan;
|
||||
|
||||
@@ -1332,7 +1332,7 @@ TEST(Util3dTest, getMinMax3DEmptyLaserScan) {
|
||||
}
|
||||
|
||||
// Test for projectDisparityTo3D with valid disparity
|
||||
TEST(Util3dTest, projectDisparityTo3DValidDisparity) {
|
||||
TEST(Util3dTest, ProjectDisparityTo3DValidDisparity) {
|
||||
StereoCameraModel model(525, 525, 319.5f, 219.5f, 0.05f, CameraModel::opticalRotation(), cv::Size(640,480));
|
||||
|
||||
// Define a 2D point (u, v) in the left image
|
||||
@@ -1350,7 +1350,7 @@ TEST(Util3dTest, projectDisparityTo3DValidDisparity) {
|
||||
}
|
||||
|
||||
// Test for projectDisparityTo3D with invalid disparity (0.0f)
|
||||
TEST(Util3dTest, projectDisparityTo3DInvalidDisparityZero) {
|
||||
TEST(Util3dTest, ProjectDisparityTo3DInvalidDisparityZero) {
|
||||
StereoCameraModel model(525, 525, 319.5f, 219.5f, 0.05f, CameraModel::opticalRotation(), cv::Size(640,480));
|
||||
|
||||
// Define a 2D point (u, v) in the left image
|
||||
@@ -1367,7 +1367,7 @@ TEST(Util3dTest, projectDisparityTo3DInvalidDisparityZero) {
|
||||
}
|
||||
|
||||
// Test for projectDisparityTo3D with disparity map (CV_32FC1 type)
|
||||
TEST(Util3dTest, projectDisparityTo3DDisparityMapValid) {
|
||||
TEST(Util3dTest, ProjectDisparityTo3DDisparityMapValid) {
|
||||
StereoCameraModel model(525, 525, 319.5f, 219.5f, 0.05f, CameraModel::opticalRotation(), cv::Size(640,480));
|
||||
|
||||
// Create a sample disparity map (1 channel, float type)
|
||||
@@ -1387,7 +1387,7 @@ TEST(Util3dTest, projectDisparityTo3DDisparityMapValid) {
|
||||
}
|
||||
|
||||
// Test for projectDisparityTo3D with disparity map out of bounds (invalid pixel)
|
||||
TEST(Util3dTest, projectDisparityTo3DDisparityMapOutOfBounds) {
|
||||
TEST(Util3dTest, ProjectDisparityTo3DDisparityMapOutOfBounds) {
|
||||
StereoCameraModel model(525, 525, 319.5f, 219.5f, 0.05f, CameraModel::opticalRotation(), cv::Size(640,480));
|
||||
|
||||
// Create a sample disparity map (1 channel, float type)
|
||||
@@ -1406,7 +1406,7 @@ TEST(Util3dTest, projectDisparityTo3DDisparityMapOutOfBounds) {
|
||||
}
|
||||
|
||||
// Test for projectDisparityTo3D with invalid disparity map type
|
||||
TEST(Util3dTest, projectDisparityTo3DInvalidDisparityMapType) {
|
||||
TEST(Util3dTest, ProjectDisparityTo3DInvalidDisparityMapType) {
|
||||
StereoCameraModel model(525, 525, 319.5f, 219.5f, 0.05f, CameraModel::opticalRotation(), cv::Size(640,480));
|
||||
|
||||
// Create a sample disparity map with invalid type (CV_8UC1)
|
||||
@@ -1419,7 +1419,7 @@ TEST(Util3dTest, projectDisparityTo3DInvalidDisparityMapType) {
|
||||
ASSERT_THROW(util3d::projectDisparityTo3D(pt, disparity_map, model), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, projectCloudToCameraCvMatLaserScan) {
|
||||
TEST(Util3dTest, ProjectCloudToCameraCvMatLaserScan) {
|
||||
// Mock image size
|
||||
cv::Size imageSize(640, 480);
|
||||
|
||||
@@ -1448,7 +1448,7 @@ TEST(Util3dTest, projectCloudToCameraCvMatLaserScan) {
|
||||
}
|
||||
|
||||
// Test for projectCloudToCamera with pcl::PointCloud<pcl::PointXYZ>
|
||||
TEST(Util3dTest, projectCloudToCameraPclPointCloud) {
|
||||
TEST(Util3dTest, ProjectCloudToCameraPclPointCloud) {
|
||||
// Mock image size
|
||||
cv::Size imageSize(640, 480);
|
||||
|
||||
@@ -1483,7 +1483,7 @@ TEST(Util3dTest, projectCloudToCameraPclPointCloud) {
|
||||
}
|
||||
|
||||
// Test for projectCloudToCamera with pcl::PCLPointCloud2
|
||||
TEST(Util3dTest, projectCloudToCameraPCLPointCloud2) {
|
||||
TEST(Util3dTest, ProjectCloudToCameraPCLPointCloud2) {
|
||||
// Mock image size
|
||||
cv::Size imageSize(640, 480);
|
||||
|
||||
@@ -1544,7 +1544,7 @@ cv::Mat createTestDepthImage(int rows, int cols) {
|
||||
return depthImage;
|
||||
}
|
||||
|
||||
TEST(Util3dTest, fillProjectedCloudHolesFillTest) {
|
||||
TEST(Util3dTest, FillProjectedCloudHolesFillTest) {
|
||||
cv::Mat depthImage = cv::Mat::zeros(10, 10, CV_32FC1);
|
||||
depthImage.at<float>(2, 3) = 10.0f;
|
||||
depthImage.at<float>(4, 3) = 10.0f;
|
||||
@@ -1592,7 +1592,7 @@ TEST(Util3dTest, fillProjectedCloudHolesFillTest) {
|
||||
ASSERT_EQ(cv::mean(depthImage), cv::Scalar(1.0f));
|
||||
}
|
||||
|
||||
TEST(Util3dTest, filterFloorThreshold) {
|
||||
TEST(Util3dTest, FilterFloorThreshold) {
|
||||
// Setup: Create a synthetic depth image and CameraModel
|
||||
cv::Mat depth = cv::Mat::zeros(4, 4, CV_16UC1);
|
||||
depth.at<unsigned short>(1, 1) = 1000;
|
||||
@@ -1623,7 +1623,7 @@ TEST(Util3dTest, filterFloorThreshold) {
|
||||
EXPECT_EQ(filteredDepth.at<unsigned short>(3, 3), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, filterFloorEmptyDepthImage) {
|
||||
TEST(Util3dTest, FilterFloorEmptyDepthImage) {
|
||||
// Test case with empty depth image
|
||||
cv::Mat emptyDepth = cv::Mat::zeros(0, 0, CV_16UC1);
|
||||
std::vector<CameraModel> cameraModels;
|
||||
@@ -1637,7 +1637,7 @@ TEST(Util3dTest, filterFloorEmptyDepthImage) {
|
||||
EXPECT_TRUE(depthBelow.empty());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, projectCloudToCameras) {
|
||||
TEST(Util3dTest, ProjectCloudToCameras) {
|
||||
|
||||
// Create mock point cloud
|
||||
pcl::PointCloud<pcl::PointXYZRGBNormal> cloud;
|
||||
@@ -1739,7 +1739,7 @@ TEST(Util3dTest, projectCloudToCameras) {
|
||||
EXPECT_EQ(result[4].first.first, 0); // Camera node ID (not found = 0)
|
||||
}
|
||||
|
||||
TEST(Util3dTest, isFinite) {
|
||||
TEST(Util3dTest, IsFinite) {
|
||||
cv::Point3f pt1(1.0f, 2.0f, 3.0f);
|
||||
EXPECT_TRUE(util3d::isFinite(pt1));
|
||||
|
||||
@@ -1753,7 +1753,7 @@ TEST(Util3dTest, isFinite) {
|
||||
EXPECT_FALSE(util3d::isFinite(pt4));
|
||||
}
|
||||
|
||||
TEST(Util3dTest, concatenateCloudsXYZ)
|
||||
TEST(Util3dTest, ConcatenateCloudsXYZ)
|
||||
{
|
||||
std::list<pcl::PointCloud<pcl::PointXYZ>::Ptr> cloudList;
|
||||
|
||||
@@ -1774,7 +1774,7 @@ TEST(Util3dTest, concatenateCloudsXYZ)
|
||||
EXPECT_EQ(result->at(2).z, 9);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, concatenateCloudsXYZRGB)
|
||||
TEST(Util3dTest, ConcatenateCloudsXYZRGB)
|
||||
{
|
||||
std::list<pcl::PointCloud<pcl::PointXYZRGB>::Ptr> cloudList;
|
||||
|
||||
@@ -1800,7 +1800,7 @@ TEST(Util3dTest, concatenateCloudsXYZRGB)
|
||||
}
|
||||
|
||||
|
||||
TEST(Util3dTest, concatenateIndices)
|
||||
TEST(Util3dTest, ConcatenateIndices)
|
||||
{
|
||||
pcl::IndicesPtr indices1(new std::vector<int>({1, 2}));
|
||||
pcl::IndicesPtr indices2(new std::vector<int>({3, 4}));
|
||||
@@ -1827,7 +1827,7 @@ TEST(Util3dTest, concatenateIndices)
|
||||
EXPECT_EQ((*result)[2], 30);
|
||||
}
|
||||
|
||||
TEST(Util3dTest, savePCDWordsFromPCLPoints) {
|
||||
TEST(Util3dTest, SavePCDWordsFromPCLPoints) {
|
||||
std::multimap<int, pcl::PointXYZ> words;
|
||||
words.insert({0, pcl::PointXYZ(1, 2, 3)});
|
||||
words.insert({1, pcl::PointXYZ(4, 5, 6)});
|
||||
@@ -1845,7 +1845,7 @@ TEST(Util3dTest, savePCDWordsFromPCLPoints) {
|
||||
std::remove(file.c_str());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, savePCDWordsFromCVPoints) {
|
||||
TEST(Util3dTest, SavePCDWordsFromCVPoints) {
|
||||
std::multimap<int, cv::Point3f> words;
|
||||
words.insert({0, cv::Point3f(1, 0, 0)});
|
||||
words.insert({1, cv::Point3f(0, 1, 0)});
|
||||
@@ -1865,7 +1865,7 @@ TEST(Util3dTest, savePCDWordsFromCVPoints) {
|
||||
std::remove(file.c_str());
|
||||
}
|
||||
|
||||
TEST(Util3dTest, loadBINScanValid) {
|
||||
TEST(Util3dTest, LoadBINScanValid) {
|
||||
std::string tmp_file = "test.bin";
|
||||
std::ofstream file(tmp_file, std::ios::binary);
|
||||
pcl::PointCloud<pcl::PointXYZI> cloud;
|
||||
@@ -1905,7 +1905,7 @@ TEST(Util3dTest, loadBINScanValid) {
|
||||
std::remove(tmp_file.c_str()); // Clean up the test file
|
||||
}
|
||||
|
||||
TEST(Util3dTest, loadBINScanEmpty) {
|
||||
TEST(Util3dTest, LoadBINScanEmpty) {
|
||||
std::string tmp_file = "empty_test.bin";
|
||||
std::ofstream(tmp_file, std::ios::binary).close(); // Create empty file
|
||||
|
||||
@@ -1918,7 +1918,7 @@ TEST(Util3dTest, loadBINScanEmpty) {
|
||||
}
|
||||
|
||||
// Test case to check loading a binary scan
|
||||
TEST(Util3dTest, loadScanBINFile) {
|
||||
TEST(Util3dTest, LoadScanBINFile) {
|
||||
std::string tmp_file = "test.bin";
|
||||
std::ofstream file(tmp_file, std::ios::binary);
|
||||
pcl::PointCloud<pcl::PointXYZI> cloud;
|
||||
@@ -1961,7 +1961,7 @@ TEST(Util3dTest, loadScanBINFile) {
|
||||
}
|
||||
|
||||
// Test case to check loading a PCD file
|
||||
TEST(Util3dTest, loadScanPCDFile) {
|
||||
TEST(Util3dTest, LoadScanPCDFile) {
|
||||
std::string tmp_file = "test.pcd";
|
||||
|
||||
// Create a dummy PCD file
|
||||
@@ -1992,7 +1992,7 @@ TEST(Util3dTest, loadScanPCDFile) {
|
||||
}
|
||||
|
||||
// Test case to check loading a PLY file
|
||||
TEST(Util3dTest, loadScanPLYFile) {
|
||||
TEST(Util3dTest, LoadScanPLYFile) {
|
||||
std::string tmp_file = "test.ply";
|
||||
|
||||
// Create a dummy PLY file
|
||||
@@ -2021,7 +2021,7 @@ TEST(Util3dTest, loadScanPLYFile) {
|
||||
std::remove(tmp_file.c_str()); // Clean up the test file
|
||||
}
|
||||
|
||||
TEST(Util3dTest, deskewValidScan) {
|
||||
TEST(Util3dTest, DeskewValidScan) {
|
||||
// Prepare mock LaserScan data (simulating a 3x3 point cloud with time info)
|
||||
cv::Mat mockData = cv::Mat::zeros(1, 3, CV_32FC(5));
|
||||
float * dataPtr = (float*)mockData.data;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesValidOneToOneMatch) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesValidOneToOneMatch) {
|
||||
std::multimap<int, pcl::PointXYZ> words1 = {
|
||||
{1, pcl::PointXYZ(1, 2, 3)},
|
||||
{2, pcl::PointXYZ(4, 5, 6)}
|
||||
@@ -27,7 +27,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesValidOneToOneMatch) {
|
||||
EXPECT_EQ(cloud2.points[1].z, 6.1f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesDuplicateKeysIgnored) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesDuplicateKeysIgnored) {
|
||||
std::multimap<int, pcl::PointXYZ> words1 = {
|
||||
{1, pcl::PointXYZ(0, 0, 0)},
|
||||
{1, pcl::PointXYZ(1, 1, 1)}, // duplicate
|
||||
@@ -47,7 +47,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesDuplicateKeysIgnored) {
|
||||
EXPECT_EQ(cloud2[0].z, 2.1f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesInvalidPointsIgnored) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesInvalidPointsIgnored) {
|
||||
pcl::PointXYZ nanPt(std::numeric_limits<float>::quiet_NaN(), 0, 0);
|
||||
std::multimap<int, pcl::PointXYZ> words1 = {
|
||||
{1, pcl::PointXYZ(1, 2, 3)},
|
||||
@@ -67,7 +67,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesInvalidPointsIgnored) {
|
||||
EXPECT_EQ(cloud2[0].y, 2.5f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesNoCommonIDs) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesNoCommonIDs) {
|
||||
std::multimap<int, pcl::PointXYZ> words1 = {
|
||||
{10, pcl::PointXYZ(1, 2, 3)}
|
||||
};
|
||||
@@ -82,7 +82,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesNoCommonIDs) {
|
||||
EXPECT_TRUE(cloud2.empty());
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACAcceptsCleanMatches) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesRANSACAcceptsCleanMatches) {
|
||||
std::multimap<int, pcl::PointXYZ> words1;
|
||||
std::multimap<int, pcl::PointXYZ> words2;
|
||||
|
||||
@@ -99,7 +99,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACAcceptsCleanMatches)
|
||||
EXPECT_GE(cloud1.size(), 8); // At least 8 inliers from 10 consistent matches
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACRejectsOutliers) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesRANSACRejectsOutliers) {
|
||||
std::multimap<int, pcl::PointXYZ> words1;
|
||||
std::multimap<int, pcl::PointXYZ> words2;
|
||||
|
||||
@@ -122,7 +122,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACRejectsOutliers) {
|
||||
EXPECT_EQ(cloud1.size(), 8); // RANSAC should reject 2 outliers
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACFailsGracefullyOnTooFewMatches) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesRANSACFailsGracefullyOnTooFewMatches) {
|
||||
std::multimap<int, pcl::PointXYZ> words1 = {
|
||||
{1, pcl::PointXYZ(0, 0, 0)},
|
||||
{2, pcl::PointXYZ(1, 1, 1)},
|
||||
@@ -142,7 +142,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesRANSACFailsGracefullyOnTooF
|
||||
EXPECT_TRUE(cloud2.empty());
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesValidCorrespondencesAreExtracted) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesValidCorrespondencesAreExtracted) {
|
||||
// Create simple 5x5 depth images with valid depth
|
||||
cv::Mat depth1 = cv::Mat::ones(5, 5, CV_32FC1) * 1.0f;
|
||||
cv::Mat depth2 = cv::Mat::ones(5, 5, CV_32FC1) * 1.5f;
|
||||
@@ -166,7 +166,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesValidCorrespondencesAreExtr
|
||||
EXPECT_FLOAT_EQ(cloud2[0].z, 1.5f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesFiltersInvalidDepth) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesFiltersInvalidDepth) {
|
||||
cv::Mat depth1 = cv::Mat::ones(5, 5, CV_32FC1) * 1.0f;
|
||||
cv::Mat depth2 = cv::Mat::ones(5, 5, CV_32FC1) * 1.5f;
|
||||
depth1.at<float>(2, 2) = 0.0f; // Invalid
|
||||
@@ -189,7 +189,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesFiltersInvalidDepth) {
|
||||
EXPECT_FLOAT_EQ(cloud2[0].z, 1.5f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesRespectsMaxDepthConstraint) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesRespectsMaxDepthConstraint) {
|
||||
cv::Mat depth1 = cv::Mat::ones(5, 5, CV_32FC1) * 3.0f; // Exceeds maxDepth
|
||||
cv::Mat depth2 = cv::Mat::ones(5, 5, CV_32FC1) * 1.0f;
|
||||
|
||||
@@ -207,7 +207,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesRespectsMaxDepthConstraint)
|
||||
EXPECT_TRUE(cloud2.empty());
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesOrgCloudsValidCorrespondencesAreExtracted) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesOrgCloudsValidCorrespondencesAreExtracted) {
|
||||
int width = 5, height = 5;
|
||||
|
||||
// Create two organized point clouds
|
||||
@@ -251,7 +251,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesOrgCloudsValidCorrespondenc
|
||||
EXPECT_FLOAT_EQ(inliers2[0].z, 1.5f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, extractXYZCorrespondencesOrgCloudsInvalidPointsAreFilteredOut) {
|
||||
TEST(Util3dCorrespondencesTest, ExtractXYZCorrespondencesOrgCloudsInvalidPointsAreFilteredOut) {
|
||||
int width = 3, height = 3;
|
||||
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1, cloud2;
|
||||
@@ -292,7 +292,7 @@ TEST(Util3dCorrespondences, extractXYZCorrespondencesOrgCloudsInvalidPointsAreFi
|
||||
EXPECT_FLOAT_EQ(inliers2[0].x, 2.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, countUniquePairsNoPairs) {
|
||||
TEST(Util3dCorrespondencesTest, CountUniquePairsNoPairs) {
|
||||
std::multimap<int, pcl::PointXYZ> wordsA, wordsB;
|
||||
|
||||
wordsA.insert({1, pcl::PointXYZ(1, 2, 3)});
|
||||
@@ -301,7 +301,7 @@ TEST(Util3dCorrespondences, countUniquePairsNoPairs) {
|
||||
EXPECT_EQ(util3d::countUniquePairs(wordsA, wordsB), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, countUniquePairsOneUniquePair) {
|
||||
TEST(Util3dCorrespondencesTest, CountUniquePairsOneUniquePair) {
|
||||
std::multimap<int, pcl::PointXYZ> wordsA, wordsB;
|
||||
|
||||
wordsA.insert({1, pcl::PointXYZ(1, 1, 1)});
|
||||
@@ -310,7 +310,7 @@ TEST(Util3dCorrespondences, countUniquePairsOneUniquePair) {
|
||||
EXPECT_EQ(util3d::countUniquePairs(wordsA, wordsB), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, countUniquePairsMultipleUniquePairs) {
|
||||
TEST(Util3dCorrespondencesTest, CountUniquePairsMultipleUniquePairs) {
|
||||
std::multimap<int, pcl::PointXYZ> wordsA, wordsB;
|
||||
|
||||
wordsA.insert({1, pcl::PointXYZ(1, 1, 1)});
|
||||
@@ -324,7 +324,7 @@ TEST(Util3dCorrespondences, countUniquePairsMultipleUniquePairs) {
|
||||
EXPECT_EQ(util3d::countUniquePairs(wordsA, wordsB), 3);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, countUniquePairsDuplicatedPointsNotCounted) {
|
||||
TEST(Util3dCorrespondencesTest, CountUniquePairsDuplicatedPointsNotCounted) {
|
||||
std::multimap<int, pcl::PointXYZ> wordsA, wordsB;
|
||||
|
||||
wordsA.insert({1, pcl::PointXYZ(1, 1, 1)});
|
||||
@@ -343,7 +343,7 @@ TEST(Util3dCorrespondences, countUniquePairsDuplicatedPointsNotCounted) {
|
||||
EXPECT_EQ(util3d::countUniquePairs(wordsA, wordsB), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, filterMaxDepthFiltersByMaxDepthZ) {
|
||||
TEST(Util3dCorrespondencesTest, FilterMaxDepthFiltersByMaxDepthZ) {
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1;
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud2;
|
||||
|
||||
@@ -366,7 +366,7 @@ TEST(Util3dCorrespondences, filterMaxDepthFiltersByMaxDepthZ) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, filterMaxDepthRemovesDuplicates) {
|
||||
TEST(Util3dCorrespondencesTest, FilterMaxDepthRemovesDuplicates) {
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1;
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud2;
|
||||
|
||||
@@ -394,7 +394,7 @@ TEST(Util3dCorrespondences, filterMaxDepthRemovesDuplicates) {
|
||||
EXPECT_EQ(countPoint, 1);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, findCorrespondencesBasicMatching)
|
||||
TEST(Util3dCorrespondencesTest, FindCorrespondencesBasicMatching)
|
||||
{
|
||||
std::multimap<int, cv::KeyPoint> wordsA, wordsB;
|
||||
std::list<std::pair<cv::Point2f, cv::Point2f>> pairs;
|
||||
@@ -417,7 +417,7 @@ TEST(Util3dCorrespondences, findCorrespondencesBasicMatching)
|
||||
EXPECT_EQ(pairs.front().second, cv::Point2f(20.5f, 20.5f));
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, findCorrespondencesMatchesWithDepthCheck)
|
||||
TEST(Util3dCorrespondencesTest, FindCorrespondencesMatchesWithDepthCheck)
|
||||
{
|
||||
std::multimap<int, cv::Point3f> words1, words2;
|
||||
std::vector<cv::Point3f> inliers1, inliers2;
|
||||
@@ -444,7 +444,7 @@ TEST(Util3dCorrespondences, findCorrespondencesMatchesWithDepthCheck)
|
||||
EXPECT_EQ(correspondences[1], 2);
|
||||
}
|
||||
|
||||
TEST(Util3dCorrespondences, findCorrespondencesMatchesWithMaxDepth)
|
||||
TEST(Util3dCorrespondencesTest, FindCorrespondencesMatchesWithMaxDepth)
|
||||
{
|
||||
std::map<int, cv::Point3f> words1, words2;
|
||||
std::vector<cv::Point3f> inliers1, inliers2;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DDepthBasicProjection) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DDepthBasicProjection) {
|
||||
// Arrange
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(10.0f, 10.0f, 1.0f),
|
||||
@@ -50,7 +50,7 @@ TEST(Util3dFeatures, generateKeypoints3DDepthBasicProjection) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DDepthMultiCameras) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DDepthMultiCameras) {
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(15.0f, 15.0f, 1.0f),
|
||||
cv::KeyPoint(45.0f, 15.0f, 1.0f),
|
||||
@@ -86,7 +86,7 @@ TEST(Util3dFeatures, generateKeypoints3DDepthMultiCameras) {
|
||||
EXPECT_NEAR(keypoints3d[3].x, -2.0f, 1e-5);
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DDisparityValidDisparity) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DDisparityValidDisparity) {
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(5.0f, 5.0f, 1.0f),
|
||||
cv::KeyPoint(10.0f, 10.0f, 1.0f)
|
||||
@@ -109,7 +109,7 @@ TEST(Util3dFeatures, generateKeypoints3DDisparityValidDisparity) {
|
||||
EXPECT_NEAR(keypoints3D[1].z, 1.0f, 1e-4);
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DDisparityInvalidDisparityReturnsNaN) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DDisparityInvalidDisparityReturnsNaN) {
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(5.0f, 5.0f, 1.0f),
|
||||
cv::KeyPoint(10.0f, 10.0f, 1.0f)
|
||||
@@ -130,7 +130,7 @@ TEST(Util3dFeatures, generateKeypoints3DDisparityInvalidDisparityReturnsNaN) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DDisparityDepthClipping) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DDisparityDepthClipping) {
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(5.0f, 5.0f, 1.0f), // z = 2.0
|
||||
cv::KeyPoint(10.0f, 10.0f, 1.0f) // z = 0.5
|
||||
@@ -152,7 +152,7 @@ TEST(Util3dFeatures, generateKeypoints3DDisparityDepthClipping) {
|
||||
EXPECT_NEAR(keypoints3D[0].z, 2.0f, 1e-4); // z = 2.0, should be valid
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DStereoValidPointsWithDepthFilter) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DStereoValidPointsWithDepthFilter) {
|
||||
std::vector<cv::Point2f> leftCorners = {
|
||||
{100.0f, 100.0f},
|
||||
{120.0f, 120.0f}
|
||||
@@ -178,7 +178,7 @@ TEST(Util3dFeatures, generateKeypoints3DStereoValidPointsWithDepthFilter) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DStereoInvalidDisparityResultsInNaN) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DStereoInvalidDisparityResultsInNaN) {
|
||||
std::vector<cv::Point2f> leftCorners = {
|
||||
{100.0f, 100.0f}
|
||||
};
|
||||
@@ -197,7 +197,7 @@ TEST(Util3dFeatures, generateKeypoints3DStereoInvalidDisparityResultsInNaN) {
|
||||
EXPECT_TRUE(std::isnan(result[0].z));
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DStereoAppliesMaskCorrectly) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DStereoAppliesMaskCorrectly) {
|
||||
std::vector<cv::Point2f> leftCorners = {
|
||||
{100.0f, 100.0f},
|
||||
{120.0f, 120.0f}
|
||||
@@ -217,7 +217,7 @@ TEST(Util3dFeatures, generateKeypoints3DStereoAppliesMaskCorrectly) {
|
||||
EXPECT_TRUE(util3d::isFinite(result[1]));
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, generateKeypoints3DStereoOutOfRangeDepthResultsInNaN) {
|
||||
TEST(Util3dFeaturesTest, GenerateKeypoints3DStereoOutOfRangeDepthResultsInNaN) {
|
||||
std::vector<cv::Point2f> leftCorners = {
|
||||
{100.0f, 100.0f}
|
||||
};
|
||||
@@ -234,7 +234,7 @@ TEST(Util3dFeatures, generateKeypoints3DStereoOutOfRangeDepthResultsInNaN) {
|
||||
EXPECT_TRUE(std::isnan(result[0].x));
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, aggregateBasicAggregation) {
|
||||
TEST(Util3dFeaturesTest, AggregateBasicAggregation) {
|
||||
std::list<int> wordIds = {101, 102, 103};
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(10.0f, 20.0f, 1.0f),
|
||||
@@ -255,7 +255,7 @@ TEST(Util3dFeatures, aggregateBasicAggregation) {
|
||||
EXPECT_FLOAT_EQ(it->second.pt.x, 50.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, aggregateHandlesDuplicateWordIds) {
|
||||
TEST(Util3dFeaturesTest, AggregateHandlesDuplicateWordIds) {
|
||||
std::list<int> wordIds = {200, 201, 200};
|
||||
std::vector<cv::KeyPoint> keypoints = {
|
||||
cv::KeyPoint(1.0f, 2.0f, 1.0f),
|
||||
@@ -277,7 +277,7 @@ TEST(Util3dFeatures, aggregateHandlesDuplicateWordIds) {
|
||||
EXPECT_EQ(x_values[1], 5.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dFeatures, aggregateEmptyInputReturnsEmptyMapOrInvalid) {
|
||||
TEST(Util3dFeaturesTest, AggregateEmptyInputReturnsEmptyMapOrInvalid) {
|
||||
std::list<int> wordIds;
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringEmpty) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringEmpty) {
|
||||
ASSERT_TRUE(util3d::commonFiltering(LaserScan(), 1).isEmpty());
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringDownsample) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringDownsample) {
|
||||
for(int i=0; i<6; ++i)
|
||||
{
|
||||
// Dense
|
||||
@@ -49,7 +49,7 @@ TEST(Util3dFiltering, commonFilteringDownsample) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringRange) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringRange) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 5, CV_32FC3);
|
||||
for(int i=0; i<(int)data.total(); ++i)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ TEST(Util3dFiltering, commonFilteringRange) {
|
||||
ASSERT_EQ(util3d::commonFiltering(scan, 1, 2.5f, 0.5f).size(), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringVoxel) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringVoxel) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 5, CV_32FC3);
|
||||
data.at<cv::Vec3f>(0, 0)[0] = 0.1;
|
||||
data.at<cv::Vec3f>(0, 1)[0] = 0.11;
|
||||
@@ -78,7 +78,7 @@ TEST(Util3dFiltering, commonFilteringVoxel) {
|
||||
ASSERT_EQ(util3d::commonFiltering(scan, 1, 0.0f, 0.0f, 1).size(), 2);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormal) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormal) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC3);
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -109,7 +109,7 @@ TEST(Util3dFiltering, commonFilteringNormal) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormalRGB) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormalRGB) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC4);
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -145,7 +145,7 @@ TEST(Util3dFiltering, commonFilteringNormalRGB) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormalI) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormalI) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC4);
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -181,7 +181,7 @@ TEST(Util3dFiltering, commonFilteringNormalI) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormalVoxel) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormalVoxel) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC(6));
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -242,7 +242,7 @@ TEST(Util3dFiltering, commonFilteringNormalVoxel) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormalVoxelRGB) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormalVoxelRGB) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC(7));
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -313,7 +313,7 @@ TEST(Util3dFiltering, commonFilteringNormalVoxelRGB) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringNormalVoxelI) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringNormalVoxelI) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 100, CV_32FC(7));
|
||||
// make points all on same plane (0,1,0);
|
||||
for(int i=0; i<10; ++i) {
|
||||
@@ -384,7 +384,7 @@ TEST(Util3dFiltering, commonFilteringNormalVoxelI) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, commonFilteringGroundNormalsUp) {
|
||||
TEST(Util3dFilteringTest, CommonFilteringGroundNormalsUp) {
|
||||
cv::Mat data = cv::Mat::zeros(1, 6, CV_32FC(6));
|
||||
data.at<cv::Vec6f>(0,0)[5] = 1; // nz
|
||||
|
||||
@@ -419,14 +419,14 @@ TEST(Util3dFiltering, commonFilteringGroundNormalsUp) {
|
||||
EXPECT_FLOAT_EQ(result.field(5, nz), -sin(M_PI/4));
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringNoFilteringAppliedWhenEmpty)
|
||||
TEST(Util3dFilteringTest, RangeFilteringNoFilteringAppliedWhenEmpty)
|
||||
{
|
||||
LaserScan emptyScan; // Assuming default constructor gives empty scan
|
||||
LaserScan result = util3d::rangeFiltering(emptyScan, 1.0f, 5.0f);
|
||||
EXPECT_TRUE(result.isEmpty());
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringNoFilteringWhenMinMaxZero)
|
||||
TEST(Util3dFilteringTest, RangeFilteringNoFilteringWhenMinMaxZero)
|
||||
{
|
||||
// Simulate a simple 2D scan with 3 points: (1,0), (3,0), (6,0)
|
||||
cv::Mat data = (cv::Mat_<float>(1, 3*2) << 1.0f, 0.0f, 3.0f, 0.0f, 6.0f, 0.0f);
|
||||
@@ -441,7 +441,7 @@ TEST(Util3dFiltering, rangeFilteringNoFilteringWhenMinMaxZero)
|
||||
EXPECT_EQ(result.data().at<cv::Vec2f>(0,2), scan.data().at<cv::Vec2f>(0,2));
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringFilteringRemovesOutOfRangePoints)
|
||||
TEST(Util3dFilteringTest, RangeFilteringFilteringRemovesOutOfRangePoints)
|
||||
{
|
||||
// 2D points: (1,0) [1m], (3,0) [3m], (6,0) [6m]
|
||||
cv::Mat data = (cv::Mat_<float>(1, 3*2) << 1.0f, 0.0f, 3.0f, 0.0f, 6.0f, 0.0f);
|
||||
@@ -467,7 +467,7 @@ TEST(Util3dFiltering, rangeFilteringFilteringRemovesOutOfRangePoints)
|
||||
EXPECT_FLOAT_EQ(result.data().at<cv::Vec3f>(0)[2], 3.0f); // z
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringFilteringWithOnlyMinOrMax)
|
||||
TEST(Util3dFilteringTest, RangeFilteringFilteringWithOnlyMinOrMax)
|
||||
{
|
||||
// 2D points: (1,0) [1m], (4,0) [4m]
|
||||
cv::Mat data = (cv::Mat_<float>(1, 2*2) << 1.0f, 0.0f, 4.0f, 0.0f);
|
||||
@@ -486,7 +486,7 @@ TEST(Util3dFiltering, rangeFilteringFilteringWithOnlyMinOrMax)
|
||||
EXPECT_FLOAT_EQ(resultMax.data().at<float>(0, 0), 1.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringPointXYZ) {
|
||||
TEST(Util3dFilteringTest, RangeFilteringPointXYZ) {
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(1, 0, 0)); // Distance: 1
|
||||
cloud->push_back(pcl::PointXYZ(3, 0, 0)); // Distance: 3
|
||||
@@ -499,7 +499,7 @@ TEST(Util3dFiltering, rangeFilteringPointXYZ) {
|
||||
EXPECT_EQ(filtered->at(0), 1); // Only point at index 1 is within range
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringPointXYZRGB) {
|
||||
TEST(Util3dFilteringTest, RangeFilteringPointXYZRGB) {
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||
cloud->push_back(pcl::PointXYZRGB()); cloud->back().x = 2; cloud->back().y = 0; cloud->back().z = 0; // Distance: 2
|
||||
cloud->push_back(pcl::PointXYZRGB()); cloud->back().x = 4; cloud->back().y = 0; cloud->back().z = 0; // Distance: 4
|
||||
@@ -513,7 +513,7 @@ TEST(Util3dFiltering, rangeFilteringPointXYZRGB) {
|
||||
EXPECT_EQ(filtered->at(0), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringPointNormal) {
|
||||
TEST(Util3dFilteringTest, RangeFilteringPointNormal) {
|
||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointNormal>);
|
||||
cloud->push_back(pcl::PointNormal()); cloud->back().x = 1.0f; // Distance: 1
|
||||
cloud->push_back(pcl::PointNormal()); cloud->back().x = 10.0f; // Distance: 10
|
||||
@@ -524,7 +524,7 @@ TEST(Util3dFiltering, rangeFilteringPointNormal) {
|
||||
EXPECT_EQ(filtered->at(0), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeFilteringPointXYZRGBNormal) {
|
||||
TEST(Util3dFilteringTest, RangeFilteringPointXYZRGBNormal) {
|
||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||
pcl::PointXYZRGBNormal pt1; pt1.x = 0.5f; pt1.y = 0; pt1.z = 0; // Distance: 0.5
|
||||
pcl::PointXYZRGBNormal pt2; pt2.x = 2.5f; pt2.y = 0; pt2.z = 0; // Distance: 2.5
|
||||
@@ -537,7 +537,7 @@ TEST(Util3dFiltering, rangeFilteringPointXYZRGBNormal) {
|
||||
EXPECT_EQ(filtered->at(0), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeSplitFilteringPointXYZ)
|
||||
TEST(Util3dFilteringTest, RangeSplitFilteringPointXYZ)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(1, 0, 0)); // dist = 1
|
||||
@@ -566,7 +566,7 @@ TEST(Util3dFiltering, rangeSplitFilteringPointXYZ)
|
||||
EXPECT_EQ(farIndices->at(0), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeSplitFilteringPointXYZRGB)
|
||||
TEST(Util3dFilteringTest, RangeSplitFilteringPointXYZRGB)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZRGB>::Ptr(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||
pcl::PointXYZRGB pt1, pt2;
|
||||
@@ -594,7 +594,7 @@ TEST(Util3dFiltering, rangeSplitFilteringPointXYZRGB)
|
||||
EXPECT_EQ(farIndices->at(0), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeSplitFilteringPointNormal)
|
||||
TEST(Util3dFilteringTest, RangeSplitFilteringPointNormal)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>);
|
||||
pcl::PointNormal pt1, pt2;
|
||||
@@ -622,7 +622,7 @@ TEST(Util3dFiltering, rangeSplitFilteringPointNormal)
|
||||
EXPECT_EQ(farIndices->at(0), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, rangeSplitFilteringPointXYZRGBNormal)
|
||||
TEST(Util3dFilteringTest, RangeSplitFilteringPointXYZRGBNormal)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||
pcl::PointXYZRGBNormal pt1, pt2;
|
||||
@@ -650,7 +650,7 @@ TEST(Util3dFiltering, rangeSplitFilteringPointXYZRGBNormal)
|
||||
EXPECT_EQ(farIndices->at(0), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplUnorganizedCloud) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplUnorganizedCloud) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
// Create 10 points along X axis
|
||||
@@ -685,7 +685,7 @@ TEST(Util3dFiltering, downsampleImplUnorganizedCloud) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplStepLargerThanCloudSize) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplStepLargerThanCloudSize) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
for (int i = 0; i < 5; ++i)
|
||||
cloud->push_back(pcl::PointXYZ(float(i), 0, 0));
|
||||
@@ -709,7 +709,7 @@ TEST(Util3dFiltering, downsampleImplStepLargerThanCloudSize) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplStepOne) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplStepOne) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(1, 2, 3));
|
||||
auto result = util3d::downsample(cloud, 1);
|
||||
@@ -731,7 +731,7 @@ TEST(Util3dFiltering, downsampleImplStepOne) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplOrganizedDepthImage) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplOrganizedDepthImage) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->width = 4;
|
||||
cloud->height = 4;
|
||||
@@ -781,7 +781,7 @@ TEST(Util3dFiltering, downsampleImplOrganizedDepthImage) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplInvalidStep) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplInvalidStep) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0));
|
||||
EXPECT_THROW(util3d::downsample(cloud, 0), UException);
|
||||
@@ -800,7 +800,7 @@ TEST(Util3dFiltering, downsampleImplInvalidStep) {
|
||||
EXPECT_THROW(util3d::downsample(LaserScan(), 0), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplLiDARStyleRingsInRows) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplLiDARStyleRingsInRows) {
|
||||
const int width = 8;
|
||||
const int height = 2; // 2 rings, 8 points per ring
|
||||
const int step = 2;
|
||||
@@ -864,7 +864,7 @@ TEST(Util3dFiltering, downsampleImplLiDARStyleRingsInRows) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, downsampleImplLiDARStyleRingsInColumns) {
|
||||
TEST(Util3dFilteringTest, DownsampleImplLiDARStyleRingsInColumns) {
|
||||
const int width = 2; // 2 columns = 2 rings
|
||||
const int height = 8; // 8 points per ring
|
||||
const int step = 2;
|
||||
@@ -928,7 +928,7 @@ TEST(Util3dFiltering, downsampleImplLiDARStyleRingsInColumns) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, voxelizeFullCloud) {
|
||||
TEST(Util3dFilteringTest, VoxelizeFullCloud) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
|
||||
// Create a 3D grid of points (e.g., 10x10x1)
|
||||
@@ -944,7 +944,7 @@ TEST(Util3dFiltering, voxelizeFullCloud) {
|
||||
EXPECT_EQ(result->size(), 25);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, voxelizeWithIndices) {
|
||||
TEST(Util3dFilteringTest, VoxelizeWithIndices) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
pcl::IndicesPtr indices(new std::vector<int>);
|
||||
|
||||
@@ -962,7 +962,7 @@ TEST(Util3dFiltering, voxelizeWithIndices) {
|
||||
EXPECT_EQ(result->size(), 25);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, voxelizeSmallCloud) {
|
||||
TEST(Util3dFilteringTest, VoxelizeSmallCloud) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
cloud->push_back(pcl::PointXYZ(float(i), 0, 0));
|
||||
@@ -974,7 +974,7 @@ TEST(Util3dFiltering, voxelizeSmallCloud) {
|
||||
EXPECT_EQ(result->size(), cloud->size());
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, voxelizeEmptyInput) {
|
||||
TEST(Util3dFilteringTest, VoxelizeEmptyInput) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
float voxelSize = 1.0f;
|
||||
|
||||
@@ -986,7 +986,7 @@ TEST(Util3dFiltering, voxelizeEmptyInput) {
|
||||
EXPECT_TRUE(result2->empty());
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, voxelizeInvalidVoxelSize) {
|
||||
TEST(Util3dFilteringTest, VoxelizeInvalidVoxelSize) {
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0));
|
||||
pcl::IndicesPtr indices(new std::vector<int>{0});
|
||||
@@ -1010,7 +1010,7 @@ TEST(Util3dFiltering, voxelizeInvalidVoxelSize) {
|
||||
EXPECT_THROW(util3d::voxelize(pcl::PointCloud<pcl::PointXYZINormal>::Ptr(new pcl::PointCloud<pcl::PointXYZINormal>()), indices, 0.0f), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, randomSamplingSamplesCorrectNumberOfPoints)
|
||||
TEST(Util3dFilteringTest, RandomSamplingSamplesCorrectNumberOfPoints)
|
||||
{
|
||||
constexpr int total_points = 100;
|
||||
constexpr int sample_size = 10;
|
||||
@@ -1042,14 +1042,14 @@ TEST(Util3dFiltering, randomSamplingSamplesCorrectNumberOfPoints)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, randomSamplingThrowsAssertionForInvalidSampleSize)
|
||||
TEST(Util3dFilteringTest, RandomSamplingThrowsAssertionForInvalidSampleSize)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr input_cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
input_cloud->push_back(pcl::PointXYZ(1.0f, 2.0f, 3.0f));
|
||||
EXPECT_THROW(util3d::randomSampling(input_cloud, 0), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, passThroughFiltersCorrectZRange)
|
||||
TEST(Util3dFilteringTest, PassThroughFiltersCorrectZRange)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1077,7 +1077,7 @@ TEST(Util3dFiltering, passThroughFiltersCorrectZRange)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, passThroughFiltersOutsideZRangeWithNegative)
|
||||
TEST(Util3dFilteringTest, PassThroughFiltersOutsideZRangeWithNegative)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1099,7 +1099,7 @@ TEST(Util3dFiltering, passThroughFiltersOutsideZRangeWithNegative)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, passThroughFiltersWithIndicesSubset)
|
||||
TEST(Util3dFilteringTest, PassThroughFiltersWithIndicesSubset)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1125,7 +1125,7 @@ TEST(Util3dFiltering, passThroughFiltersWithIndicesSubset)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, passThroughInvalidAxisTriggersAssertion)
|
||||
TEST(Util3dFilteringTest, PassThroughInvalidAxisTriggersAssertion)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0.0f, 0.0f, 1.0f));
|
||||
@@ -1134,7 +1134,7 @@ TEST(Util3dFiltering, passThroughInvalidAxisTriggersAssertion)
|
||||
EXPECT_THROW(util3d::passThrough(cloud, indices, "invalid_axis", 0.0f, 1.0f, false), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, passThroughInvalidRangeTriggersAssertion)
|
||||
TEST(Util3dFilteringTest, PassThroughInvalidRangeTriggersAssertion)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0.0f, 0.0f, 1.0f));
|
||||
@@ -1143,7 +1143,7 @@ TEST(Util3dFiltering, passThroughInvalidRangeTriggersAssertion)
|
||||
EXPECT_THROW(util3d::passThrough(cloud, indices, "z", 5.0f, 2.0f, false), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, cropBoxIncludesPointsInBox)
|
||||
TEST(Util3dFilteringTest, CropBoxIncludesPointsInBox)
|
||||
{
|
||||
using PointT = pcl::PointXYZ;
|
||||
pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
||||
@@ -1203,7 +1203,7 @@ TEST(Util3dFiltering, cropBoxIncludesPointsInBox)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, cropBoxInvalidBoundsTriggerAssertion)
|
||||
TEST(Util3dFilteringTest, CropBoxInvalidBoundsTriggerAssertion)
|
||||
{
|
||||
using PointT = pcl::PointXYZ;
|
||||
pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
||||
@@ -1220,7 +1220,7 @@ TEST(Util3dFiltering, cropBoxInvalidBoundsTriggerAssertion)
|
||||
}
|
||||
|
||||
// Main test: filtering points inside a frustum
|
||||
TEST(Util3dFiltering, frustumFilteringIncludesPointsInFrustum)
|
||||
TEST(Util3dFilteringTest, FrustumFilteringIncludesPointsInFrustum)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1332,7 +1332,7 @@ TEST(Util3dFiltering, frustumFilteringIncludesPointsInFrustum)
|
||||
|
||||
|
||||
// Test assertion failure on invalid FOV
|
||||
TEST(Util3dFiltering, frustumFilteringInvalidFOVTriggersAssertion)
|
||||
TEST(Util3dFilteringTest, FrustumFilteringInvalidFOVTriggersAssertion)
|
||||
{
|
||||
using PointT = pcl::PointXYZ;
|
||||
pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
||||
@@ -1345,7 +1345,7 @@ TEST(Util3dFiltering, frustumFilteringInvalidFOVTriggersAssertion)
|
||||
}
|
||||
|
||||
// Test assertion failure on invalid clip plane distances
|
||||
TEST(Util3dFiltering, frustumFilteringInvalidClipPlaneTriggersAssertion)
|
||||
TEST(Util3dFilteringTest, FrustumFilteringInvalidClipPlaneTriggersAssertion)
|
||||
{
|
||||
using PointT = pcl::PointXYZ;
|
||||
pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
||||
@@ -1356,7 +1356,7 @@ TEST(Util3dFiltering, frustumFilteringInvalidClipPlaneTriggersAssertion)
|
||||
EXPECT_THROW(util3d::frustumFiltering(cloud, indices, cameraPose, 60.0f, 45.0f, 5.0f, 1.0f, false), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, removeNaNFromPointCloud)
|
||||
TEST(Util3dFilteringTest, RemoveNaNFromPointCloud)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1389,7 +1389,7 @@ TEST(Util3dFiltering, removeNaNFromPointCloud)
|
||||
EXPECT_FLOAT_EQ(filtered->points[1].z, 6.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, removeNaNNormalsFromPointCloud)
|
||||
TEST(Util3dFilteringTest, RemoveNaNNormalsFromPointCloud)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>);
|
||||
|
||||
@@ -1425,7 +1425,7 @@ TEST(Util3dFiltering, removeNaNNormalsFromPointCloud)
|
||||
EXPECT_FLOAT_EQ(filtered->points[0].normal_z, 0.0f);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, radiusFilteringWithFewNeighbors)
|
||||
TEST(Util3dFilteringTest, RadiusFilteringWithFewNeighbors)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1451,7 +1451,7 @@ TEST(Util3dFiltering, radiusFilteringWithFewNeighbors)
|
||||
EXPECT_EQ(filtered->at(2), 2);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, radiusFilteringProvidedIndicesSubset)
|
||||
TEST(Util3dFilteringTest, RadiusFilteringProvidedIndicesSubset)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1472,7 +1472,7 @@ TEST(Util3dFiltering, radiusFilteringProvidedIndicesSubset)
|
||||
EXPECT_EQ(filtered->at(1), 1);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, proportionalRadiusFilteringBasic)
|
||||
TEST(Util3dFilteringTest, ProportionalRadiusFilteringBasic)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1519,7 +1519,7 @@ TEST(Util3dFiltering, proportionalRadiusFilteringBasic)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, proportionalRadiusFilteringUsingProvidedIndices)
|
||||
TEST(Util3dFilteringTest, ProportionalRadiusFilteringUsingProvidedIndices)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0)); // 0
|
||||
@@ -1545,7 +1545,7 @@ TEST(Util3dFiltering, proportionalRadiusFilteringUsingProvidedIndices)
|
||||
ASSERT_EQ(result->size(), 0u);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, proportionalRadiusFilteringAllPointsNoNeighbors)
|
||||
TEST(Util3dFilteringTest, ProportionalRadiusFilteringAllPointsNoNeighbors)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0));
|
||||
@@ -1569,7 +1569,7 @@ TEST(Util3dFiltering, proportionalRadiusFilteringAllPointsNoNeighbors)
|
||||
ASSERT_EQ(result->size(), 0u);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, proportionalRadiusFilteringInvalidViewpointID)
|
||||
TEST(Util3dFilteringTest, ProportionalRadiusFilteringInvalidViewpointID)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0));
|
||||
@@ -1586,7 +1586,7 @@ TEST(Util3dFiltering, proportionalRadiusFilteringInvalidViewpointID)
|
||||
EXPECT_THROW(util3d::proportionalRadiusFiltering(cloud, indices, viewpointIndices, viewpoints, factor, neighborScale), UException);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, subtractFilteringBasicFiltering)
|
||||
TEST(Util3dFilteringTest, SubtractFilteringBasicFiltering)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->push_back(pcl::PointXYZ(0, 0, 0));
|
||||
@@ -1616,7 +1616,7 @@ TEST(Util3dFiltering, subtractFilteringBasicFiltering)
|
||||
EXPECT_EQ(result->at(1), 2);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, subtractAdaptiveFilteringXYZRGB)
|
||||
TEST(Util3dFilteringTest, SubtractAdaptiveFilteringXYZRGB)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZRGB>::Ptr(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||
auto subtractCloud = pcl::PointCloud<pcl::PointXYZRGB>::Ptr(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||
@@ -1652,7 +1652,7 @@ TEST(Util3dFiltering, subtractAdaptiveFilteringXYZRGB)
|
||||
EXPECT_EQ(result->at(1), 2);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, subtractAdaptiveFilteringXYZRGBNormal)
|
||||
TEST(Util3dFilteringTest, SubtractAdaptiveFilteringXYZRGBNormal)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||
auto subtractCloud = pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||
@@ -1710,7 +1710,7 @@ TEST(Util3dFiltering, subtractAdaptiveFilteringXYZRGBNormal)
|
||||
EXPECT_EQ(result->at(0), 0);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, normalFilteringBasic)
|
||||
TEST(Util3dFilteringTest, NormalFilteringBasic)
|
||||
{
|
||||
// Create a flat plane of points along XY plane (normals should be along Z)
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
@@ -1750,7 +1750,7 @@ TEST(Util3dFiltering, normalFilteringBasic)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, normalFilteringRejectNormalsWithLargeDeviation)
|
||||
TEST(Util3dFilteringTest, NormalFilteringRejectNormalsWithLargeDeviation)
|
||||
{
|
||||
// Construct a simple slanted surface so normals will not be vertical
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
@@ -1781,7 +1781,7 @@ TEST(Util3dFiltering, normalFilteringRejectNormalsWithLargeDeviation)
|
||||
}
|
||||
|
||||
// Test for PointXYZ type
|
||||
TEST(Util3dFiltering, extractClustersBasic)
|
||||
TEST(Util3dFilteringTest, ExtractClustersBasic)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1822,7 +1822,7 @@ TEST(Util3dFiltering, extractClustersBasic)
|
||||
ASSERT_EQ(clusters[biggestClusterIdx]->size(), 10);
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, extractClustersMinClusterSize)
|
||||
TEST(Util3dFilteringTest, ExtractClustersMinClusterSize)
|
||||
{
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -1849,7 +1849,7 @@ TEST(Util3dFiltering, extractClustersMinClusterSize)
|
||||
}
|
||||
|
||||
// Test case: Extract the points corresponding to the specified indices
|
||||
TEST(Util3dFiltering, extractIndices) {
|
||||
TEST(Util3dFilteringTest, ExtractIndices) {
|
||||
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
cloud->resize(5);
|
||||
@@ -1888,7 +1888,7 @@ TEST(Util3dFiltering, extractIndices) {
|
||||
EXPECT_NE(output->at(1), 3); // Index 3 should not be in the output
|
||||
}
|
||||
|
||||
TEST(Util3dFiltering, extractPlane) {
|
||||
TEST(Util3dFilteringTest, ExtractPlane) {
|
||||
|
||||
auto cloud = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3dMapping, rayTraceClearsFreePathWithoutObstacle) {
|
||||
TEST(Util3dMappingTest, RayTraceClearsFreePathWithoutObstacle) {
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50; // Initial grid (non-zero for testing)
|
||||
cv::Point2i start(2, 2);
|
||||
cv::Point2i end(7, 7);
|
||||
@@ -22,7 +22,7 @@ TEST(Util3dMapping, rayTraceClearsFreePathWithoutObstacle) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, rayTraceStopsOnObstacleWhenFlagTrue) {
|
||||
TEST(Util3dMappingTest, RayTraceStopsOnObstacleWhenFlagTrue) {
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50;
|
||||
grid.at<signed char>(5, 5) = 100; // Add obstacle
|
||||
cv::Point2i start(2, 2);
|
||||
@@ -38,7 +38,7 @@ TEST(Util3dMapping, rayTraceStopsOnObstacleWhenFlagTrue) {
|
||||
EXPECT_NE(grid.at<signed char>(6, 6), 0); // Not cleared after obstacle
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, rayTraceIgnoresObstacleWhenFlagFalse) {
|
||||
TEST(Util3dMappingTest, RayTraceIgnoresObstacleWhenFlagFalse) {
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50;
|
||||
grid.at<signed char>(5, 5) = 100; // Add obstacle
|
||||
cv::Point2i start(2, 2);
|
||||
@@ -52,7 +52,7 @@ TEST(Util3dMapping, rayTraceIgnoresObstacleWhenFlagFalse) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, rayTraceHandlesSteepSlopeCorrectly) {
|
||||
TEST(Util3dMappingTest, RayTraceHandlesSteepSlopeCorrectly) {
|
||||
// Create a 10x10 grid filled with 50
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50;
|
||||
|
||||
@@ -96,7 +96,7 @@ TEST(Util3dMapping, rayTraceHandlesSteepSlopeCorrectly) {
|
||||
EXPECT_GE(clearedCount, 5) << "Steep slope did not clear expected cells.";
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, rayTraceHandlesHorizontalVerticalSlopesCorrectly) {
|
||||
TEST(Util3dMappingTest, RayTraceHandlesHorizontalVerticalSlopesCorrectly) {
|
||||
// Create a 10x10 grid filled with 50
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50;
|
||||
|
||||
@@ -119,7 +119,7 @@ TEST(Util3dMapping, rayTraceHandlesHorizontalVerticalSlopesCorrectly) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, rayTraceClipsEndPointToBoundary) {
|
||||
TEST(Util3dMappingTest, RayTraceClipsEndPointToBoundary) {
|
||||
cv::Mat grid = cv::Mat::ones(10, 10, CV_8SC1) * 50;
|
||||
cv::Point2i start(3, 3);
|
||||
cv::Point2i end(20, 20); // Way outside bounds
|
||||
@@ -132,7 +132,7 @@ TEST(Util3dMapping, rayTraceClipsEndPointToBoundary) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, create2DMapBasicMapGeneration)
|
||||
TEST(Util3dMappingTest, Create2DMapBasicMapGeneration)
|
||||
{
|
||||
std::map<int, Transform> poses;
|
||||
std::map<int, std::pair<cv::Mat, cv::Mat>> scans;
|
||||
@@ -206,7 +206,7 @@ TEST(Util3dMapping, create2DMapBasicMapGeneration)
|
||||
-1);
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, occupancy2DFromLaserScanBasicTest)
|
||||
TEST(Util3dMappingTest, Occupancy2DFromLaserScanBasicTest)
|
||||
{
|
||||
// Synthetic scan with 3 hits and 2 no-hits (in 2D)
|
||||
cv::Mat scanHit(1, 3, CV_32FC2);
|
||||
@@ -236,7 +236,7 @@ TEST(Util3dMapping, occupancy2DFromLaserScanBasicTest)
|
||||
ASSERT_GT(empty.cols, 20) << "There should be some empty cells.";
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, create2DMapFromOccupancyLocalMapsBasic)
|
||||
TEST(Util3dMappingTest, Create2DMapFromOccupancyLocalMapsBasic)
|
||||
{
|
||||
// Setup poses
|
||||
std::map<int, Transform> poses;
|
||||
@@ -294,7 +294,7 @@ TEST(Util3dMapping, create2DMapFromOccupancyLocalMapsBasic)
|
||||
EXPECT_EQ(map.at<signed char>(rowEmpty, colEmpty2), 0); // Free
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, convertMap2Image8UBasicConversionNormalFormat)
|
||||
TEST(Util3dMappingTest, ConvertMap2Image8UBasicConversionNormalFormat)
|
||||
{
|
||||
// Create a simple 3x3 CV_8S occupancy grid
|
||||
cv::Mat map8S = (cv::Mat_<signed char>(3, 3) <<
|
||||
@@ -321,7 +321,7 @@ TEST(Util3dMapping, convertMap2Image8UBasicConversionNormalFormat)
|
||||
EXPECT_EQ(result.at<uchar>(2, 2), 178); // 0
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, convertMap2Image8UBasicConversionPGMFormat)
|
||||
TEST(Util3dMappingTest, ConvertMap2Image8UBasicConversionPGMFormat)
|
||||
{
|
||||
cv::Mat map8S = (cv::Mat_<signed char>(2, 2) <<
|
||||
-1, 0,
|
||||
@@ -341,7 +341,7 @@ TEST(Util3dMapping, convertMap2Image8UBasicConversionPGMFormat)
|
||||
EXPECT_EQ(result.at<uchar>(1, 1), 254); // -2
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, convertImage8U2MapNonPGMFormat)
|
||||
TEST(Util3dMappingTest, ConvertImage8U2MapNonPGMFormat)
|
||||
{
|
||||
// Create a 2x2 grayscale image using non-PGM expected values
|
||||
cv::Mat input = (cv::Mat_<uchar>(2, 2) << 178, 0, 200, 89);
|
||||
@@ -360,7 +360,7 @@ TEST(Util3dMapping, convertImage8U2MapNonPGMFormat)
|
||||
EXPECT_EQ(map.at<signed char>(1, 1), -1);
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, convertImage8U2MapPGMFormat)
|
||||
TEST(Util3dMappingTest, ConvertImage8U2MapPGMFormat)
|
||||
{
|
||||
// Create a 2x2 grayscale image using PGM expected values
|
||||
cv::Mat input = (cv::Mat_<uchar>(2, 2) << 254, 0, 205, 205);
|
||||
@@ -380,7 +380,7 @@ TEST(Util3dMapping, convertImage8U2MapPGMFormat)
|
||||
EXPECT_EQ(map.at<signed char>(1, 1), 100); // input(0, 1) = 0
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, erodeMapBasicErosion)
|
||||
TEST(Util3dMappingTest, ErodeMapBasicErosion)
|
||||
{
|
||||
// Create a 5x5 map with CV_8SC1 type
|
||||
// -1 = unknown, 0 = free, 100 = obstacle
|
||||
@@ -407,7 +407,7 @@ TEST(Util3dMapping, erodeMapBasicErosion)
|
||||
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, erodeMapNoErosionWithUnknown)
|
||||
TEST(Util3dMappingTest, ErodeMapNoErosionWithUnknown)
|
||||
{
|
||||
// Create a 3x3 map with obstacle touching unknown cell
|
||||
cv::Mat map = (cv::Mat_<signed char>(3,3) <<
|
||||
@@ -421,7 +421,7 @@ TEST(Util3dMapping, erodeMapNoErosionWithUnknown)
|
||||
EXPECT_EQ(erodedMap.at<signed char>(1,1), 100);
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, projectCloudOnXYPlaneZCoordinatesAreZero)
|
||||
TEST(Util3dMappingTest, ProjectCloudOnXYPlaneZCoordinatesAreZero)
|
||||
{
|
||||
// Create a test point cloud
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr input_cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
@@ -444,7 +444,7 @@ TEST(Util3dMapping, projectCloudOnXYPlaneZCoordinatesAreZero)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, segmentObstaclesFromGround)
|
||||
TEST(Util3dMappingTest, SegmentObstaclesFromGround)
|
||||
{
|
||||
// Create a cloud of a floor, then elevate some part of it to make a flat obstacle
|
||||
pcl::IndicesPtr expected_ground(new std::vector<int>);
|
||||
@@ -641,7 +641,7 @@ TEST(Util3dMapping, segmentObstaclesFromGround)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMapping, occupancy2DFromGroundObstaclesBasic)
|
||||
TEST(Util3dMappingTest, Occupancy2DFromGroundObstaclesBasic)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr groundCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr obstaclesCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
|
||||
@@ -13,7 +13,7 @@ float randomNoise(float max) {
|
||||
return ((static_cast<float>(rand()) / RAND_MAX) * 2.0f - 1.0f) * max;
|
||||
}
|
||||
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo2DBasic) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo2DBasic) {
|
||||
|
||||
// Two triangles in front of the camera at two different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
@@ -157,7 +157,7 @@ TEST(Util3dMotionEstimation, estimateMotion3DTo2DBasic) {
|
||||
}
|
||||
|
||||
// Same test than above, but with added noise on the points and pixels
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo2DWithNoise) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo2DWithNoise) {
|
||||
|
||||
// Two triangles in front of the camera at two different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
@@ -240,7 +240,7 @@ TEST(Util3dMotionEstimation, estimateMotion3DTo2DWithNoise) {
|
||||
|
||||
}
|
||||
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo2DMultiCamBasic) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo2DMultiCamBasic) {
|
||||
|
||||
// Two triangles in front of the camera at two different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
@@ -349,7 +349,7 @@ TEST(Util3dMotionEstimation, estimateMotion3DTo2DMultiCamBasic) {
|
||||
}
|
||||
|
||||
// Same thing than above, but with noise
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo2DMultiCamWithNoise) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo2DMultiCamWithNoise) {
|
||||
|
||||
// Two triangles in front of the camera at two different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
@@ -466,7 +466,7 @@ TEST(Util3dMotionEstimation, estimateMotion3DTo2DMultiCamWithNoise) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo3DBasic) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo3DBasic) {
|
||||
|
||||
// Three triangles in front of the camera at three different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
@@ -529,7 +529,7 @@ TEST(Util3dMotionEstimation, estimateMotion3DTo3DBasic) {
|
||||
}
|
||||
|
||||
// Same as above but with noise
|
||||
TEST(Util3dMotionEstimation, estimateMotion3DTo3DWithNoise) {
|
||||
TEST(Util3dMotionEstimationTest, EstimateMotion3DTo3DWithNoise) {
|
||||
|
||||
// Three triangles in front of the camera at three different depths, centered with the middle of the image frame
|
||||
std::map<int, cv::Point3f> words3A = {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDIdentityTransform)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesSVDIdentityTransform)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1, cloud2;
|
||||
cloud1.push_back(pcl::PointXYZ(1, 2, 3));
|
||||
@@ -26,7 +26,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDIdentityTransform)
|
||||
EXPECT_LT(result.getAngle(identity), 0.001f);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDTranslationOnly)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesSVDTranslationOnly)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1, cloud2;
|
||||
cloud1.push_back(pcl::PointXYZ(0, 0, 0));
|
||||
@@ -45,7 +45,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDTranslationOnly)
|
||||
EXPECT_NEAR(result.z(), 3.0f, 1e-4f);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDRotationAndTranslation)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesSVDRotationAndTranslation)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1, cloud2;
|
||||
|
||||
@@ -79,7 +79,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDRotationAndTranslatio
|
||||
EXPECT_NEAR(result.z(), expected_t.z(), 1e-4f);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDMismatchedSizes)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesSVDMismatchedSizes)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ> cloud1, cloud2;
|
||||
cloud1.push_back(pcl::PointXYZ(0, 0, 0));
|
||||
@@ -89,7 +89,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesSVDMismatchedSizes)
|
||||
EXPECT_THROW(util3d::transformFromXYZCorrespondencesSVD(cloud1, cloud2), UException);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesIdentityTransform)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesIdentityTransform)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
cloud1->push_back(pcl::PointXYZ(1, 0, 0));
|
||||
@@ -113,7 +113,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesIdentityTransform)
|
||||
EXPECT_EQ(covariance.cols, 6);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesTranslatedCloud)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesTranslatedCloud)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
@@ -139,7 +139,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesTranslatedCloud)
|
||||
EXPECT_EQ(inliers.size(), 10);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesTooFewPoints)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesTooFewPoints)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
@@ -153,7 +153,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesTooFewPoints)
|
||||
EXPECT_TRUE(result.isNull());
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, transformFromXYZCorrespondencesMismatchedPointCounts)
|
||||
TEST(Util3dRegistrationTest, TransformFromXYZCorrespondencesMismatchedPointCounts)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
@@ -170,7 +170,7 @@ TEST(Util3DRegistration, transformFromXYZCorrespondencesMismatchedPointCounts)
|
||||
EXPECT_TRUE(result.isNull());
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, computeVarianceAndCorrespondencesPerfectMatchNoAngleCheck)
|
||||
TEST(Util3dRegistrationTest, ComputeVarianceAndCorrespondencesPerfectMatchNoAngleCheck)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
@@ -193,7 +193,7 @@ TEST(Util3DRegistration, computeVarianceAndCorrespondencesPerfectMatchNoAngleChe
|
||||
EXPECT_DOUBLE_EQ(variance, 0.0);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, computeVarianceAndCorrespondencesNormalMismatchFilteredByAngle)
|
||||
TEST(Util3dRegistrationTest, ComputeVarianceAndCorrespondencesNormalMismatchFilteredByAngle)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
@@ -220,7 +220,7 @@ TEST(Util3DRegistration, computeVarianceAndCorrespondencesNormalMismatchFiltered
|
||||
EXPECT_DOUBLE_EQ(variance, 1.0); // untouched default value
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, computeVarianceAndCorrespondencesAnglePassWithLargeThreshold)
|
||||
TEST(Util3dRegistrationTest, ComputeVarianceAndCorrespondencesAnglePassWithLargeThreshold)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
@@ -247,7 +247,7 @@ TEST(Util3DRegistration, computeVarianceAndCorrespondencesAnglePassWithLargeThre
|
||||
EXPECT_GE(variance, 0.0);
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, computeVarianceAndCorrespondencesNoCorrespondencesDueToDistance)
|
||||
TEST(Util3dRegistrationTest, ComputeVarianceAndCorrespondencesNoCorrespondencesDueToDistance)
|
||||
{
|
||||
auto cloud1 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
auto cloud2 = pcl::PointCloud<pcl::PointNormal>::Ptr(new pcl::PointCloud<pcl::PointNormal>());
|
||||
@@ -279,7 +279,7 @@ TEST(Util3DRegistration, computeVarianceAndCorrespondencesNoCorrespondencesDueTo
|
||||
EXPECT_DOUBLE_EQ(variance, 1.0); // default untouched
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, icpIdentityTransformConverges)
|
||||
TEST(Util3dRegistrationTest, IcpIdentityTransformConverges)
|
||||
{
|
||||
auto cloud_source = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
for (float i = 0; i < 5; ++i)
|
||||
@@ -308,7 +308,7 @@ TEST(Util3DRegistration, icpIdentityTransformConverges)
|
||||
EXPECT_TRUE(result.toEigen4f().isApprox(identity, 1e-4));
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, icpTranslatedTransformConverges)
|
||||
TEST(Util3dRegistrationTest, IcpTranslatedTransformConverges)
|
||||
{
|
||||
auto cloud_source = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
for (float i = 0; i < 5; ++i)
|
||||
@@ -339,7 +339,7 @@ TEST(Util3DRegistration, icpTranslatedTransformConverges)
|
||||
EXPECT_TRUE(estimated.isApprox(expected, 1e-2));
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, icp2DAlignsFlatClouds)
|
||||
TEST(Util3dRegistrationTest, Icp2DAlignsFlatClouds)
|
||||
{
|
||||
pcl::console::setVerbosityLevel(pcl::console::L_DEBUG);
|
||||
auto cloud_source = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
@@ -374,7 +374,7 @@ TEST(Util3DRegistration, icp2DAlignsFlatClouds)
|
||||
EXPECT_TRUE(estimated.isApprox(expected, 1e-4));
|
||||
}
|
||||
|
||||
TEST(Util3DRegistration, icpPointToPlaneAlignsTranslatedPlane)
|
||||
TEST(Util3dRegistrationTest, IcpPointToPlaneAlignsTranslatedPlane)
|
||||
{
|
||||
// Create a plane point cloud
|
||||
auto cloud_source_raw = pcl::PointCloud<pcl::PointXYZ>::Ptr(new pcl::PointCloud<pcl::PointXYZ>());
|
||||
|
||||
@@ -23,7 +23,7 @@ pcl::PointCloud<pcl::PointNormal> createFlatNormalCloud(int count, const cv::Poi
|
||||
return cloud;
|
||||
}
|
||||
|
||||
TEST(Util3dSurface, computeNormalsComplexityVaryingNormals3D)
|
||||
TEST(Util3dSurfaceTest, ComputeNormalsComplexityVaryingNormals3D)
|
||||
{
|
||||
auto floor = createFlatNormalCloud(100, cv::Point3f(0.0f, 0.0f, 1.0f));
|
||||
auto wallA = createFlatNormalCloud(100, cv::Point3f(0.0f, 1.0f, 0.0f));
|
||||
@@ -68,7 +68,7 @@ TEST(Util3dSurface, computeNormalsComplexityVaryingNormals3D)
|
||||
EXPECT_NEAR(complexity, 0.0f, 1e-3);
|
||||
}
|
||||
|
||||
TEST(Util3dSurface, computeNormalsComplexityIdentityVsRotated)
|
||||
TEST(Util3dSurfaceTest, ComputeNormalsComplexityIdentityVsRotated)
|
||||
{
|
||||
auto cloud = createFlatNormalCloud(50, cv::Point3f(0.0f, 1.0f, 0.0f));
|
||||
Transform identity = Transform::getIdentity();
|
||||
@@ -80,7 +80,7 @@ TEST(Util3dSurface, computeNormalsComplexityIdentityVsRotated)
|
||||
EXPECT_NEAR(c1, c2, 1e-5); // rotation should not affect complexity
|
||||
}
|
||||
|
||||
TEST(Util3dSurface, computeNormalsComplexityEmptyOrInvalidNormals)
|
||||
TEST(Util3dSurfaceTest, ComputeNormalsComplexityEmptyOrInvalidNormals)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointNormal> cloud;
|
||||
pcl::PointNormal pt;
|
||||
@@ -93,7 +93,7 @@ TEST(Util3dSurface, computeNormalsComplexityEmptyOrInvalidNormals)
|
||||
EXPECT_EQ(complexity, 0.0f); // Should return 0 when all normals are invalid
|
||||
}
|
||||
|
||||
TEST(Util3dSurface, computeNormalsComplexityVaryingNormals2D)
|
||||
TEST(Util3dSurfaceTest, ComputeNormalsComplexityVaryingNormals2D)
|
||||
{
|
||||
auto wallA = createFlatNormalCloud(100, cv::Point3f(0.0f, 1.0f, 0.0f));
|
||||
auto negWallA = createFlatNormalCloud(100, cv::Point3f(0.0f, -1.0f, 0.0f));
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
TEST(Util3DTransforms, transformLaserScanBasicXYZTransform)
|
||||
TEST(Util3dTransformsTest, TransformLaserScanBasicXYZTransform)
|
||||
{
|
||||
// Create a simple 3D laser scan with 3 points
|
||||
cv::Mat scanData(1, 3, CV_32FC3); // 3D points (X,Y,Z)
|
||||
@@ -38,7 +38,7 @@ TEST(Util3DTransforms, transformLaserScanBasicXYZTransform)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformLaserScanXYZNormalTransform)
|
||||
TEST(Util3dTransformsTest, TransformLaserScanXYZNormalTransform)
|
||||
{
|
||||
// One point: position (1, 0, 0), normal (0, 1, 0)
|
||||
cv::Mat scanData(1, 1, CV_32FC(6)); // XYZ + normal_x, normal_y, normal_z
|
||||
@@ -75,7 +75,7 @@ TEST(Util3DTransforms, transformLaserScanXYZNormalTransform)
|
||||
EXPECT_NEAR(out[5], 0.0f, 1e-5); // normal_z
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudXYZ)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudXYZ)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
|
||||
pcl::PointXYZ pt(1.0f, 2.0f, 3.0f);
|
||||
@@ -103,7 +103,7 @@ TEST(Util3DTransforms, transformPointCloudXYZ)
|
||||
EXPECT_FLOAT_EQ(result->at(0).z, 9.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudXYZI)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudXYZI)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZI>);
|
||||
pcl::PointXYZI pt;
|
||||
@@ -128,7 +128,7 @@ TEST(Util3DTransforms, transformPointCloudXYZI)
|
||||
EXPECT_FLOAT_EQ(result->at(0).intensity, 52.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudXYZRGB)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudXYZRGB)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||
pcl::PointXYZRGB pt;
|
||||
@@ -157,7 +157,7 @@ TEST(Util3DTransforms, transformPointCloudXYZRGB)
|
||||
EXPECT_EQ(result->at(0).b, 55);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudPointNormal)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudPointNormal)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointNormal>);
|
||||
pcl::PointNormal pt;
|
||||
@@ -189,7 +189,7 @@ TEST(Util3DTransforms, transformPointCloudPointNormal)
|
||||
EXPECT_NEAR(result->at(0).normal_y, 1.0f, 1e-6);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudXYZINormal)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudXYZINormal)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZINormal>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZINormal>);
|
||||
pcl::PointXYZINormal pt;
|
||||
@@ -216,7 +216,7 @@ TEST(Util3DTransforms, transformPointCloudXYZINormal)
|
||||
EXPECT_FLOAT_EQ(result->at(0).intensity, 52.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointCloudXYZRGBNormal)
|
||||
TEST(Util3dTransformsTest, TransformPointCloudXYZRGBNormal)
|
||||
{
|
||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||
pcl::PointXYZRGBNormal pt;
|
||||
@@ -248,7 +248,7 @@ TEST(Util3DTransforms, transformPointCloudXYZRGBNormal)
|
||||
EXPECT_EQ(result->at(0).b, 55);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformCVPointF)
|
||||
TEST(Util3dTransformsTest, TransformCVPointF)
|
||||
{
|
||||
cv::Point3f pt(1.0f, 2.0f, 3.0f);
|
||||
|
||||
@@ -263,7 +263,7 @@ TEST(Util3DTransforms, transformCVPointF)
|
||||
EXPECT_FLOAT_EQ(result.z, 6.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformCVPointD)
|
||||
TEST(Util3dTransformsTest, TransformCVPointD)
|
||||
{
|
||||
cv::Point3d pt(1.0f, 2.0f, 3.0f);
|
||||
|
||||
@@ -278,7 +278,7 @@ TEST(Util3DTransforms, transformCVPointD)
|
||||
EXPECT_FLOAT_EQ(result.z, 6.0);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointXYZ)
|
||||
TEST(Util3dTransformsTest, TransformPointXYZ)
|
||||
{
|
||||
pcl::PointXYZ pt(1.0f, 2.0f, 3.0f);
|
||||
|
||||
@@ -293,7 +293,7 @@ TEST(Util3DTransforms, transformPointXYZ)
|
||||
EXPECT_FLOAT_EQ(result.z, 6.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointXYZI)
|
||||
TEST(Util3dTransformsTest, TransformPointXYZI)
|
||||
{
|
||||
pcl::PointXYZI pt;
|
||||
pt.x = 1; pt.y = 1; pt.z = 1; pt.intensity = 42.0f;
|
||||
@@ -307,7 +307,7 @@ TEST(Util3DTransforms, transformPointXYZI)
|
||||
EXPECT_FLOAT_EQ(result.intensity, 42.0f);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointXYZRGB)
|
||||
TEST(Util3dTransformsTest, TransformPointXYZRGB)
|
||||
{
|
||||
pcl::PointXYZRGB pt;
|
||||
pt.x = 0; pt.y = 0; pt.z = 0;
|
||||
@@ -323,7 +323,7 @@ TEST(Util3DTransforms, transformPointXYZRGB)
|
||||
EXPECT_EQ(result.b, 50);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointPointNormal)
|
||||
TEST(Util3dTransformsTest, TransformPointPointNormal)
|
||||
{
|
||||
pcl::PointNormal pt;
|
||||
pt.x = 1; pt.y = 0; pt.z = 0;
|
||||
@@ -340,7 +340,7 @@ TEST(Util3DTransforms, transformPointPointNormal)
|
||||
EXPECT_NEAR(result.normal_y, 0.0f, 1e-6);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointXYZINormal)
|
||||
TEST(Util3dTransformsTest, TransformPointXYZINormal)
|
||||
{
|
||||
pcl::PointXYZINormal pt;
|
||||
pt.x = 0; pt.y = 1; pt.z = 0; pt.intensity = 42.0f;
|
||||
@@ -356,7 +356,7 @@ TEST(Util3DTransforms, transformPointXYZINormal)
|
||||
EXPECT_NEAR(result.normal_y, 1.0f, 1e-6);
|
||||
}
|
||||
|
||||
TEST(Util3DTransforms, transformPointXYZRGBNormal)
|
||||
TEST(Util3dTransformsTest, TransformPointXYZRGBNormal)
|
||||
{
|
||||
pcl::PointXYZRGBNormal pt;
|
||||
pt.x = 0; pt.y = 1; pt.z = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ TEST_F(VWDictionaryTest, Constructor)
|
||||
EXPECT_EQ(dict->getIndexedWordsCount(), 0u);
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, AddNewWords_Incremental)
|
||||
TEST_F(VWDictionaryTest, AddNewWordsIncremental)
|
||||
{
|
||||
// Test incremental mode - NNDR is applied, new words created if NNDR fails
|
||||
// Test with all NNStrategy values
|
||||
@@ -166,7 +166,7 @@ TEST_F(VWDictionaryTest, AddNewWords_Incremental)
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, AddNewWords_Fixed)
|
||||
TEST_F(VWDictionaryTest, AddNewWordsFixed)
|
||||
{
|
||||
// Test fixed mode - NNDR is not applied, closest match is always returned
|
||||
|
||||
@@ -250,7 +250,7 @@ TEST_F(VWDictionaryTest, AddWord)
|
||||
EXPECT_EQ(retrieved->id(), 100);
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, FindNN_Incremental)
|
||||
TEST_F(VWDictionaryTest, FindNNIncremental)
|
||||
{
|
||||
// Test incremental mode - NNDR is applied
|
||||
EXPECT_TRUE(dict->isIncremental());
|
||||
@@ -293,7 +293,7 @@ TEST_F(VWDictionaryTest, FindNN_Incremental)
|
||||
EXPECT_EQ(secondId, VWDictionary::ID_INVALID);
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, FindNN_Fixed)
|
||||
TEST_F(VWDictionaryTest, FindNNFixed)
|
||||
{
|
||||
// Test fixed mode - NNDR is not applied, closest match is always returned
|
||||
|
||||
@@ -432,7 +432,7 @@ TEST_F(VWDictionaryTest, GetUnusedWords)
|
||||
EXPECT_EQ(unusedIds[0], wordId);
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, ConvertBinTo32F_ByteToFloat)
|
||||
TEST_F(VWDictionaryTest, ConvertBinTo32FByteToFloat)
|
||||
{
|
||||
// Test byteToFloat = true (simple conversion)
|
||||
cv::Mat input(2, 10, CV_8UC1);
|
||||
@@ -445,7 +445,7 @@ TEST_F(VWDictionaryTest, ConvertBinTo32F_ByteToFloat)
|
||||
EXPECT_EQ(output.cols, 10); // Same dimensions
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, ConvertBinTo32F_BitExpansion)
|
||||
TEST_F(VWDictionaryTest, ConvertBinTo32FBitExpansion)
|
||||
{
|
||||
// Test byteToFloat = false (bit expansion)
|
||||
cv::Mat input(1, 4, CV_8UC1);
|
||||
@@ -467,7 +467,7 @@ TEST_F(VWDictionaryTest, ConvertBinTo32F_BitExpansion)
|
||||
EXPECT_FLOAT_EQ(output.at<float>(0, 3), 1.0f); // bit 3
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, Convert32FToBin_ByteToFloat)
|
||||
TEST_F(VWDictionaryTest, Convert32FToBinByteToFloat)
|
||||
{
|
||||
// Test byteToFloat = true (simple conversion)
|
||||
cv::Mat input(2, 10, CV_32FC1);
|
||||
@@ -480,7 +480,7 @@ TEST_F(VWDictionaryTest, Convert32FToBin_ByteToFloat)
|
||||
EXPECT_EQ(output.cols, 10); // Same dimensions
|
||||
}
|
||||
|
||||
TEST_F(VWDictionaryTest, Convert32FToBin_BitPacking)
|
||||
TEST_F(VWDictionaryTest, Convert32FToBinBitPacking)
|
||||
{
|
||||
// Test byteToFloat = false (bit packing)
|
||||
cv::Mat input(1, 32, CV_32FC1);
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "rtabmap/utilite/UConversion.h"
|
||||
|
||||
TEST(UConversionTest, uReplaceCharChar)
|
||||
TEST(UConversionTest, UReplaceCharChar)
|
||||
{
|
||||
std::string str = "Hello";
|
||||
std::string result = uReplaceChar(str, 'l', 'p');
|
||||
EXPECT_EQ(result, "Heppo");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uReplaceCharString)
|
||||
TEST(UConversionTest, UReplaceCharString)
|
||||
{
|
||||
std::string str = "Hello";
|
||||
std::string result = uReplaceChar(str, 'o', "oween");
|
||||
EXPECT_EQ(result, "Helloween");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uToUpperCase)
|
||||
TEST(UConversionTest, UToUpperCase)
|
||||
{
|
||||
std::string str = "hello!";
|
||||
std::string result = uToUpperCase(str);
|
||||
EXPECT_EQ(result, "HELLO!");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uToLowerCase)
|
||||
TEST(UConversionTest, UToLowerCase)
|
||||
{
|
||||
std::string str = "HELLO!";
|
||||
std::string result = uToLowerCase(str);
|
||||
EXPECT_EQ(result, "hello!");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uNumber2StrUnsignedInt)
|
||||
TEST(UConversionTest, UNumber2StrUnsignedInt)
|
||||
{
|
||||
unsigned int number = 42;
|
||||
std::string result = uNumber2Str(number);
|
||||
EXPECT_EQ(result, "42");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uNumber2StrInt)
|
||||
TEST(UConversionTest, UNumber2StrInt)
|
||||
{
|
||||
int number = -42;
|
||||
std::string result = uNumber2Str(number);
|
||||
EXPECT_EQ(result, "-42");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uNumber2StrFloat)
|
||||
TEST(UConversionTest, UNumber2StrFloat)
|
||||
{
|
||||
float number = 0.14159f;
|
||||
std::string result = uNumber2Str(number, 2, false);
|
||||
@@ -54,7 +54,7 @@ TEST(UConversionTest, uNumber2StrFloat)
|
||||
EXPECT_STREQ(result.c_str(), "3.1");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uNumber2StrDouble)
|
||||
TEST(UConversionTest, UNumber2StrDouble)
|
||||
{
|
||||
double number = 0.14159;
|
||||
std::string result = uNumber2Str(number, 2, false);
|
||||
@@ -65,49 +65,49 @@ TEST(UConversionTest, uNumber2StrDouble)
|
||||
EXPECT_STREQ(result.c_str(), "3.1");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2Int)
|
||||
TEST(UConversionTest, UStr2Int)
|
||||
{
|
||||
std::string str = "42";
|
||||
int result = uStr2Int(str);
|
||||
EXPECT_EQ(result, 42);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2IntNegative)
|
||||
TEST(UConversionTest, UStr2IntNegative)
|
||||
{
|
||||
std::string str = "-42";
|
||||
int result = uStr2Int(str);
|
||||
EXPECT_EQ(result, -42);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2Float)
|
||||
TEST(UConversionTest, UStr2Float)
|
||||
{
|
||||
std::string str = "3.14";
|
||||
float result = uStr2Float(str);
|
||||
EXPECT_NEAR(result, 3.14f, 0.001f);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2FloatComma)
|
||||
TEST(UConversionTest, UStr2FloatComma)
|
||||
{
|
||||
std::string str = "3,14";
|
||||
float result = uStr2Float(str);
|
||||
EXPECT_NEAR(result, 3.14f, 0.001f);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2Double)
|
||||
TEST(UConversionTest, UStr2Double)
|
||||
{
|
||||
std::string str = "3.14159";
|
||||
double result = uStr2Double(str);
|
||||
EXPECT_NEAR(result, 3.14159, 0.00001);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2DoubleComma)
|
||||
TEST(UConversionTest, UStr2DoubleComma)
|
||||
{
|
||||
std::string str = "3,14159";
|
||||
double result = uStr2Double(str);
|
||||
EXPECT_NEAR(result, 3.14159, 0.00001);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uBool2Str)
|
||||
TEST(UConversionTest, UBool2Str)
|
||||
{
|
||||
std::string resultTrue = uBool2Str(true);
|
||||
std::string resultFalse = uBool2Str(false);
|
||||
@@ -115,7 +115,7 @@ TEST(UConversionTest, uBool2Str)
|
||||
EXPECT_EQ(resultFalse, "false");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2Bool)
|
||||
TEST(UConversionTest, UStr2Bool)
|
||||
{
|
||||
EXPECT_TRUE(uStr2Bool("true"));
|
||||
EXPECT_TRUE(uStr2Bool("TRUE"));
|
||||
@@ -127,7 +127,7 @@ TEST(UConversionTest, uStr2Bool)
|
||||
EXPECT_TRUE(uStr2Bool("anything"));
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uStr2Bytes)
|
||||
TEST(UConversionTest, UStr2Bytes)
|
||||
{
|
||||
std::string str = "Hello";
|
||||
std::vector<unsigned char> bytes = uStr2Bytes(str);
|
||||
@@ -137,21 +137,21 @@ TEST(UConversionTest, uStr2Bytes)
|
||||
EXPECT_EQ(bytes[5], '\0');
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uBytes2Str)
|
||||
TEST(UConversionTest, UBytes2Str)
|
||||
{
|
||||
std::vector<unsigned char> bytes = {'H', 'e', 'l', 'l', 'o', '\0'};
|
||||
std::string result = uBytes2Str(bytes);
|
||||
EXPECT_EQ(result, "Hello");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uBytes2Hex)
|
||||
TEST(UConversionTest, UBytes2Hex)
|
||||
{
|
||||
char bytes[] = {0x3F, 0x1A};
|
||||
std::string result = uBytes2Hex(bytes, 2);
|
||||
EXPECT_EQ(result, "3F1A");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uHex2Bytes)
|
||||
TEST(UConversionTest, UHex2Bytes)
|
||||
{
|
||||
std::string hex = "1f3B";
|
||||
std::vector<char> bytes = uHex2Bytes(hex);
|
||||
@@ -160,7 +160,7 @@ TEST(UConversionTest, uHex2Bytes)
|
||||
EXPECT_EQ(bytes[1], 0x3B);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uHex2BytesWithLength)
|
||||
TEST(UConversionTest, UHex2BytesWithLength)
|
||||
{
|
||||
std::string hex = "1f3B";
|
||||
std::vector<char> bytes = uHex2Bytes(hex.c_str(), 4);
|
||||
@@ -169,14 +169,14 @@ TEST(UConversionTest, uHex2BytesWithLength)
|
||||
EXPECT_EQ(bytes[1], 0x3B);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uHex2Str)
|
||||
TEST(UConversionTest, UHex2Str)
|
||||
{
|
||||
std::string hex = "48656C6C6F21";
|
||||
std::string result = uHex2Str(hex);
|
||||
EXPECT_EQ(result, "Hello!");
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uHex2Ascii)
|
||||
TEST(UConversionTest, UHex2Ascii)
|
||||
{
|
||||
unsigned char c = 0xFA;
|
||||
unsigned char left = uHex2Ascii(c, false);
|
||||
@@ -185,7 +185,7 @@ TEST(UConversionTest, uHex2Ascii)
|
||||
EXPECT_EQ(right, 'A');
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uAscii2Hex)
|
||||
TEST(UConversionTest, UAscii2Hex)
|
||||
{
|
||||
unsigned char result = uAscii2Hex('F');
|
||||
EXPECT_EQ(result, 0x0F);
|
||||
@@ -193,7 +193,7 @@ TEST(UConversionTest, uAscii2Hex)
|
||||
EXPECT_EQ(result, 0x0A);
|
||||
}
|
||||
|
||||
TEST(UConversionTest, uFormat)
|
||||
TEST(UConversionTest, UFormat)
|
||||
{
|
||||
std::string result = uFormat("Hello %s %d", "world", 42);
|
||||
EXPECT_NE(result.find("Hello"), std::string::npos);
|
||||
|
||||
+25
-25
@@ -3,7 +3,7 @@
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
TEST(UMathTest, uIsNan)
|
||||
TEST(UMathTest, UIsNan)
|
||||
{
|
||||
float nanValue = std::numeric_limits<float>::quiet_NaN();
|
||||
float normalValue = 3.14f;
|
||||
@@ -17,7 +17,7 @@ TEST(UMathTest, uIsNan)
|
||||
EXPECT_FALSE(uIsNan(normalDouble));
|
||||
}
|
||||
|
||||
TEST(UMathTest, uIsFinite)
|
||||
TEST(UMathTest, UIsFinite)
|
||||
{
|
||||
float infValue = std::numeric_limits<float>::infinity();
|
||||
float normalValue = 3.14f;
|
||||
@@ -28,7 +28,7 @@ TEST(UMathTest, uIsFinite)
|
||||
EXPECT_FALSE(uIsFinite(nanValue));
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMin3)
|
||||
TEST(UMathTest, UMin3)
|
||||
{
|
||||
EXPECT_EQ(uMin3(3, 1, 2), 1);
|
||||
EXPECT_EQ(uMin3(1, 2, 3), 1);
|
||||
@@ -36,7 +36,7 @@ TEST(UMathTest, uMin3)
|
||||
EXPECT_EQ(uMin3(1.5f, 2.5f, 0.5f), 0.5f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMax3)
|
||||
TEST(UMathTest, UMax3)
|
||||
{
|
||||
EXPECT_EQ(uMax3(3, 1, 2), 3);
|
||||
EXPECT_EQ(uMax3(1, 2, 3), 3);
|
||||
@@ -44,7 +44,7 @@ TEST(UMathTest, uMax3)
|
||||
EXPECT_EQ(uMax3(1.5f, 2.5f, 0.5f), 2.5f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMaxArray)
|
||||
TEST(UMathTest, UMaxArray)
|
||||
{
|
||||
int arr[] = {1, 5, 3, 9, 2};
|
||||
unsigned int index;
|
||||
@@ -56,7 +56,7 @@ TEST(UMathTest, uMaxArray)
|
||||
EXPECT_EQ(max2, 9);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMaxVector)
|
||||
TEST(UMathTest, UMaxVector)
|
||||
{
|
||||
std::vector<int> v = {1, 5, 3, 9, 2};
|
||||
unsigned int index;
|
||||
@@ -68,7 +68,7 @@ TEST(UMathTest, uMaxVector)
|
||||
EXPECT_EQ(max2, 9);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMinArray)
|
||||
TEST(UMathTest, UMinArray)
|
||||
{
|
||||
int arr[] = {5, 1, 3, 9, 2};
|
||||
unsigned int index;
|
||||
@@ -80,7 +80,7 @@ TEST(UMathTest, uMinArray)
|
||||
EXPECT_EQ(min2, 1);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMinVector)
|
||||
TEST(UMathTest, UMinVector)
|
||||
{
|
||||
std::vector<int> v = {5, 1, 3, 9, 2};
|
||||
unsigned int index;
|
||||
@@ -92,7 +92,7 @@ TEST(UMathTest, uMinVector)
|
||||
EXPECT_EQ(min2, 1);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMinMaxArray)
|
||||
TEST(UMathTest, UMinMaxArray)
|
||||
{
|
||||
int arr[] = {5, 1, 3, 9, 2};
|
||||
int min, max;
|
||||
@@ -104,7 +104,7 @@ TEST(UMathTest, uMinMaxArray)
|
||||
EXPECT_EQ(indexMax, 3u);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMinMaxVector)
|
||||
TEST(UMathTest, UMinMaxVector)
|
||||
{
|
||||
std::vector<int> v = {5, 1, 3, 9, 2};
|
||||
int min, max;
|
||||
@@ -116,7 +116,7 @@ TEST(UMathTest, uMinMaxVector)
|
||||
EXPECT_EQ(indexMax, 3u);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMinMaxWithoutIndices)
|
||||
TEST(UMathTest, UMinMaxWithoutIndices)
|
||||
{
|
||||
int arr[] = {5, 1, 3, 9, 2};
|
||||
int min, max;
|
||||
@@ -130,7 +130,7 @@ TEST(UMathTest, uMinMaxWithoutIndices)
|
||||
EXPECT_EQ(max, 9);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uSign)
|
||||
TEST(UMathTest, USign)
|
||||
{
|
||||
EXPECT_EQ(uSign(5), 1);
|
||||
EXPECT_EQ(uSign(-5), -1);
|
||||
@@ -139,28 +139,28 @@ TEST(UMathTest, uSign)
|
||||
EXPECT_EQ(uSign(-3.14f), -1);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uSumList)
|
||||
TEST(UMathTest, USumList)
|
||||
{
|
||||
std::list<int> list = {1, 2, 3, 4, 5};
|
||||
int sum = uSum(list);
|
||||
EXPECT_EQ(sum, 15);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uSumArray)
|
||||
TEST(UMathTest, USumArray)
|
||||
{
|
||||
int arr[] = {1, 2, 3, 4, 5};
|
||||
int sum = uSum(arr, 5);
|
||||
EXPECT_EQ(sum, 15);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uSumVector)
|
||||
TEST(UMathTest, USumVector)
|
||||
{
|
||||
std::vector<int> v = {1, 2, 3, 4, 5};
|
||||
int sum = uSum(v);
|
||||
EXPECT_EQ(sum, 15);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uSumSquared)
|
||||
TEST(UMathTest, USumSquared)
|
||||
{
|
||||
int arr[] = {1, 2, 3};
|
||||
int sum = uSumSquared(arr, 3);
|
||||
@@ -170,7 +170,7 @@ TEST(UMathTest, uSumSquared)
|
||||
EXPECT_EQ(sum2, 2); // (-1)*(-1) + 0*0 + 1*1 = 1 + 0 + 1 = 2
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMean)
|
||||
TEST(UMathTest, UMean)
|
||||
{
|
||||
int arr[] = {1, 2, 3, 4, 5};
|
||||
float mean = uMean(arr, 5);
|
||||
@@ -185,7 +185,7 @@ TEST(UMathTest, uMean)
|
||||
EXPECT_FLOAT_EQ(mean3, 3.0f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uMeanSquaredError)
|
||||
TEST(UMathTest, UMeanSquaredError)
|
||||
{
|
||||
float x[] = {1.0f, 2.0f, 3.0f};
|
||||
float y[] = {1.1f, 2.1f, 3.1f};
|
||||
@@ -198,7 +198,7 @@ TEST(UMathTest, uMeanSquaredError)
|
||||
EXPECT_NEAR(mse2, 0.01f, 0.001f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uVariance)
|
||||
TEST(UMathTest, UVariance)
|
||||
{
|
||||
float arr[] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f};
|
||||
float mean = uMean(arr, 5);
|
||||
@@ -209,7 +209,7 @@ TEST(UMathTest, uVariance)
|
||||
EXPECT_NEAR(variance2, 2.5f, 0.1f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uNormSquared)
|
||||
TEST(UMathTest, UNormSquared)
|
||||
{
|
||||
std::vector<float> v = {3.0f, 4.0f};
|
||||
float normSq = uNormSquared(v);
|
||||
@@ -222,7 +222,7 @@ TEST(UMathTest, uNormSquared)
|
||||
EXPECT_FLOAT_EQ(normSq3, 14.0f); // 1*1 + 2*2 + 3*3 = 1 + 4 + 9 = 14
|
||||
}
|
||||
|
||||
TEST(UMathTest, uNorm)
|
||||
TEST(UMathTest, UNorm)
|
||||
{
|
||||
std::vector<float> v = {3.0f, 4.0f};
|
||||
float norm = uNorm(v);
|
||||
@@ -235,7 +235,7 @@ TEST(UMathTest, uNorm)
|
||||
EXPECT_NEAR(norm3, 3.741657f, 0.001f); // sqrt(14)
|
||||
}
|
||||
|
||||
TEST(UMathTest, uNormalize)
|
||||
TEST(UMathTest, UNormalize)
|
||||
{
|
||||
std::vector<float> v = {3.0f, 4.0f};
|
||||
std::vector<float> normalized = uNormalize(v);
|
||||
@@ -249,7 +249,7 @@ TEST(UMathTest, uNormalize)
|
||||
EXPECT_FLOAT_EQ(normalizedZero[1], 0.0f);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uLocalMaxima)
|
||||
TEST(UMathTest, ULocalMaxima)
|
||||
{
|
||||
float arr[] = {1.0f, 3.0f, 2.0f, 5.0f, 4.0f, 6.0f, 3.0f};
|
||||
std::list<unsigned int> maxima = uLocalMaxima(arr, 7);
|
||||
@@ -261,7 +261,7 @@ TEST(UMathTest, uLocalMaxima)
|
||||
EXPECT_GT(maxima2.size(), 0u);
|
||||
}
|
||||
|
||||
TEST(UMathTest, uHamming)
|
||||
TEST(UMathTest, UHamming)
|
||||
{
|
||||
std::vector<float> window = uHamming(10);
|
||||
EXPECT_EQ(window.size(), 10u);
|
||||
@@ -273,7 +273,7 @@ TEST(UMathTest, uHamming)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(UMathTest, uIsInBounds)
|
||||
TEST(UMathTest, UIsInBounds)
|
||||
{
|
||||
EXPECT_TRUE(uIsInBounds(5, 0, 10));
|
||||
EXPECT_FALSE(uIsInBounds(10, 0, 10));
|
||||
|
||||
+32
-32
@@ -2,7 +2,7 @@
|
||||
#include "rtabmap/utilite/UStl.h"
|
||||
#include <map>
|
||||
|
||||
TEST(UStlTest, uUniqueKeys)
|
||||
TEST(UStlTest, UUniqueKeys)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -17,7 +17,7 @@ TEST(UStlTest, uUniqueKeys)
|
||||
EXPECT_EQ(uniqueKeys.back(), 3);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uKeysMultimap)
|
||||
TEST(UStlTest, UKeysMultimap)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -31,7 +31,7 @@ TEST(UStlTest, uKeysMultimap)
|
||||
EXPECT_EQ(keysList.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uValuesMultimap)
|
||||
TEST(UStlTest, UValuesMultimap)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -45,7 +45,7 @@ TEST(UStlTest, uValuesMultimap)
|
||||
EXPECT_EQ(valuesList.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uValuesMultimapForKey)
|
||||
TEST(UStlTest, UValuesMultimapForKey)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -58,7 +58,7 @@ TEST(UStlTest, uValuesMultimapForKey)
|
||||
EXPECT_EQ(values.back(), "b");
|
||||
}
|
||||
|
||||
TEST(UStlTest, uKeysMap)
|
||||
TEST(UStlTest, UKeysMap)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
m[1] = "a";
|
||||
@@ -75,7 +75,7 @@ TEST(UStlTest, uKeysMap)
|
||||
EXPECT_EQ(keysSet.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uValuesMap)
|
||||
TEST(UStlTest, UValuesMap)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
m[1] = "a";
|
||||
@@ -89,7 +89,7 @@ TEST(UStlTest, uValuesMap)
|
||||
EXPECT_EQ(valuesList.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uValueMap)
|
||||
TEST(UStlTest, UValueMap)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
m[1] = "a";
|
||||
@@ -102,7 +102,7 @@ TEST(UStlTest, uValueMap)
|
||||
EXPECT_EQ(defaultValue, "default");
|
||||
}
|
||||
|
||||
TEST(UStlTest, uTake)
|
||||
TEST(UStlTest, UTake)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
m[1] = "a";
|
||||
@@ -114,7 +114,7 @@ TEST(UStlTest, uTake)
|
||||
EXPECT_EQ(m.find(1), m.end());
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIteratorAtList)
|
||||
TEST(UStlTest, UIteratorAtList)
|
||||
{
|
||||
std::list<int> list = {1, 2, 3, 4, 5};
|
||||
auto iter = uIteratorAt(list, 2);
|
||||
@@ -125,14 +125,14 @@ TEST(UStlTest, uIteratorAtList)
|
||||
EXPECT_EQ(*constIter, 3);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIteratorAtSet)
|
||||
TEST(UStlTest, UIteratorAtSet)
|
||||
{
|
||||
std::set<int> s = {1, 2, 3, 4, 5};
|
||||
auto iter = uIteratorAt(s, 2);
|
||||
EXPECT_NE(iter, s.end());
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIteratorAtVector)
|
||||
TEST(UStlTest, UIteratorAtVector)
|
||||
{
|
||||
std::vector<int> v = {1, 2, 3, 4, 5};
|
||||
auto iter = uIteratorAt(v, 2);
|
||||
@@ -143,7 +143,7 @@ TEST(UStlTest, uIteratorAtVector)
|
||||
EXPECT_EQ(*constIter, 3);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uValueAtList)
|
||||
TEST(UStlTest, UValueAtList)
|
||||
{
|
||||
std::list<int> list = {1, 2, 3, 4, 5};
|
||||
int& value = uValueAt(list, 2);
|
||||
@@ -156,14 +156,14 @@ TEST(UStlTest, uValueAtList)
|
||||
EXPECT_EQ(constValue, 10);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uContainsList)
|
||||
TEST(UStlTest, UContainsList)
|
||||
{
|
||||
std::list<int> list = {1, 2, 3, 4, 5};
|
||||
EXPECT_TRUE(uContains(list, 3));
|
||||
EXPECT_FALSE(uContains(list, 10));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uContainsMap)
|
||||
TEST(UStlTest, UContainsMap)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
m[1] = "a";
|
||||
@@ -172,7 +172,7 @@ TEST(UStlTest, uContainsMap)
|
||||
EXPECT_FALSE(uContains(m, 10));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uContainsMultimap)
|
||||
TEST(UStlTest, UContainsMultimap)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -181,7 +181,7 @@ TEST(UStlTest, uContainsMultimap)
|
||||
EXPECT_FALSE(uContains(mm, 10));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uInsert)
|
||||
TEST(UStlTest, UInsert)
|
||||
{
|
||||
std::map<int, std::string> m;
|
||||
uInsert(m, std::make_pair(1, std::string("a")));
|
||||
@@ -197,7 +197,7 @@ TEST(UStlTest, uInsert)
|
||||
EXPECT_EQ(m.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uListToVector)
|
||||
TEST(UStlTest, UListToVector)
|
||||
{
|
||||
std::list<int> list = {1, 2, 3, 4, 5};
|
||||
std::vector<int> v = uListToVector(list);
|
||||
@@ -206,7 +206,7 @@ TEST(UStlTest, uListToVector)
|
||||
EXPECT_EQ(v[4], 5);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uVectorToList)
|
||||
TEST(UStlTest, UVectorToList)
|
||||
{
|
||||
std::vector<int> v = {1, 2, 3, 4, 5};
|
||||
std::list<int> list = uVectorToList(v);
|
||||
@@ -215,7 +215,7 @@ TEST(UStlTest, uVectorToList)
|
||||
EXPECT_EQ(list.back(), 5);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uMultimapToMap)
|
||||
TEST(UStlTest, UMultimapToMap)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -226,7 +226,7 @@ TEST(UStlTest, uMultimapToMap)
|
||||
EXPECT_EQ(m.size(), 2u); // All entries
|
||||
}
|
||||
|
||||
TEST(UStlTest, uMultimapToMapUnique)
|
||||
TEST(UStlTest, UMultimapToMapUnique)
|
||||
{
|
||||
std::multimap<int, std::string> mm;
|
||||
mm.insert({1, "a"});
|
||||
@@ -238,7 +238,7 @@ TEST(UStlTest, uMultimapToMapUnique)
|
||||
EXPECT_EQ(m[2], "c");
|
||||
}
|
||||
|
||||
TEST(UStlTest, uAppend)
|
||||
TEST(UStlTest, UAppend)
|
||||
{
|
||||
std::list<int> list1 = {1, 2, 3};
|
||||
std::list<int> list2 = {4, 5, 6};
|
||||
@@ -247,14 +247,14 @@ TEST(UStlTest, uAppend)
|
||||
EXPECT_EQ(list1.back(), 6);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIndexOf)
|
||||
TEST(UStlTest, UIndexOf)
|
||||
{
|
||||
std::vector<int> v = {1, 2, 3, 4, 5};
|
||||
EXPECT_EQ(uIndexOf(v, 3), 2);
|
||||
EXPECT_EQ(uIndexOf(v, 10), -1);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uSplit)
|
||||
TEST(UStlTest, USplit)
|
||||
{
|
||||
std::list<std::string> result = uSplit("Hello the world!", ' ');
|
||||
EXPECT_EQ(result.size(), 3u);
|
||||
@@ -265,7 +265,7 @@ TEST(UStlTest, uSplit)
|
||||
EXPECT_EQ(result2.size(), 3u);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uJoin)
|
||||
TEST(UStlTest, UJoin)
|
||||
{
|
||||
std::list<std::string> strings;
|
||||
strings.push_back("Hello");
|
||||
@@ -277,7 +277,7 @@ TEST(UStlTest, uJoin)
|
||||
EXPECT_EQ(joined2, "Helloworld!");
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIsDigit)
|
||||
TEST(UStlTest, UIsDigit)
|
||||
{
|
||||
EXPECT_TRUE(uIsDigit('0'));
|
||||
EXPECT_TRUE(uIsDigit('5'));
|
||||
@@ -286,7 +286,7 @@ TEST(UStlTest, uIsDigit)
|
||||
EXPECT_FALSE(uIsDigit('A'));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIsInteger)
|
||||
TEST(UStlTest, UIsInteger)
|
||||
{
|
||||
EXPECT_TRUE(uIsInteger("123"));
|
||||
EXPECT_TRUE(uIsInteger("-123"));
|
||||
@@ -298,7 +298,7 @@ TEST(UStlTest, uIsInteger)
|
||||
EXPECT_FALSE(uIsInteger("-123", false));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uIsNumber)
|
||||
TEST(UStlTest, UIsNumber)
|
||||
{
|
||||
EXPECT_TRUE(uIsNumber("123"));
|
||||
EXPECT_TRUE(uIsNumber("12.3"));
|
||||
@@ -307,35 +307,35 @@ TEST(UStlTest, uIsNumber)
|
||||
EXPECT_FALSE(uIsNumber("12.3.4"));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uSplitNumChar)
|
||||
TEST(UStlTest, USplitNumChar)
|
||||
{
|
||||
std::list<std::string> result = uSplitNumChar("Hello 03 my 65 world!");
|
||||
EXPECT_GT(result.size(), 0u);
|
||||
// Should contain numbers and characters separately
|
||||
}
|
||||
|
||||
TEST(UStlTest, uStrNumCmp)
|
||||
TEST(UStlTest, UStrNumCmp)
|
||||
{
|
||||
EXPECT_LT(uStrNumCmp("Image9.jpg", "Image10.jpg"), 0);
|
||||
EXPECT_GT(uStrNumCmp("Image10.jpg", "Image9.jpg"), 0);
|
||||
EXPECT_EQ(uStrNumCmp("Image10.jpg", "Image10.jpg"), 0);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uStrContains)
|
||||
TEST(UStlTest, UStrContains)
|
||||
{
|
||||
EXPECT_TRUE(uStrContains("Hello World", "World"));
|
||||
EXPECT_TRUE(uStrContains("Hello World", "Hello"));
|
||||
EXPECT_FALSE(uStrContains("Hello World", "xyz"));
|
||||
}
|
||||
|
||||
TEST(UStlTest, uCompareVersion)
|
||||
TEST(UStlTest, UCompareVersion)
|
||||
{
|
||||
EXPECT_GT(uCompareVersion("2.0.0", 1, 0, 0), 0);
|
||||
EXPECT_EQ(uCompareVersion("1.0.0", 1, 0, 0), 0);
|
||||
EXPECT_LT(uCompareVersion("0.9.0", 1, 0, 0), 0);
|
||||
}
|
||||
|
||||
TEST(UStlTest, uPad)
|
||||
TEST(UStlTest, UPad)
|
||||
{
|
||||
std::string result = uPad("Hello", 10);
|
||||
EXPECT_GE(result.size(), 10u);
|
||||
|
||||
Reference in New Issue
Block a user