Implement a Dataset for VDBFusion
mainWhile not mandatory, providing a dataset object simplifies data loading. The API expects a collection of scans where each item provides a point cloud and its corresponding sensor origin in the global coordinate frame.
Python Implementation
Your class should implement __len__ and __getitem__. __getitem__ must return a tuple containing:
- A PointCloud as a
np.array(N, 3) - The sensor origin as an
Eigen::Vector3d(or equivalent in the global coordinate frame).
C++ Implementation
Your class should implement size() and operator[]. The operator must return a std::tuple<Cloud, Point> where Cloud is a std::vector<Eigen::Vector3d> and Point is the sensor origin.
class Dataset:
def __init__(self, *args, **kwargs):
# Initialize your dataset here ..
def __len__(self) -> int:
return len(self.n_scans)
def __getitem__(self, idx: int):
# Returns a PointCloud(np.array(N, 3))
# and sensor origin(Eigen::Vector3d)
# in the global coordinate frame.
return points, origin