From fc0683f65ff3f1d2eab8068d6bd786318a2b097b Mon Sep 17 00:00:00 2001 From: Vladyslav Usenko Date: Sun, 4 Aug 2019 16:29:48 +0200 Subject: [PATCH] small changes to IO --- include/basalt/io/dataset_io.h | 3 +-- include/basalt/io/dataset_io_rosbag.h | 12 ++---------- include/basalt/io/dataset_io_uzh.h | 1 - src/io/dataset_io.cpp | 4 ++-- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/include/basalt/io/dataset_io.h b/include/basalt/io/dataset_io.h index 70138b2..69d527c 100644 --- a/include/basalt/io/dataset_io.h +++ b/include/basalt/io/dataset_io.h @@ -150,8 +150,7 @@ typedef std::shared_ptr DatasetIoInterfacePtr; class DatasetIoFactory { public: - static DatasetIoInterfacePtr getDatasetIo(const std::string &dataset_type, - bool with_images = true); + static DatasetIoInterfacePtr getDatasetIo(const std::string &dataset_type); }; } // namespace basalt diff --git a/include/basalt/io/dataset_io_rosbag.h b/include/basalt/io/dataset_io_rosbag.h index 1426da9..6b679da 100644 --- a/include/basalt/io/dataset_io_rosbag.h +++ b/include/basalt/io/dataset_io_rosbag.h @@ -165,7 +165,7 @@ class RosbagVioDataset : public VioDataset { class RosbagIO : public DatasetIoInterface { public: - RosbagIO(bool with_images) : with_images(with_images) {} + RosbagIO() {} void read(const std::string &path) { if (!fs::exists(path)) @@ -176,13 +176,7 @@ class RosbagIO : public DatasetIoInterface { data->bag.reset(new rosbag::Bag); data->bag->open(path, rosbag::bagmode::Read); - rosbag::View view(*data->bag, [this](const rosbag::ConnectionInfo *ci) { - if (this->with_images) - return true; - else - return ci->datatype == std::string("sensor_msgs/Imu") || - ci->datatype == std::string("geometry_msgs/TransformStamped"); - }); + rosbag::View view(*data->bag); // get topics std::vector connection_infos = @@ -405,8 +399,6 @@ class RosbagIO : public DatasetIoInterface { private: std::shared_ptr data; - - bool with_images; }; } // namespace basalt diff --git a/include/basalt/io/dataset_io_uzh.h b/include/basalt/io/dataset_io_uzh.h index 658e1d6..05969e3 100644 --- a/include/basalt/io/dataset_io_uzh.h +++ b/include/basalt/io/dataset_io_uzh.h @@ -306,7 +306,6 @@ class UzhIO : public DatasetIoInterface { q.z() >> q.w(); int64_t t_ns = timestamp * 1e9; - t_ns += -99902802; data->gt_timestamps.emplace_back(t_ns); data->gt_pose_data.emplace_back(q, pos); diff --git a/src/io/dataset_io.cpp b/src/io/dataset_io.cpp index fa9eee6..9656a02 100644 --- a/src/io/dataset_io.cpp +++ b/src/io/dataset_io.cpp @@ -41,12 +41,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace basalt { DatasetIoInterfacePtr DatasetIoFactory::getDatasetIo( - const std::string &dataset_type, bool with_images) { + const std::string &dataset_type) { if (dataset_type == "euroc") { // return DatasetIoInterfacePtr(); return DatasetIoInterfacePtr(new EurocIO); } else if (dataset_type == "bag") { - return DatasetIoInterfacePtr(new RosbagIO(with_images)); + return DatasetIoInterfacePtr(new RosbagIO); } else if (dataset_type == "uzh") { return DatasetIoInterfacePtr(new UzhIO); } else {