small changes to IO
This commit is contained in:
		
							parent
							
								
									532809e1cf
								
							
						
					
					
						commit
						fc0683f65f
					
				| @ -150,8 +150,7 @@ typedef std::shared_ptr<DatasetIoInterface> 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
 | ||||
|  | ||||
| @ -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<const rosbag::ConnectionInfo *> connection_infos = | ||||
| @ -405,8 +399,6 @@ class RosbagIO : public DatasetIoInterface { | ||||
| 
 | ||||
|  private: | ||||
|   std::shared_ptr<RosbagVioDataset> data; | ||||
| 
 | ||||
|   bool with_images; | ||||
| }; | ||||
| 
 | ||||
| }  // namespace basalt
 | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
| @ -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 { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user