10 #include <gtest/gtest.h> 15 const double map2_x_off,
const double map2_tim_off,
16 const size_t expected_m1_count,
const size_t expected_m2_count)
18 const double pts1[8][3] = {
19 {1, 0, 0}, {1.03, 0, 0}, {1, 1, 0}, {1.01, 1.02, 0},
20 {0, 1, 0}, {-0.01, 1.01, 0}, {-1, 0, 0}, {-1.01, 0.02, 0}};
29 for (
const auto& i : pts1) map1.
insertPoint(i[0], i[1], i[2]);
30 for (
size_t i = 0; i <
sizeof(pts1) /
sizeof(pts1[0]); i++)
34 pts1[i][0], pts1[i][1], pts1[i][2], x, y, z);
36 if (i == 1) x += map2_x_off;
42 std::vector<bool> deletion_mask;
45 pc_filter.
filter(&map1, pts1_tim, pts1_pose, &extra_params);
48 pc_filter.
filter(&map2, pts2_tim, pts2_pose, &extra_params);
52 TEST(CPointCloudFilterByDistance, noOutliers)
58 TEST(CPointCloudFilterByDistance, withOutliers)
64 TEST(CPointCloudFilterByDistance, tooOldMap)
void inverseComposePoint(const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::optional_ref< mrpt::math::CMatrixDouble33 > out_jacobian_df_dpoint=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dpose=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dse3=std::nullopt) const
Computes the 3D point L such as .
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
void insertPoint(float x, float y, float z=0)
Provides a way to insert (append) individual points into the map: the missing fields of child classes...
void run_pc_filter_test(const double map2_x_off, const double map2_tim_off, const size_t expected_m1_count, const size_t expected_m2_count)
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
TEST(CPointCloudFilterByDistance, noOutliers)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Implementation of pointcloud filtering based on requisities for minimum neigbouring points in both...
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
mrpt::system::TTimeStamp timestampAdd(const mrpt::system::TTimeStamp tim, const double num_seconds)
Shifts a timestamp the given amount of seconds (>0: forwards in time, <0: backwards) ...
size_t size() const
Save the point cloud as a PCL PCD file, in either ASCII or binary format.
void filter(mrpt::maps::CPointsMap *inout_pointcloud, const mrpt::system::TTimeStamp pc_timestamp, const mrpt::poses::CPose3D &pc_reference_pose, TExtraFilterParams *params=nullptr) override
Apply the filtering algorithm to the pointcloud.