Skip to content

Question about Ground Truth Alignment Error in Venman Dataset #17

@minwoo0611

Description

@minwoo0611

Dear Authors,

First, thank you for sharing the valuable Wild-Places dataset. It has been incredibly helpful for research in forestry, particularly for localization and place recognition tasks.

I have a question regarding the ground truth data in the Venman dataset, specifically for V-02 and V-03 (I haven't tested other sequences yet).

I created a global map using the code below:

import open3d as o3d
import pandas as df
import numpy as np
import os


def read_poses(csv_path):
    """Read poses from CSV file with string timestamps."""
    poses_df = df.read_csv(csv_path, dtype={'timestamp': str})

    poses = {}
    for _, row in poses_df.iterrows():
        timestamp = row['timestamp']  
        print(timestamp)  
        translation = np.array([row['x'], row['y'], row['z']])
        quaternion = np.array([row['qw'], row['qx'], row['qy'], row['qz']]) 
        poses[timestamp] = {'translation': translation, 'quaternion': quaternion}
    return poses


def quaternion_to_rotation_matrix(q):
    """Convert quaternion (w, x, y, z) to 4x4 transformation matrix."""
    w, x, y, z = q
    r = np.array([
        [1 - 2*y*y - 2*z*z, 2*x*y - 2*z*w, 2*x*z + 2*y*w, 0],
        [2*x*y + 2*z*w, 1 - 2*x*x - 2*z*z, 2*y*z - 2*x*w, 0],
        [2*x*z - 2*y*w, 2*y*z + 2*x*w, 1 - 2*x*x - 2*y*y, 0],
        [0, 0, 0, 1]
    ])
    return r

def combine_point_clouds(pcd_dir, csv_path):
    """Combine point clouds into a global map using poses."""
    # Read poses
    poses = read_poses(csv_path)
    
    # Initialize global point cloud
    global_pcd = o3d.geometry.PointCloud()
    i = 0
    # Process each point cloud
    for filename in os.listdir(pcd_dir):
        
        if filename.endswith('.pcd'):
            # Extract timestamp from filename
            timestamp = str(filename[:-4])  # Remove '.pcd' extension
            if timestamp in poses:
                # Read point cloud
                pcd_path = os.path.join(pcd_dir, filename)
                pcd = o3d.io.read_point_cloud(pcd_path)
                
                # Get pose
                pose = poses[timestamp]
                translation = pose['translation']
                quaternion = pose['quaternion']
                
                # Create transformation matrix
                transform = np.eye(4)
                transform[:3, :3] = quaternion_to_rotation_matrix(quaternion)[:3, :3]
                transform[:3, 3] = translation
                
                # Transform point cloud
                pcd.transform(transform)
                
                # Add to global point cloud
                global_pcd += pcd
                i = i+1
            else:
                print(f"Warning: No pose found for timestamp {timestamp}")
    print(i)
    return global_pcd

def main():
    # Define paths
    pcd_dir = "V-03/Clouds_downsampled"
    csv_path = "V-03/poses_aligned.csv"
    
    # Combine point clouds
    global_map = combine_point_clouds(pcd_dir, csv_path)
    
    # Save global map
    output_path = "global_map_v03.pcd"
    o3d.io.write_point_cloud(output_path, global_map)
    print(f"Global map saved to {output_path}")
    

if __name__ == "__main__":
    main()

When visualizing the resulting global map, I noticed significant misalignment between the point clouds from V-02 (green) and V-03 (red), particularly for features like streetlights. The output suggests that these features are not properly aligned.

My question is, Should I expect this level of ground truth error in the dataset, or is there potentially an issue in my global map generation process? I used the provided data (point clouds and poses) as-is, as shown in the code above.

I would appreciate your insights on whether this misalignment is due to inherent ground truth errors or a mistake in my implementation.

Thank you for your time and support!

Best Regards,
Minwoo

Image Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions