Back to packages

robonix.service.minecraft_costmap

Minecraft depth and exact-odometry 2D mapping service.

README

Minecraft costmap service

This Robonix service turns the Forge Mod's exact odometry and 32FC1 depth stream into a Nav2-compatible 2D occupancy grid. It is intentionally not a SLAM implementation: Minecraft already supplies drift-free world position, so the service only performs depth projection, free-space raytracing, and log-odds occupancy updates. Free-space projection stops each sampled image column at its nearest obstacle within the configured height range so farther ground in the same frame does not clear cells behind a wall. Confirmed occupied cells also stop later free-space rays and are retained during robot footprint clearing, preventing motion along a wall from exposing unknown space behind it.

The default grid is 128 m square at 0.25 m resolution and is anchored around the first odometry pose. It publishes:

  • /minecraft/map/pose as geometry_msgs/PoseWithCovarianceStamped
  • /minecraft/map as latched nav_msgs/OccupancyGrid

Both topics are declared through the existing robonix/service/map/* contracts. Inputs are resolved from Atlas rather than hardcoded.

Compatibility

  • ROS 2 Jazzy
  • Robonix development baseline 74b4ca0f7c0db3c237730321753501e12646c626

The service tracks the latest Robonix development version. Compatibility is verified again for every service release.

Build

With rbnx installed and configured against a compatible Robonix source tree:

rbnx validate .
rbnx build -p .

The build generates ROS 2 bindings and runs the pure mapping tests. Runtime initialization additionally requires active depth, camera extrinsics, and chassis odometry providers discoverable through Atlas.

Configuration

  • resolution: cell size in metres, default 0.25.
  • size_m: fixed square map width, default 128.
  • vertical_fov_deg: Minecraft view field of view, default 70.
  • pixel_stride: depth subsampling interval, default 12.
  • min_depth_m, max_depth_m: accepted forward depth range, defaults 0.2 and 32.
  • min_obstacle_height_m, max_obstacle_height_m: occupied endpoint height above the inferred ground, defaults 0.15 and 2.5.
  • nominal_eye_height_m: eye height used to infer ground, default 1.62.
  • robot_clear_radius_m: footprint kept free except for confirmed occupied cells, default 0.4.
  • publish_interval_sec: minimum grid publication interval, default 0.5.
  • odom_match_tolerance_sec: maximum accepted time difference between a depth frame and its bracketing odometry samples, default 0.25.
  • input_timeout_sec: Atlas input resolution timeout, default 30.
  • pose_topic, occupancy_grid_topic: optional output topic overrides.

The complete accepted configuration, including units and validation ranges, is documented in config.spec.

Provenance

This service was extracted from examples/minecraft-mod/services/minecraft_costmap in syswonder/robonix at commit e30b99b4ca606d5a3463e9c42d7df2de81d680c4. It is distributed under the MulanPSL-2.0 license included in this repository.