Mapping Utilities

Mapping utilities convert coordinates, process point clouds, accumulate maps, render figures, and adapt robotics payloads into OceanSim schema conventions.

Coordinates

Function

Description

godot_to_oceansim(value)

Convert Godot XYZ to OceanSim user XYZ: [X, -Z, Y].

oceansim_to_godot(value)

Convert OceanSim user XYZ to Godot XYZ: [x, z, -y].

oceansim_to_ros_enu(value)

Return an ENU-compatible OceanSim vector.

oceansim_to_ros_ned(value)

Convert OceanSim ENU to ROS NED: [y, x, -z].

state_position_godot(state)

Extract and convert a state dictionary position to Godot coordinates.

OceanSim point-cloud map

class OceanSimPointCloudMap

Accumulates OceanSim point clouds and renders research map figures.

add_cloud(cloud, world=True, min_range=0.0, max_range=inf, pose=None)

Add one OceanSim cloud to the map.

add_pose(position)

Append one trajectory point.

cloud_array()

Return all accumulated points as a NumPy array.

save_npz(path)

Persist map arrays to a compressed NumPy file.

load_npz(path)

Reload a previously saved map.

render_colored_map(output_path, plane='xz', color_by='height', title=None, dark=True, point_size=1.0, trajectory_width=2.2, dpi=220)

Render a dense colored point-cloud map.

render_exploration_map(output_path, plane='xz', title=None, point_size=0.45, dpi=220)

Render a white-background sparse exploration map.

RGB-D SLAM

class RGBDPointCloudSLAM

Lightweight dense point-cloud accumulator for RGB-D frames.

add_frame(rgbd, pose=None, force_keyframe=False)

Add a keyframe or dense RGB-D frame.

point_array()

Return fused point coordinates.

color_array()

Return fused RGB colors.

fused_arrays()

Return (points, colors) arrays.

save_ply(path)

Export a colored PLY point cloud.

save_npz(path)

Persist dense mapping arrays.

render(path, width=1280, height=860, color_mode='range')

Render a dense map figure.

Adapters

Function

Purpose

make_structured_cloud_from_xyz(points, ...)

Build OceanSim structured cloud format from external xyz-like outputs.

raycast_lidar_to_oceansim_cloud(lidar_output, ...)

Normalize raycast or semantic lidar output.

ros_pointcloud2_like_to_oceansim_cloud(msg_or_dict, ...)

Normalize decoded ROS PointCloud2-like data.

sonar_image_to_oceansim_sonar(image, ...)

Normalize FLS/MSIS/multibeam image data.

dvl_to_oceansim_dvl(raw, ...)

Normalize DVL-like outputs from external tools.