Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions dimos/mapping/ray_tracing/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from dimos.core.native_module import NativeModule, NativeModuleConfig
from dimos.core.stream import In, Out
from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped
from dimos.msgs.nav_msgs.Odometry import Odometry
from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2
from dimos.spec import mapping
Expand All @@ -43,10 +44,18 @@ class RayTracingVoxelMapConfig(NativeModuleConfig):
# Bounds for the health of voxels. Positive health means voxel is occupied.
min_health: int = -2
max_health: int = 1
# Spare a clearing miss when |ray dot surface normal| is below this.
# Don't clear a miss when abs of ray dot normal is below this, clear it when above.
# Higher clears only on direct hits, lower clears on slight grazes too.
graze_cos: float = 0.7
# Only spare a voxel whose neighborhood was hit within this many frames.
# A stale voxel can be cleared, even if it's a grazing hit. Large disables it.
recency_window: int = 15
# Publish the accumulated local map and region bounds every Nth frame. Zero disables them.
emit_every: int = 1
# Publish the global map every Nth frame. Zero disables it.
global_emit_every: int = 1
# Size the local region to this percentile of batch point distances.
region_percentile: float = 95.0


class RayTracingVoxelMap(NativeModule, mapping.GlobalPointcloud):
Expand All @@ -58,8 +67,8 @@ class RayTracingVoxelMap(NativeModule, mapping.GlobalPointcloud):
odometry: In[Odometry]
global_map: Out[PointCloud2]
local_map: Out[PointCloud2]
region_bounds: Out[PoseStamped]


# Verify protocol port compliance (mypy will flag missing ports)
if TYPE_CHECKING:
RayTracingVoxelMap()
59 changes: 59 additions & 0 deletions dimos/mapping/ray_tracing/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dimos/mapping/ray_tracing/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ lcm-msgs = { git = "https://github.com/dimensionalOS/dimos-lcm.git", branch = "r
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"] }
serde = { version = "1", features = ["derive"] }
ahash = "0.8"
arrayvec = "0.7"
rayon = "1"
tracing = "0.1"
pyo3 = { version = "0.25", features = ["extension-module", "abi3-py310"] }
numpy = "0.25"
Expand Down
2 changes: 1 addition & 1 deletion dimos/mapping/ray_tracing/rust/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
cargoRoot = "dimos/mapping/ray_tracing/rust";
buildAndTestSubdir = "dimos/mapping/ray_tracing/rust";

cargoHash = "sha256-g30NaoLdtWT5YBsEnE4Xv+EMnI5HHFtZAUtdEL/VbKQ=";
cargoHash = "sha256-0d0dlNDvDplA7oWTyUWOCOlS74Zie8uMQ+ps6lXntOI=";

meta.mainProgram = "voxel_ray_tracing";
};
Expand Down
Loading
Loading