Skip to content

Conversation

@viplix3
Copy link

@viplix3 viplix3 commented Jul 15, 2025

Adds a new IntensityOcTree / IntensityOcTreeNode that stores a single double intensity per leaf (same layout & API style as ColorOcTree).

  • integrateNodeIntensity() averages intensity weighted by occupancy; inner-node update & prune mirror ColorOcTree.
  • Useful for downstream intensity-based filtering / weighting without keeping an external map.
  • I/O, prune, and OpenMP paths unchanged

@ahornung
Copy link
Member

Thanks! Any chance to add a few unit tests well?

Adds a new Octree implementation that stores intensity values in addition to occupancy probability.

This new tree type allows for representing intensity information alongside spatial occupancy, enabling applications that require both geometric and radiometric data.
Ensures that intensity values are correctly propagated to child nodes when expanding an IntensityOcTreeNode.

This change addresses a potential issue where newly created child nodes in an expanded node would not inherit the intensity of their parent, leading to inaccurate intensity representation in the octree.
Adds methods for intensity integration, pruning, and averaging
in IntensityOcTree, enhancing node management and data consistency.

Also introduces a small epsilon value to avoid division by zero.

Removes unused intensity integration method

Removes the unused `integrateNodeIntensity` method that takes an `IntensityOcTreeNode` and weight as input.
This simplifies the API and removes potentially confusing or redundant methods.
Updates inner node occupancy recursively for intensity octrees.

This change ensures that the intensity values of inner nodes are correctly
updated based on the children's values, leading to a more accurate
representation of the intensity distribution in the octree.
Adds a `computeUpdateKeys` method to `IntensityOcTree`.

This method allows to compute the set of free and occupied cells
corresponding to a pointcloud, using an alternative interface
based on octomath vectors.
Improves the efficiency of the inner node occupancy update process by adding a condition to check for the presence of children before recursively updating occupancy.

This avoids unnecessary processing when a node has no children, leading to performance gains, especially in sparse octrees.
Copilot AI review requested due to automatic review settings December 20, 2025 16:16
@viplix3 viplix3 force-pushed the feature/add-intensity branch from eb06b0e to 540f48a Compare December 20, 2025 16:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new IntensityOcTree class that extends OctoMap with per-voxel intensity storage, mirroring the design of the existing ColorOcTree but storing a single double intensity value per leaf node instead of RGB color values.

Key Changes:

  • Introduces IntensityOcTreeNode with intensity payload and weighted averaging based on occupancy probability
  • Implements IntensityOcTree with integration, pruning, and inner node update functionality
  • Follows the same API patterns as ColorOcTree for consistency

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.

File Description
octomap/include/octomap/IntensityOcTree.h Declares IntensityOcTreeNode and IntensityOcTree classes with intensity storage, getters/setters, serialization methods, and tree operations
octomap/src/IntensityOcTree.cpp Implements I/O operations, intensity averaging, node integration with occupancy-weighted updates, and pruning logic
octomap/src/CMakeLists.txt Adds IntensityOcTree.cpp to the build sources list

Critical Issues Identified:

  1. Missing static member definition will cause linker errors
  2. Inline function defined in .cpp instead of header
  3. Intensity integration formula inconsistent with ColorOcTree and doesn't properly weight values
  4. Floating-point equality comparison in operator==
  5. Ambiguous "unset" intensity state (0.0 treated as unset)
  6. Missing test coverage despite comprehensive tests existing for similar ColorOcTree

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

viplix3 and others added 2 commits December 20, 2025 20:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@viplix3 viplix3 marked this pull request as draft December 20, 2025 16:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@viplix3 viplix3 marked this pull request as ready for review December 20, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants