37 #include <gtest/gtest.h>
40 #include <rclcpp/rclcpp.hpp>
44 TEST(TestVoxelGrid, TestReadWrite)
63 for (
int x = 0; x < num_x; ++x)
64 for (
int y = 0; y < num_y; ++y)
65 for (
int z = 0; z < num_z; ++z)
67 EXPECT_EQ(vg.
getCell(x, y, z), 0);
79 for (
int x = 0; x < num_x; ++x)
80 for (
int y = 0; y < num_y; ++y)
81 for (
int z = 0; z < num_z; ++z)
89 for (
int x = 0; x < num_x; ++x)
90 for (
int y = 0; y < num_y; ++y)
91 for (
int z = 0; z < num_z; ++z)
93 EXPECT_EQ(i, vg.
getCell(x, y, z));
98 int main(
int argc,
char** argv)
100 testing::InitGoogleTest(&argc, argv);
101 return RUN_ALL_TESTS();
VoxelGrid holds a dense 3D, axis-aligned set of data at a given resolution, where the data is supplie...
int getNumCells(Dimension dim) const
Gets the number of cells in the indicated dimension.
T & getCell(int x, int y, int z)
Gives the value of the given location (x,y,z) in the discretized voxel grid space.
void reset(const T &initial)
Sets every cell in the voxel grid to the supplied data.
Namespace for holding classes that generate distance fields.
int main(int argc, char **argv)
TEST(TestVoxelGrid, TestReadWrite)