Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kkufieta committed Jan 8, 2024
1 parent 16f870c commit 116f11b
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 299 deletions.
1 change: 0 additions & 1 deletion viam-cartographer/src/carto_facade/carto_facade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <boost/uuid/uuid_io.hpp>

#include "glog/logging.h"
#include "io.h"
#include "map_builder.h"
#include "util.h"

Expand Down
102 changes: 0 additions & 102 deletions viam-cartographer/src/carto_facade/io.cc

This file was deleted.

33 changes: 0 additions & 33 deletions viam-cartographer/src/carto_facade/io.h

This file was deleted.

119 changes: 0 additions & 119 deletions viam-cartographer/src/carto_facade/io_test.cc

This file was deleted.

1 change: 0 additions & 1 deletion viam-cartographer/src/carto_facade/map_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "cartographer/mapping/map_builder_interface.h"
#include "cartographer/mapping/trajectory_builder_interface.h"
#include "glog/logging.h"
#include "io.h"
#include "map_builder.h"

namespace viam {
Expand Down
43 changes: 0 additions & 43 deletions viam-cartographer/src/carto_facade/util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <iostream>
#include <string>

#include "io.h"
#include "test_helpers.h"
namespace help = viam::carto_facade::test_helpers;

Expand Down Expand Up @@ -133,32 +132,11 @@ BOOST_AUTO_TEST_CASE(carto_lidar_reading_wrong_shape_binary_failure) {
}

BOOST_AUTO_TEST_CASE(carto_lidar_reading_binary_success) {
// Create a mini PCD file and save it in a tmp directory
std::string filename = "rplidar_data_2022-01-01T01:00:00.0001Z.pcd";
std::vector<std::vector<double>> points = {
{-0.001000, 0.002000, 0.005000, 16711938},
{0.582000, 0.012000, 0.000000, 16711938},
{0.007000, 0.006000, 0.001000, 16711938}};
std::string pcd = help::binary_pcd(points);
boost::filesystem::path tmp_dir = help::make_tmp_dir();
// Create a unique path in the temp directory and add the PCD file
boost::filesystem::ofstream ofs(tmp_dir / filename);
ofs << pcd;
ofs.close();
// Read it in and check if the data in the TimedPointCloudData is equivalent
// to what we had in the pcd file
cartographer::sensor::TimedPointCloudData timed_pcd =
viam::carto_facade::io::TimedPointCloudDataFromPCDBuilder(
tmp_dir.string() + "/" + filename, 0);

BOOST_TEST(timed_pcd.ranges.size() == points.size());
help::timed_pcd_contains(timed_pcd, points);
BOOST_TEST(timed_pcd.origin == Eigen::Vector3f::Zero());
BOOST_TEST(timed_pcd.time ==
cartographer::common::FromUniversal(16409988000001121));
// Remove the temporary directory and its contents
boost::filesystem::remove_all(tmp_dir);

auto [success, timed_pcd_from_string] =
carto_lidar_reading(pcd, 16409988000001121);
BOOST_TEST(success);
Expand All @@ -170,32 +148,11 @@ BOOST_AUTO_TEST_CASE(carto_lidar_reading_binary_success) {
}

BOOST_AUTO_TEST_CASE(carto_lidar_reading_ascii_success) {
// Create a mini PCD file and save it in a tmp directory
std::string filename = "rplidar_data_2022-01-01T01:00:00.0001Z.pcd";
std::vector<std::vector<double>> points = {
{-0.001000, 0.002000, 0.005000, 16711938},
{0.582000, 0.012000, 0.000000, 16711938},
{0.007000, 0.006000, 0.001000, 16711938}};
std::string pcd = help::ascii_pcd(points);
// Create a unique path in the temp directory and add the PCD file
boost::filesystem::path tmp_dir = help::make_tmp_dir();
boost::filesystem::ofstream ofs(tmp_dir / filename);
ofs << pcd;
ofs.close();
// Read it in and check if the data in the TimedPointCloudData is equivalent
// to what we had in the pcd file
cartographer::sensor::TimedPointCloudData timed_pcd =
viam::carto_facade::io::TimedPointCloudDataFromPCDBuilder(
tmp_dir.string() + "/" + filename, 0);

BOOST_TEST(timed_pcd.ranges.size() == points.size());
help::timed_pcd_contains(timed_pcd, points);
BOOST_TEST(timed_pcd.origin == Eigen::Vector3f::Zero());
BOOST_TEST(timed_pcd.time ==
cartographer::common::FromUniversal(16409988000001121));
// Remove the temporary directory and its contents
boost::filesystem::remove_all(tmp_dir);

auto [success, timed_pcd_from_string] =
carto_lidar_reading(pcd, 16409988000001121);
BOOST_TEST(success);
Expand Down

0 comments on commit 116f11b

Please sign in to comment.