150 Commits
Author SHA1 Message Date
Julien Denizot c95d942fc4 chore: establish Enuxia Vacuum project identity 2026-10-03 18:09:28 +02:00
Julien Denizot b22643d128 feat(dhruva-slam): establish validated M6 Pro SLAM baseline enuxia-m6pro-baseline-2026-10-03 2026-10-03 17:49:38 +02:00
Julien Denizot fee3ac8598 fix(delta2d): correct measurement packet angle decoding 2026-10-03 17:45:48 +02:00
Julien Denizot 7fef98aa9f fix(crl200s): restore GD32 telemetry after cold boot 2026-10-02 15:00:43 +02:00
Harishankar d70d9f9cce Merge pull request #3 from gkfabs/feat/roborock-s5max-doc
docs(s5max): document the hardware protocol and reverse-engineering method
2026-09-20 06:18:10 +05:30
Fabien Carrion 9c6a72cee9 feat(s5max): add documentation 2026-09-19 12:19:42 -06:00
Harishankar 928ffed9f9 Merge pull request #2 from gkfabs/feat/roborock-s5max-driver-pr
feat(sangam-io): add native Roborock S5 Max support
2026-09-14 16:37:48 +05:30
Fabien Carrion 667a00e795 fix(s5max): address portability and integration review 2026-09-12 23:13:02 -06:00
Fabien Carrion 0c5d173bb8 feat(s5max): add build config and MCU handoff support 2026-09-12 21:44:48 -06:00
Fabien Carrion 16065e680a feat(sangam-io): add native Roborock S5 Max driver 2026-09-12 21:44:48 -06:00
codetiger 397eee1455 Add DhruvaNav autonomous exploration controller
New navigation controller implementing frontier-based exploration for the
VacuumTiger robot vacuum. Key features:

Multi-threaded architecture:
- Sensor thread (~100Hz): UDP sensor reading, odometry, safety checks
- Mapping thread (~5-10Hz): VastuSLAM scan matching, grid updates
- Exploration thread (~20Hz): Frontier detection, path planning

Path planning:
- Theta* any-angle pathfinding (smoother than A*)
- SIMD-optimized cost map with obstacle inflation
- Path smoother for differential-drive kinematics

Frontier exploration:
- Flood-fill clustering of frontier cells
- Normalized scoring (distance, size, info gain)
- Blacklisting and recovery for stuck situations

Integration:
- SangamIO TCP/UDP client for robot communication
- VastuSLAM for SLAM and occupancy grid mapping
- SVG visualization with trajectory and frontier markers
2026-01-06 21:22:14 +05:30
codetiger 2c635ea183 Format map_loader.rs 2026-01-06 21:20:15 +05:30
codetiger 3e78199709 Remove lidar offset from VastuSLAM, add SVG debug markers
Lidar offset handling is now done in SangamIO (commit 64020cf), which
transforms lidar data to robot-center coordinates before streaming.
This simplifies VastuSLAM by removing hardware-specific configuration.

Also adds debug visualization support to SVG output:
- DebugMarker struct for custom markers with position, radius, color
- with_waypoints() for path waypoints (orange)
- with_frontiers() for frontier targets (green, labeled)
- with_markers() for arbitrary debug markers
- Dynamic legend sizing based on active entries
2026-01-06 21:19:37 +05:30
codetiger 64020cf4dd Transform lidar data to robot-center frame in SangamIO
Move lidar mounting configuration from mock simulation config to
hardware config section. SangamIO now transforms lidar measurements
from the physical lidar position to robot center before streaming,
ensuring clients receive consistent robot-centered data regardless
of hardware vs simulation.

- Add LidarMountingConfig with transform_to_robot_center() method
- Apply transformation in Delta2DDriver before accumulating points
- Simplify mock simulator to generate robot-centered data directly
- Consolidate mounting parameters in sangamio.toml [device.hardware]
2026-01-06 21:18:31 +05:30
codetiger d7837b9abb Use TOML config in scenario_slam example
Load VastuConfig from configs/config.toml instead of hardcoded defaults
for map and matcher configuration. Sensor offset is now read from the
config file rather than being hardcoded.
2026-01-02 11:27:42 +05:30
codetiger c70b9d6587 Update criterion to 0.8 and toml to 0.9
Upgrade benchmark dependencies to latest versions. Criterion 0.8
requires using std::hint::black_box instead of criterion::black_box.
Also includes minor formatting improvements from rustfmt.
2026-01-02 11:18:08 +05:30
codetiger d5fd3004ce Add encoder-based motion commands for scenario testing
Replace time-based movement with MoveDistance and Rotate commands that
use encoder feedback for precise motion control. Commands complete when
target wheel distances are achieved, not after a fixed duration.
2026-01-02 11:12:59 +05:30
codetiger 11d77535db Migrate VastuSLAM config from YAML to TOML
- Replace serde_yaml with toml crate for config parsing
- Make serde_yaml optional behind "scenario" feature flag
- Add config.toml with full documentation
- Add scenario_slam example for running test scenarios
- Clean up release profile settings
- Add dhruva proposal document
2026-01-02 09:56:24 +05:30
codetiger 5eff1eef55 Add Cartographer-style IMU fusion and motion filtering
Implement pose extrapolation with odometry + IMU blending and scan
insertion throttling for improved localization accuracy:

- ImuTracker: gravity estimation and gyroscope integration
- PoseExtrapolator: odometry-primary pose prediction with IMU blending
- MotionFilter: distance/rotation/time-based scan throttling
- ImuMeasurement: 6-axis sensor type with raw i16 conversion
- LocalizerConfig: optional motion filtering configuration
- Localizer: add_imu() and localize_with_timestamp() methods
2026-01-01 18:26:33 +05:30
codetiger e66268db0f Update documentation to reflect VastuSLAM rename and add evaluation module
- Rename DhruvaSLAM references to VastuSLAM throughout CLAUDE.md
- Update module organization to reflect current vastu-slam structure
- Add evaluation module to README.md module table
- Remove obsolete .gitignore and BENCHMARK_LOG.md files
- Minor code formatting fixes in benchmarks
2026-01-01 14:54:32 +05:30
codetiger 95ed452773 Add descriptor matching benchmark 2026-01-01 12:39:32 +05:30
codetiger 7240d83494 Parallelize grid pyramid construction with rayon
Use par_iter for Level 0 cells (742K cells with Gaussian scoring)
and for each coarse level within-level parallelization.

Performance: 1230µs → 670µs (1.84x speedup, 45% improvement)
on 10-core Apple Silicon.
2026-01-01 12:12:48 +05:30
codetiger 939f9bc3ae Add rayon parallelization for scan matching (3.8x speedup)
- Add rayon 1.10 dependency for data parallelism
- Implement search_poses_parallel() with par_iter on outer x-loop
- Add dispatch_search_poses() to choose sequential/parallel mode
- Add use_parallel config flag (default: false for compatibility)
- Add configure_thread_pool(threads, stack_kb) API for embedded
- Update benchmarks to compare sequential vs parallel modes

Performance (10-core Apple Silicon):
- Sequential: 1716 µs
- Parallel: 449 µs
- Speedup: 3.82x

Expected 2-3x speedup on 4-core ARM (Allwinner A33).
2026-01-01 12:00:43 +05:30
codetiger 33c663e95f Optimize scan matching with inlined scoring loop
- Inline score_pose loop in CorrelativeMatcher for better cache locality
- Pre-compute Gaussian scoring constants and sensor offsets outside loop
- Move BENCHMARK_LOG.md to benchmarks/ directory

Performance improvements:
- Scan matching: ~4% faster (360pts: 1793.7 -> 1724.9 µs)
- Grid update: ~10% faster (360pts: 209.88 -> 187.74 µs)
- Combined throughput: 499 -> 523 scans/sec at 360 points
2026-01-01 10:19:01 +05:30
codetiger 5e1bf5c5e5 Add benchmark logging framework and baseline metrics
Introduce BENCHMARK_LOG.md for tracking performance, accuracy, and
quality metrics across commits. Includes baseline.json with initial
measurements from the simplified configuration commit.
2025-12-31 22:20:29 +05:30
codetiger 1321540e16 Simplify vastu-slam configuration and increase default grid size
- Rename header from VastuMap to VastuSLAM
- Increase initial grid from 300x300 to 800x800 cells (20m at 2.5cm)
- Move log_odds config from grid to slam section
- Consolidate pose_graph under slam section
- Remove unused sections: submap, motion_filter, query, pathfinding, exploration
- Adjust correlative matcher defaults for better performance
2025-12-31 20:44:09 +05:30
codetiger 6505a4110f Add Cartographer-style evaluation framework with benchmarks and tests
- Add evaluation module with accuracy, quality, and performance metrics
- Add ground truth handling and relations metrics for SLAM evaluation
- Add criterion benchmarks for scan matching, grid operations, and evaluation
- Add integration tests for accuracy, quality, and performance
- Add Serialize/Deserialize derives to CellCounts for evaluation output
2025-12-31 20:35:48 +05:30
codetiger 66202ef074 Rename vastu-map to vastu-slam and reorganize modules
- Rename package from vastu-map to vastu-slam (v0.3.0)
- Reorganize slam/ module to matching/ for clarity
- Add modes/ module with localization mode
- Add robust matching, traits, and motion core
- Remove explore/, pathfinding/, query/ (moved to dhruva-slam daemon)
- Add README documentation for each module
2025-12-31 17:34:24 +05:30
codetiger 169eba9e2e Split large vastu-map modules into subdirectories
Break down monolithic files into focused submodules:
- config.rs → config/ with separate files per concern
- exploration/ → explore/controller/ with state machine
- grid/storage.rs → grid/storage/ module
- pathfinding/astar.rs → pathfinding/astar/ module
- query/traversability.rs → query/traversability/ module
- slam/matcher.rs → slam/matcher/ with helpers

Add new SLAM components:
- branch_bound/ for scan matching optimization
- background_optimizer.rs for async graph optimization

Add new explore components:
- error.rs, motion_filter.rs, velocity.rs
2025-12-31 12:07:15 +05:30
codetiger 4270670fc7 Refactor vastu-map with new modular architecture
Replace old monolithic modules (extraction, features, integration,
loop_closure, matching, vector_map, cbvg) with new streamlined
architecture including grid, slam, pathfinding, submap, and io modules.
Simplify core types and exploration controller.
2025-12-30 21:11:51 +05:30
codetiger 0980b31e77 Refactor CBVG for ray-based node creation and angular frontier detection
Major improvements to the Clearance-Based Visibility Graph (CBVG) system:

CBVG Graph:
- Replace grid-based node generation with ray-based placement along lidar scans
- Add angular gap analysis for frontier detection (nodes with uncovered sectors)
- Add clique optimization for merging redundant nodes
- Add path planning with node exclusion for alternative approach angles
- Increase max_nodes to 5000 for large multi-room layouts
- Add configurable max_lidar_range for node creation

Exploration Controller:
- Track CBVG goal nodes that led to collision for each frontier
- Add oscillation detection and frontier suppression
- Implement multi-attempt collision recovery before marking unreachable
- Plan alternative paths by excluding previously failed goal nodes
- Handle collisions during recovery state

Vector Map:
- Add get_path_excluding_nodes() for alternative approach planning
- Integrate CBVG-based frontier detection with configurable parameters

Other:
- Scan module: Include max-range readings for open-space node creation
- Example: Add command-line map file selection
- Temporarily disable release optimizations for debugging
2025-12-27 10:24:08 +05:30
codetiger f08c4538fa Add random map and position selection for exploration example
Add pixel_to_world() coordinate conversion to SimulationMap, enabling
the exploration example to randomly select maps from the data/maps
directory and find valid start positions with sufficient clearance.
This makes test runs more varied and robust.
2025-12-24 17:07:09 +05:30
codetiger 5cf2a3cc81 Move test harness from library to example-local module
The harness is only used by the exploration example, not as part of
the public API. This change:

- Moves harness from src/harness/ to examples/exploration/harness/
- Removes integration-tests feature flag from Cargo.toml
- Moves sangam-io, svg, image to dev-dependencies
- Removes unused scenario module and path.rs

Example now runs with: cargo run --example exploration --release
2025-12-24 16:49:48 +05:30
codetiger 2eb6b6ce42 Refactor test harness into library module for reusability
Move integration test harness from tests/integration/ to src/harness/
as a feature-gated library module, enabling use by examples and tools.

- Add pub mod harness (behind integration-tests feature)
- Reorganize data files into data/maps/ and data/scenarios/
- Convert integration test to exploration example
- Remove test-only boilerplate (mod.rs, yaml_tests.rs)
2025-12-24 09:36:25 +05:30
codetiger c6634b4ac3 Add SIMD optimizations and spatial indexing for ICP performance
SIMD-optimize core math and line fitting functions using f32x4:
- compute_centroid and compute_covariance for 4+ point batches
- fitting_error and max_distance_point in line fitting
- find_best_split_point in split-merge extraction
- New optimize_pose_simd using CorrespondenceSoA for ~30-40% speedup

Add LineSpatialIndex for O(n×k) correspondence search:
- Grid-based spatial hash reduces ICP from O(n×m) to O(n×k)
- Automatic threshold (30+ lines, 8m+ extent) for index use
- Integrated into ICP matcher with brute-force fallback for small maps
- New match_scan_indexed and find_correspondences_indexed methods
2025-12-24 08:36:22 +05:30
codetiger 9b2a11f3fa Remove dead code from vastu-map
Delete unused modules and functions that are no longer referenced:
- preprocessing.rs: Entire module (outlier removal, downsampling)
- nearest_neighbor.rs: SIMD/batch/weighted/spatial variants
- gauss_newton.rs: optimize_pose_simd (SIMD variant)
- line_fitting.rs: LineFitConfig, _checked variants
- raycast.rs: Indexed/batch raycast variants
- Line2D: perpendicular_at, extended, project_point_onto_line
- occupancy.rs: Batch/indexed query variants
- Various unused helpers in bounds, math, corner modules

Reduces codebase by ~2600 lines while preserving all active functionality.
2025-12-23 23:09:51 +05:30
codetiger a78735dbd0 Add Clearance-Based Visibility Graph (CBVG) for safe path planning
Replace the corner-based visibility graph with a new CBVG algorithm
that places navigation nodes along the medial axis of free space.

Key changes:
- Add cbvg module with Voronoi-based medial axis approximation
- Nodes placed at safe distances from walls (configurable clearance)
- Adaptive clearance for narrow passages
- Visibility region tracking for explored area awareness
- Integrate CBVG into VectorMap with nearest_cbvg_node() API

PathFollower changes:
- Remove pure pursuit lookahead logic
- Follow CBVG waypoints sequentially for predictable navigation

Configuration:
- New cbvg config section with min_clearance, voronoi_sample_step, etc.
- Remove old path_planning config

This provides safer robot navigation by routing through corridor
centerlines rather than wall corners.
2025-12-23 22:00:24 +05:30
codetiger f3ed6fbb64 Add region-based exploration with gap frontier detection
Refactor exploration to use hierarchical region-based planning instead
of greedy closest-frontier selection. This eliminates ping-pong behavior
and improves coverage efficiency.

Key changes:
- Gap-based frontier detection: frontiers are now viewpoints to observe
  unexplored gaps between unconnected wall endpoints, not the endpoints
  themselves. Each frontier has a safe viewpoint, look direction, and
  estimated unexplored area.
- Region clustering: frontiers grouped using union-find clustering,
  enabling systematic area-by-area exploration
- TSP-ordered planning: regions ordered using greedy TSP to minimize
  travel distance while maintaining coverage
- Exploration history: spatial grid tracks visited areas to penalize
  backtracking and improve region prioritization
- Unreachable frontier recovery: clears unreachable list when robot
  moves 1.5m, allowing retry from new positions

New modules: history.rs, planner.rs, region.rs
Updated: Frontier struct (viewpoint/look_direction/endpoint/area)
2025-12-23 18:48:51 +05:30
codetiger 770ee910f0 Refactor: code cleanup and modularization
- Remove duplicate VectorMapConfig from src/config.rs (kept in vector_map/config.rs)
- Add shared geometry utilities to src/core/math.rs (centroid, covariance, principal direction)
- Consolidate fit_line() and fit_line_checked() via shared implementation
- Update ransac_lines.rs to use shared geometry utilities
- Split loop_closure/mod.rs (778 lines) into 4 focused submodules:
  - config.rs: LoopClosureConfig
  - detector.rs: LoopClosureDetector implementation
  - traits.rs: LoopDetector trait
  - types.rs: Keyframe, LoopClosure structs

Net reduction: ~836 lines of duplicated code
2025-12-22 18:01:17 +05:30
codetiger 68242ca310 Add YAML configuration file support for VectorMap
Enable loading algorithm parameters from YAML files for reproducible
experiments and easier parameter tuning without recompilation.

- Add yaml.rs module with from_yaml_file/to_yaml_file methods
- Add Serialize/Deserialize derives to all config structs
- Add finalize() method to recompute derived fields after deserialization
- Add configs/default.yaml reference configuration with documentation
- Update test harness to load config from VASTU_MAP_CONFIG env var
- Move serde/serde_yaml to main dependencies
2025-12-22 17:27:24 +05:30
codetiger 6f9df02675 Add exploration mode with point-cloud-based line re-fitting
Implements a new exploration mode that stores raw scan data and periodically
re-fits lines from accumulated point clouds, eliminating first-scan bias in
line extraction.

New modules:
- scan_store: Retains raw scans with pose tracking and memory management
- point_association: Associates world-frame points with existing map lines
- refitter: Re-fits lines from accumulated points with gap detection/splitting

Key features:
- ExplorationConfig for controlling re-fit intervals and thresholds
- LineFitConfig with max_line_length splitting for robustness
- Line2D point_count field for tracking scan point origins
- Gap-based line splitting during re-fitting
- Range-based weighting using noise model during fitting
2025-12-22 16:53:04 +05:30
codetiger d6acdd4a88 Add exploration module with path following and collision handling
- Add exploration controller with frontier-based autonomous exploration
- Add path follower with pure-pursuit algorithm and velocity commands
- Add collision detection with virtual walls and recovery behaviors
- Fix wheel odometry to return robot-frame deltas (not world-frame)
- Add step-by-step simulation API in test harness for exploration tests
2025-12-22 13:56:49 +05:30
codetiger 9f339d3d29 Add wheel odometry, scan preprocessing, and visibility graph path planning
- Add odometry module with WheelOdometry for differential drive robots
  using arc-based motion integration (ROS REP-103 convention)
- Add preprocessing module with outlier removal and voxel downsampling
  for point cloud filtering
- Add path_planning module with visibility graph and Dijkstra's algorithm
  for optimal shortest-path planning around obstacles
- Implement get_path() and is_path_clear() on VectorMap using the new
  path planner
- Update test harness to simulate encoder ticks and use WheelOdometry
  instead of ground-truth-derived relative odometry
2025-12-22 09:20:49 +05:30
codetiger 324d1f36ac Move test-only dependencies to dev-dependencies and update versions
- Move approx and serde to dev-dependencies (not needed at runtime)
- Update svg from 0.17 to 0.18
- Update criterion from 0.5 to 0.8
- Remove unused release-with-debug profile
2025-12-21 20:21:16 +05:30
codetiger 4d2da6e0e7 Add zero-allocation APIs, ICP presets, and configuration validation
- Add zero-allocation methods: compute_weights_into, compute_weights_for_cloud,
  to_cartesian_into for hot-path performance
- Add FitError enum and fit_line_checked for explicit error handling in line fitting
- Add Line2D helpers: perpendicular_at, extended, contains_projection_extended
- Extract validate_correspondence_candidate helper for cleaner matching code
- Add ICP preset configurations: fast, accurate, robust, balanced
- Add configurable quality score weights (distance_weight, angle_weight) to AssociationConfig
- Add ConfigError and VectorMapConfig::validate() for configuration validation
2025-12-21 16:00:25 +05:30
codetiger 0b6086b704 Add SIMD fused distance/projection computation and cache optimizations
- Add distances_and_projections_into() to LineCollection for single-pass
  computation with SIMD, improving cache locality over separate calls
- SIMD-optimize transform_points() in IcpScratchSpace (4 points per iteration)
- Add LineDataRaw struct to group line properties for cleaner correspondence API
- Simplify CorrespondenceSoA::push_inline() to take LineDataRaw instead of 7 params
- Remove simd module (std::simd documentation no longer needed as separate module)
2025-12-21 15:22:21 +05:30
codetiger dfbb33bb4a Add zero-allocation scratch space for RANSAC, ICP, and frontier detection
Eliminate per-frame allocations in real-time SLAM pipeline by introducing
reusable scratch buffers:

- RansacScratchSpace: Pre-allocated buffers for RANSAC line extraction
  with extract_lines_ransac_with_scratch and hybrid variant
- IcpScratchSpace: Extended with subsampling buffers for multi-resolution
  matching; PointToLineIcp now holds internal scratch
- FrontierDetector: Persistent spatial hash grid and output buffers
- ObserveScratchSpace: Buffers for VectorMap observe pipeline
- CorrespondenceSet: In-place retain_by_distance/retain_within_segment

ScanMatcher trait methods changed from &self to &mut self to support
internal scratch space usage.
2025-12-21 12:19:08 +05:30
codetiger 06b0b06fe8 Migrate to std::simd and add SIMD-optimized SoA ICP
- Replace custom Float4 wrapper with std::simd::f32x4 (portable_simd)
- Add CorrespondenceSoA with inlined line data for contiguous SIMD loads
- Add optimize_pose_simd() and find_correspondences_soa() functions
- Simplify cargo LLVM flags (explicit SIMD vs auto-vectorization)
- Add rust-toolchain.toml for nightly channel requirement

The SoA layout inlines line normals and endpoints at correspondence
creation time, enabling ~4x faster Gauss-Newton optimization by
avoiding indexed access in the hot loop.
2025-12-21 11:05:00 +05:30
codetiger 4e18920721 Add timing instrumentation to VectorMap observe pipeline
Add TimingBreakdown struct to track per-stage timing (ICP matching,
line extraction, corner detection, association, merging, new features,
loop closure) with microsecond precision. Integration test harness now
collects and prints timing summaries.

Also clean up integration tests by removing unused odometry module and
simplifying path_generator to only include PathSegment (unused PathGenerator
methods removed).
2025-12-21 10:24:54 +05:30
codetiger a21dfcdd3e Add robust ICP with M-estimators, multi-resolution matching, and RANSAC line extraction
Major improvements to scan matching accuracy and convergence:

- Add Levenberg-Marquardt damping to Gauss-Newton solver for robust convergence
  from poor initial guesses (replaces pure Gauss-Newton)
- Add IRLS (Iteratively Reweighted Least Squares) with M-estimators:
  Huber (default), Cauchy, Tukey, Geman-McClure for soft outlier rejection
- Add multi-resolution ICP (coarse-to-fine) for better convergence
- Add corner correspondences for point-to-point constraints
- Add DOF-corrected covariance computation for accurate uncertainty

Line extraction improvements:
- Add RANSAC-based line extraction for robustness to outliers
- Add hybrid extraction mode (RANSAC + split-merge)

New modules:
- src/matching/robust.rs: M-estimator cost functions
- src/motion_model.rs: Constant-velocity motion model for pose prediction
- src/extraction/ransac_lines.rs: RANSAC line extraction

Test harness:
- Add fast mode (~22x speedup) for integration tests
- Simplify observation records
2025-12-20 22:39:27 +05:30