Dataset Tools

Dataset tools convert live OceanSim runs into offline artifacts for mapping, evaluation, robotics integration, replay, and publication figures.

Recording

class OceanSimPklRecorder

Collect OceanSim frames into a pickle dataset for offline replay and figures.

scenario

Scenario label stored in the dataset metadata.

voxel_size

Point-cloud voxel size used when compacting frames.

max_points_per_frame

Maximum number of points stored for each frame.

add_frame(state, point_cloud=None, dvl=None, imaging_sonar=None, lidar_2d=None, rgbd_dense=None, agents=None, planning=None, sim_time=None)

Append one compact simulation frame.

to_dataset()

Return a serializable dataset dictionary.

save(path)

Write the dataset to a PKL file.

load(path)

Load a PKL dataset dictionary.

dataset_to_mapper(dataset, voxel_size=None)

Build an OceanSimPointCloudMap from a PKL dataset, preserving trajectory and point-cloud frames.

load_pkl_dataset(path)

Load a PKL dataset through OceanSimPklRecorder.load.

Replay

class OceanSimRunReplay

Read an exported OceanSim run for deterministic offline inspection.

open(run_dir)

Open an exported run directory.

frame_count()

Return number of replay frames.

iter_frames()

Iterate exported frame dictionaries.

trajectory()

Return trajectory as a NumPy array.

sensor_frames(sensor_name)

Iterate frames for one sensor.

summary()

Return high-level run metadata.

tum_trajectory_rows()

Export trajectory rows for TUM-style benchmark tools.

euroc_trajectory_rows()

Export trajectory rows for EuRoC-style benchmark tools.

Camera images

Function

Description

camera_payload_to_arrays(payload)

Convert an OceanSim camera payload to RGB, depth, and segmentation arrays.

save_camera_payload(payload, output_dir, prefix="camera")

Save camera payload arrays as PNG files.

AUV.save_camera_images(output_dir, prefix="camera")

Fetch current camera payload and save images in one call.

Robotics exports

Function

Description

export_ros2_bridge_dataset(run_dir, output_dir=None)

Write ROS2-bridge-friendly JSONL topics from an exported OceanSim run.

export_mcap_like_dataset(run_dir, output_dir=None)

Write an MCAP-ready sidecar dataset without requiring the MCAP Python package.

reconstruct_mesh_obj(dataset_path, output_obj, ...)

Reconstruct an OBJ mesh from an OceanSim point-cloud PKL dataset.