Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

Rolling-Bonxai

> 编程语言
Open source

A rolling voxel grid implementation of Bonxai to handle large maps in ROS 2

187 stars0 likes2 views
WebsiteGitHub

About

A rolling voxel grid implementation of Bonxai to handle large maps in ROS 2

Rolling-Bonxai is a C++ 17 implementation built on top of Bonxai:https://github.com/facontidavide/Bonxai. Memory remains a bottleneck for resource constrained robots (like drones) that have to map and navigate in very large areas. In these large areas, the robot will likely not need other parts of the map besides some local area to do path planning/local planning. Therefore, these storing unnecessary parts of the map in memory is wasteful. Rolling Bonxai implements a chunking system (like in games) comprising of NxNxN voxels each. Each chunk is a Bonxai::OccupancyGrid that can be loaded/created or offloaded depending on the robot's position. Unused parts of the maps are serialized and saved to disk and loaded when required depending on a user defined policy. The underlying Bonxai library implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized as Voxel Grids in a manner that is both sparse and unbounded. Star this repo if you found this useful/interesting :)

Rolling-Bonxai In Action

1. Position-based chunk eviction

Full Video Here: https://youtu.be/gStI7W-x3mM

Green and Blue semi-transparent cubes are "Dirty" and "Clean" chunks. Dirty chunks are those that have been updated since the last time it was loaded into memory, while clean ones have not. Chunks that contain voxels are dirty. As the sensor moves, chunks are evicted based on some policy. In this case, it is a position based policy, where chunks that are not one of the 26 neibors of the current chunk are evicted from memory.

2. Position-based chunk loading from disc

Full Video Here: https://youtu.be/h4DjMLnnrf4

Table of Contents

  1. Prerequisites
  2. Launching Rolling Bonxai
  3. Parameter Reference
  4. Architecture Overview
  5. Data Flow Diagram

Prerequisites

Rolling Bonxai requires a point cloud source published as a sensor_msgs/PointCloud2 topic in the ROS 2 graph. This is typically provided by a depth camera (e.g., ZED2i) or a LiDAR sensor. You must configure topic_in to match the topic your sensor is publishing on, and ensure TF transforms are available from your sensor frame to the frame_id (map frame).

Required ROS 2 packages and dependencies:

  • bonxai_core, bonxai_map, rolling_bonxai, rolling_bonxai_msgs
  • rclcpp, sensor_msgs, tf2_ros, pcl_conversions
  • yaml-cpp

Build your workspace with:

bash
colcon build --packages-select bonxai_core bonxai_map rolling_bonxai rolling_bonxai_msgs rolling_bonxai_ros
source install/setup.bash

Launching Rolling Bonxai

Option 1: As a Composable Node (Recommended for Production)

The composable node option runs RollingBonxaiServer inside an rclcpp_components container, enabling zero-copy intra-process communication when combined with other composable nodes (e.g., the ZED camera wrapper).

bash
ros2 launch rolling_bonxai_ros rolling_bonxai_mapping.launch.py

You can override the container name and Foxglove visualization port:

bash
ros2 launch rolling_bonxai_ros rolling_bonxai_mapping.launch.py \
  container_name:=my_container \
  foxglove_port:=8765

The launch file will:

  1. Start an rclcpp_components container
  2. Load RollingBonxai::RollingBonxaiServer into that container
  3. Start a Foxglove Bridge for visualization

Point cloud source: The node subscribes to the topic defined in topic_in (default: /zed/zed_node/point_cloud/cloud_registered). Make sure your sensor driver is running and publishing to this topic before or alongside this launch file.

Option 2: As a Standalone Executable

For simpler setups or debugging, run the standalone binary directly:

bash
ros2 run rolling_bonxai_ros rolling_bonxai_server_node \
  --ros-args --params-file /path/to/rolling_bonxai_params.yaml

Or pass parameters individually:

bash
ros2 run rolling_bonxai_ros rolling_bonxai_server_node \
  --ros-args \
  -p frame_id:=map \
  -p topic_in:=/your/pointcloud/topic \
  -p occupancy.resolution:=0.05

Option 3: Using a Params File

The recommended way to configure the node is to provide a YAML parameters file (see rolling_bonxai_ros/params/rolling_bonxai_params.yaml as a template):

bash
ros2 run rolling_bonxai_ros rolling_bonxai_server_node \
  --ros-args --params-file rolling_bonxai_params.yaml

Parameter Reference

All parameters are scoped under rolling_bonxai_server_node/ros__parameters/. The YAML hierarchy below mirrors the parameter file structure.

Core Frame & Topic

Parameter Type Default Unit / Significance
frame_id string "map" The global fixed frame. All map data is stored in this frame.
base_frame_id string "base_footprint" The robot base frame used for TF lookups.
topic_in string "/points" The sensor_msgs/PointCloud2 topic to subscribe to. Must match your sensor's output topic.

Occupancy Settings (occupancy.*)

Parameter Type Default Unit / Significance
occupancy.resolution double 0.05 Meters (m). Side length of each cubic voxel. Smaller = finer detail but higher memory usage. Typical range: 0.02–0.2 m.
occupancy.occupancy_min_z double -100.0 Meters (m). Points below this Z coordinate (in the map frame) are discarded before insertion. Useful to cut out the ground or underground clutter.
occupancy.occupancy_max_z double 100.0 Meters (m). Points above this Z coordinate are discarded. Useful to remove ceiling returns or high-altitude noise.
occupancy.occupancy_threshold double 0.50 Unitless probability [0, 1]. A voxel with log-odds corresponding to this probability is considered on the boundary between occupied and free. Voxels above this are occupied; below are free. The default of 0.5 means equal probability.

Sensor Model (sensor_model.*)

These parameters control the Bayesian occupancy update. All probability values are converted internally to log-odds with a fixed-point scale of 1×10⁶.

Parameter Type Default Unit / Significance
sensor_model.max_range double 30.0 Meters (m). Points beyond this range are clipped to the maximum range and treated as free-space measurements rather than hits.
sensor_model.hit double 0.7 Unitless probability [0, 1]. Probability that a voxel is occupied given a sensor return. Higher values make the map respond faster to obstacles but may cause noise.
sensor_model.miss double 0.4 Unitless probability [0, 1]. Probability of occupancy given a ray passes through without a return. Lower values clear free space more aggressively.
sensor_model.min double 0.12 Unitless probability [0, 1]. Minimum clamping probability. Prevents a voxel from ever being considered more free than this. Stops the map from being over-confident about free space.
sensor_model.max double 0.97 Unitless probability [0, 1]. Maximum clamping probability. Prevents a voxel from becoming more occupied than this. Allows obstacles to eventually be cleared if the sensor reports free space there.

Rolling / Coordinate System (rolling.coordinate_system.*)

Parameter Type Default Unit / Significance
rolling.coordinate_system.chunk_size double 5.0 Meters (m). The side length of each cubic chunk. Each chunk wraps one OccupancyMap. Larger chunks reduce I/O frequency but increase per-chunk memory. Typical range: 2–20 m.

Rolling / Transition Manager (rolling.transition_manager.*)

Parameter Type Default Unit / Significance
rolling.transition_manager.hysteresis_ratio double 0.2 Unitless [0.01, 1.0]. Fraction of chunk_size that the robot must penetrate into a new chunk before a chunk transition is confirmed. For example, with chunk_size=5.0 and hysteresis_ratio=0.2, the robot must travel 1.0 m into the new chunk before any load/evict cycle fires. Higher values reduce I/O thrashing near boundaries at the cost of slightly delayed chunk loading.

Rolling / Loading Policy (rolling.loading_policy.*)

Parameter Type Default Unit / Significance
rolling.loading_policy.name string "neighbourhood" Unitless string. Selects the chunk management strategy. Options: "neighbourhood", "planar", "temporal".

Neighbourhood Policy (rolling.loading_policy.neighborhood.*):

Parameter Type Default Unit / Significance
neighborhood.radius int 2 Unitless (chunks). Chebyshev radius — loads all chunks within this many chunk-lengths in every direction. Radius 1 → 26 neighbours; radius 2 → 124 neighbours. Increase for faster robots.

Planar Policy (rolling.loading_policy.planar.*):

Parameter Type Default Unit / Significance
planar.radius int 1 Unitless (chunks). Horizontal (XY-plane) Chebyshev radius. Same as neighbourhood radius but applied only on the ground plane.
planar.z_min int 0 Unitless (chunks). Under use_relative=false: minimum absolute Z chunk coordinate to keep loaded. Under use_relative=true: number of chunks below the ego to keep loaded (must be ≥ 0).
planar.z_max int 2 Unitless (chunks). Under use_relative=false: maximum absolute Z chunk coordinate. Under use_relative=true: number of chunks above the ego to keep loaded (must be ≥ 0).
planar.use_relative bool false Unitless boolean. If true, z_min and z_max are relative offsets from the robot's current Z chunk rather than absolute chunk coordinates. Recommended for ground robots that operate at varying elevations.

Temporal Policy (rolling.loading_policy.temporal.*):

Parameter Type Default Unit / Significance
temporal.radius int 2 Unitless (chunks). Chebyshev radius, same as neighbourhood.
temporal.age_weightage double 0.3 Unitless [0.0, 1.0]. Blend factor between distance-based priority (0.0) and age-based priority (1.0). A value of 0.3 means 70% distance priority + 30% freshness priority when ordering load requests.
temporal.max_age_s int 300 Seconds (s). Chunks older than this are considered stale and excluded from loading. Useful in dynamic environments.

Rolling / Storage (rolling.storage.*)

Parameter Type Default Unit / Significance
rolling.storage.full_save_folder_path string "" Unitless path string. Full filesystem path where chunk files (.chunk) and timestamp files (.timestamp) are saved to and loaded from. Must be readable and writable by the process. Example: "/home/robot/bonxai_chunks".

Rolling / Async I/O (rolling.asyncio.*)

Parameter Type Default Unit / Significance
rolling.asyncio.enable_io bool false Unitless boolean. Master switch for disk I/O. When false, chunks are never saved or loaded from disk — the map is purely in-memory. Set to true for persistent, large-area mapping.
rolling.asyncio.num_load_threads int 3 Unitless (thread count). Number of dedicated worker threads for loading chunks from disk. Higher values allow more concurrent loads but consume mo

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++3d-mappingnavigationros2

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言