Skip to content

Conversation

@hassaan141
Copy link
Contributor

@hassaan141 hassaan141 commented Feb 2, 2026

Adding the voxel grid implementation. Also changed a lot of the insfrastrcutre stuff bc it the containrs werent spinning up properly.

Can visualize dummy image voxels on foxglove until real camera is found

Screen.Recording.2026-02-02.at.8.17.02.PM.mov

Copy link
Contributor

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 voxel grid implementation for 3D scene representation from depth camera data, along with infrastructure improvements to fix container configuration issues. The implementation includes a ROS2 voxel grid node, a dummy camera publisher for testing, and placeholder octomap integration.

Changes:

  • Added voxel grid generation using spconv library with ROS2 integration
  • Created dummy camera publisher node for testing without real hardware
  • Added docker configurations for perception, behaviour (voxel_grid, octomap), and simulation modules
  • Updated infrastructure scripts to support new behaviour module

Reviewed changes

Copilot reviewed 34 out of 40 changed files in this pull request and generated 38 comments.

Show a summary per file
File Description
watod_scripts/watod-setup-docker-env.sh Added behaviour module support and new image environment variables
watod-config.sh Added behaviour module to active modules list with trailing whitespace
utils/voxel/test_voxel.py Test script for voxel grid generation using spconv with bunny data
utils/voxel/ros2_voxel.py Initial ROS2 voxel node prototype with missing imports
utils/voxel/readme.md Setup instructions for spconv installation
utils/create_package.bash Changed service name from 'interfacing' to 'samples'
modules/docker-compose.simulation.yaml New docker-compose configuration for simulation module
modules/docker-compose.perception.yaml New docker-compose configuration for perception module
modules/docker-compose.infrastructure.yaml Split foxglove into deploy and dev services, changed build target
modules/docker-compose.behaviour.yaml New docker-compose for voxel_grid and octo_map services
docker/perception/perception.Dockerfile Dockerfile for perception module with spconv dependencies
docker/infrastructure/foxglove/foxglove.Dockerfile Disabled rosdep scanning, using empty install list
docker/behaviour/voxel_grid/voxel_grid.Dockerfile Dockerfile for voxel_grid with spconv and torch
docker/behaviour/voxel_grid/.dockerignore Dockerignore for voxel_grid builds
docker/behaviour/octo_map/octo_map.Dockerfile Dockerfile for octomap with incorrect workspace path
autonomy/perception/setup.py ROS2 Python package setup with dummy_publisher_node entry point
autonomy/perception/setup.cfg Package configuration for perception
autonomy/perception/perception/dummy_publisher_node.py Dummy camera publisher generating synthetic RGB-D data at 1Hz
autonomy/perception/package.xml Package manifest with commented dependencies
autonomy/perception/launch/perception.launch.py Launch file referencing non-existent perception_node
autonomy/perception/config/perception_config.yaml Configuration parameters for perception pipeline
autonomy/behaviour/voxel_grid/voxel_grid/voxel_grid_node.py Main voxel grid node implementation with depth decoding and voxelization
autonomy/behaviour/voxel_grid/setup.py ROS2 package setup for voxel_grid
autonomy/behaviour/voxel_grid/setup.cfg Package configuration for voxel_grid
autonomy/behaviour/voxel_grid/package.xml Package manifest for voxel_grid
autonomy/behaviour/voxel_grid/launch/voxel_grid.launch.py Launch file for voxel_grid_node
autonomy/behaviour/octo_map/setup.py ROS2 package setup for octo_map with incorrect setup.cfg
autonomy/behaviour/octo_map/setup.cfg Package configuration with wrong paths (references voxel_grid)
autonomy/behaviour/octo_map/resource/octo_map Resource marker with wrong content (contains 'voxel_grid')
autonomy/behaviour/octo_map/package.xml Package manifest for octo_map
autonomy/behaviour/octo_map/octo_map/octo_map_node.py Stub octomap node with missing method implementation
autonomy/behaviour/octo_map/launch/octo_map.launch.py Launch file for octo_map_node
.gitignore Added spconv directory to gitignore

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

points = []
h, w = depth.shape

for v in range(0, h, 4): #Skipping every 4 pixels to downsample, can change if nessary
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Typo in comment: 'nessary' should be 'necessary'. The comment on this line has a spelling error.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +2 to +4
script-dir=$base/lib/voxel_grid
[install]
install-scripts=$base/lib/voxel_grid No newline at end of file
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Incorrect paths in setup.cfg. The script_dir and install_scripts paths reference 'voxel_grid' but this is the octo_map package. They should reference 'octo_map' instead.

Suggested change
script-dir=$base/lib/voxel_grid
[install]
install-scripts=$base/lib/voxel_grid
script-dir=$base/lib/octo_map
[install]
install-scripts=$base/lib/octo_map

Copilot uses AI. Check for mistakes.
################################ Source ################################
FROM ${BASE_IMAGE} AS source

ARG AMENT_WS=/home/wato/wato_ws
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Inconsistent workspace path. This Dockerfile uses '/home/wato/wato_ws' for AMENT_WS (line 6), while the other behaviour Dockerfiles use '/root/ament_ws'. This inconsistency could cause issues with build and runtime paths. The path should be '/root/ament_ws' to match the pattern in voxel_grid.Dockerfile.

Suggested change
ARG AMENT_WS=/home/wato/wato_ws
ARG AMENT_WS=/root/ament_ws

Copilot uses AI. Check for mistakes.
rm -rf /root/* /root/.ros /tmp/* /var/lib/apt/lists/* /usr/share/doc/*

################################ Build ################################
FROM dependencies AS build
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The AMENT_WS variable is not declared before being used in the colcon build command on line 83. This will fail because the variable was declared in the 'source' stage (line 6) but we're now in the 'build' stage. Add 'ARG AMENT_WS=/root/ament_ws' before the WORKDIR command (or use the corrected path '/root/ament_ws' after fixing the path issue).

Suggested change
FROM dependencies AS build
FROM dependencies AS build
ARG AMENT_WS=/home/wato/wato_ws

Copilot uses AI. Check for mistakes.
# RUN rosdep update
# RUN rosdep install --from-paths . --ignore-src -r -s \
# | grep 'apt-get install' \
# | awk '{print $3}' \Is
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Stray characters in commented code. The sequence '\Is' appears at the end of line 16, which seems unintentional. This should be removed or the comment should be properly formatted.

Suggested change
# | awk '{print $3}' \Is
# | awk '{print $3}' \

Copilot uses AI. Check for mistakes.

try:
rclpy.spin(node)
except KeyboardInterrupt:
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Copilot uses AI. Check for mistakes.
try:
rclpy.spin(node)
except KeyboardInterrupt:
pass
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
pass
node.get_logger().info('Shutting down due to KeyboardInterrupt')

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +73
RUN python3 -m pip install --no-cache-dir \
pccm>=0.4.16 \
ccimport>=0.4.4 \
pybind11>=2.6.0 \
numpy \
fire \
cv_bridge \
opencv-python

# Install prebuilt spconv-cu120 (compatible with CUDA 12.2 due to minor version compatibility)
RUN python3 -m pip install --no-cache-dir spconv-cu120
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The python3 -m pip install commands here install multiple third-party packages (such as pccm, ccimport, pybind11, numpy, fire, cv_bridge, opencv-python, and spconv-cu120) directly from PyPI using loose or unspecified versions and without any integrity verification. If any of these packages (or their transitive dependencies) are compromised, rebuilding this image will automatically pull and execute attacker-controlled code during the Docker build or at runtime, potentially compromising the container and any secrets or build artifacts it can access. Pin these dependencies to specific, vetted versions and use mechanisms like constraints files or hash checking so that only expected package artifacts are installed.

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +71
RUN python3 -m pip install --no-cache-dir \
pccm>=0.4.16 \
ccimport>=0.4.4 \
pybind11>=2.6.0 \
numpy \
fire \
torch

# Install prebuilt spconv-cu120 (compatible with CUDA 12.2 due to minor version compatibility)
RUN python3 -m pip install --no-cache-dir spconv-cu120
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The python3 -m pip install commands here install third-party Python packages (pccm, ccimport, pybind11, numpy, fire, torch, and spconv-cu120) directly from PyPI using open-ended or unspecified versions and without any integrity verification. A compromise of any of these packages would cause future image builds to fetch and execute malicious code with the privileges and network access of this container, which can lead to full compromise of the running behaviour node or its environment. Pin these dependencies to specific, reviewed versions and enable stronger verification (for example via constraints files and hash checking) to reduce supply chain risk.

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +72
RUN python3 -m pip install --no-cache-dir \
pccm>=0.4.16 \
ccimport>=0.4.4 \
pybind11>=2.6.0 \
numpy \
fire \
cv_bridge \
opencv-python

# Install prebuilt spconv-cu120 (compatible with CUDA 12.2 due to minor version compatibility)
RUN python3 -m pip install --no-cache-dir spconv-cu120
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The python3 -m pip install commands in this Dockerfile install several third-party packages (pccm, ccimport, pybind11, numpy, fire, cv_bridge, opencv-python, and spconv-cu120) from PyPI without pinning them to exact versions or validating their integrity. If any of these dependencies are hijacked or replaced upstream, a subsequent image build will transparently pull and run attacker-controlled code inside the container, which can compromise the octomap behaviour node and any connected systems or secrets. Lock these dependencies to specific, trusted versions and use reproducible builds with hash or signature verification to mitigate this supply chain attack surface.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI commented Feb 3, 2026

@hassaan141 I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you.

@hassaan141 hassaan141 self-assigned this Feb 3, 2026
@hassaan141 hassaan141 merged commit 665b318 into main Feb 3, 2026
6 of 8 checks passed
@hassaan141 hassaan141 deleted the voxel-grid branch February 3, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants