voxel_filter_test.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 #include <cmath>
20 
21 #include "gmock/gmock.h"
22 
23 namespace cartographer {
24 namespace sensor {
25 namespace {
26 
27 using ::testing::ContainerEq;
28 
29 TEST(VoxelFilterTest, ReturnsTheFirstPointInEachVoxel) {
30  PointCloud point_cloud = {{0.f, 0.f, 0.f},
31  {0.1f, -0.1f, 0.1f},
32  {0.3f, -0.1f, 0.f},
33  {0.f, 0.f, 0.1f}};
34  EXPECT_THAT(VoxelFiltered(point_cloud, 0.3f),
35  ContainerEq(PointCloud{point_cloud[0], point_cloud[2]}));
36 }
37 
38 } // namespace
39 } // namespace sensor
40 } // namespace cartographer
PointCloud VoxelFiltered(const PointCloud &point_cloud, const float size)
Definition: voxel_filter.cc:80
std::vector< Eigen::Vector3f > PointCloud
Definition: point_cloud.h:30


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:39