-
Notifications
You must be signed in to change notification settings - Fork 1
Voxel grid implementation #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
86aa701
2d69390
8360521
9c5f637
3f446da
69515db
f60f89d
789fd03
048addc
4b3e47b
e0c9342
54b3b01
243dcec
896e8d6
c7ee081
78f26ef
73723a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ __pycache__ | |
| .vscode/ | ||
|
|
||
| watod-config.local.sh | ||
| utils/voxel/spconv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| from launch import LaunchDescription | ||
| import launch_ros.actions | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| return LaunchDescription([ | ||
| launch_ros.actions.Node( | ||
| name='octo_map_node', | ||
| package='octo_map', | ||
| executable='octo_map_node', | ||
| output='screen', | ||
| emulate_tty=True), | ||
| ]) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,75 @@ | ||||||||||||||||||||||||||||||||||||||||
| import rclpy | ||||||||||||||||||||||||||||||||||||||||
| from rclpy.node import Node | ||||||||||||||||||||||||||||||||||||||||
| import numpy as np | ||||||||||||||||||||||||||||||||||||||||
| import torch | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| import torch |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'PointToVoxel' is not used.
| from spconv.pytorch.utils import PointToVoxel |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'cv2' is not used.
| import cv2 |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'PointField' is not used.
| from sensor_msgs.msg import Image, PointCloud2, PointField, CameraInfo | |
| from sensor_msgs.msg import Image, PointCloud2, CameraInfo |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Header' is not used.
| from std_msgs.msg import Header |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'pc2' is not used.
| import sensor_msgs_py.point_cloud2 as pc2 |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process_rgbd_if_ready method is called but never defined in this file. This will cause a runtime error when the callback is triggered.
| def process_rgbd_if_ready(self): | |
| """ | |
| Process RGB-D data when both images are available. | |
| This is a placeholder implementation to prevent runtime errors when | |
| the RGB and depth callbacks are triggered. Point cloud generation and | |
| octomap updating logic should be implemented here. | |
| """ | |
| # Ensure both RGB and depth images have been received | |
| if self.rgb_image is None or self.depth_image is None: | |
| return | |
| # Placeholder: actual point cloud generation and octomap updating | |
| # should be implemented here in the future. | |
| self.get_logger().debug( | |
| 'process_rgbd_if_ready called, but point cloud generation is not implemented yet.' | |
| ) |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
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.
| except KeyboardInterrupt: | |
| except KeyboardInterrupt: | |
| # Allow clean shutdown on Ctrl+C; cleanup is handled in the finally block. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>octo_map</name> | ||
| <version>0.0.0</version> | ||
| <description>OctoMap generation for 3D mapping</description> | ||
| <maintainer email="watonomous@uwaterloo.ca">watonomous</maintainer> | ||
| <license>Apache-2.0</license> | ||
|
|
||
| <depend>rclpy</depend> | ||
|
|
||
| <test_depend>ament_copyright</test_depend> | ||
| <test_depend>ament_flake8</test_depend> | ||
| <test_depend>ament_pep257</test_depend> | ||
| <test_depend>python3-pytest</test_depend> | ||
|
|
||
| <export> | ||
| <build_type>ament_python</build_type> | ||
| </export> | ||
| </package> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| voxel_grid | ||||||
|
||||||
| voxel_grid | |
| octo_map |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||||||||||
| [develop] | ||||||||||||||
| script-dir=$base/lib/voxel_grid | ||||||||||||||
| [install] | ||||||||||||||
| install-scripts=$base/lib/voxel_grid | ||||||||||||||
|
Comment on lines
+2
to
+4
|
||||||||||||||
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import os | ||
| from glob import glob | ||
| from setuptools import setup | ||
|
|
||
| package_name = 'octo_map' | ||
|
|
||
| setup( | ||
| name=package_name, | ||
| version='0.0.0', | ||
| packages=[package_name], | ||
| data_files=[ | ||
| # Install marker file in the package index | ||
| ('share/ament_index/resource_index/packages', ['resource/' + package_name]), | ||
| # Include our package.xml file | ||
| (os.path.join('share', package_name), ['package.xml']), | ||
| # Include all launch files. | ||
| (os.path.join('share', package_name, 'launch'), | ||
| glob(os.path.join('launch', '*.launch.py'))), | ||
| # Include all config files. | ||
| (os.path.join('share', package_name, 'config'), | ||
| glob(os.path.join('config', '*.yaml'))), | ||
| ], | ||
| install_requires=['setuptools'], | ||
| zip_safe=True, | ||
| maintainer='watonomous', | ||
| maintainer_email='watonomous@uwaterloo.ca', | ||
| description='OctoMap generation for 3D mapping', | ||
| license='Apache-2.0', | ||
| tests_require=['pytest'], | ||
| entry_points={ | ||
| 'console_scripts': [ | ||
| 'octo_map_node = octo_map.octo_map_node:main' | ||
| ], | ||
| }, | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| from launch import LaunchDescription | ||
| import launch_ros.actions | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| return LaunchDescription([ | ||
| launch_ros.actions.Node( | ||
| name='voxel_grid_node', | ||
| package='voxel_grid', | ||
| executable='voxel_grid_node', | ||
| output='screen', | ||
| emulate_tty=True), | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>voxel_grid</name> | ||
| <version>0.0.0</version> | ||
| <description>Voxel grid generation for depth camera data</description> | ||
| <maintainer email="watonomous@uwaterloo.ca">watonomous</maintainer> | ||
| <license>Apache-2.0</license> | ||
|
|
||
| <depend>rclpy</depend> | ||
|
|
||
| <test_depend>ament_copyright</test_depend> | ||
| <test_depend>ament_flake8</test_depend> | ||
| <test_depend>ament_pep257</test_depend> | ||
| <test_depend>python3-pytest</test_depend> | ||
|
|
||
| <export> | ||
| <build_type>ament_python</build_type> | ||
| </export> | ||
| </package> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| voxel_grid |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [develop] | ||
| script-dir=$base/lib/voxel_grid | ||
| [install] | ||
| install-scripts=$base/lib/voxel_grid |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import os | ||
| from glob import glob | ||
| from setuptools import setup | ||
|
|
||
| package_name = 'voxel_grid' | ||
|
|
||
| setup( | ||
| name=package_name, | ||
| version='0.0.0', | ||
| packages=[package_name], | ||
| data_files=[ | ||
| # Install marker file in the package index | ||
| ('share/ament_index/resource_index/packages', ['resource/' + package_name]), | ||
| # Include our package.xml file | ||
| (os.path.join('share', package_name), ['package.xml']), | ||
| # Include all launch files. | ||
| (os.path.join('share', package_name, 'launch'), | ||
| glob(os.path.join('launch', '*.launch.py'))), | ||
| # Include all config files. | ||
| (os.path.join('share', package_name, 'config'), | ||
| glob(os.path.join('config', '*.yaml'))), | ||
| ], | ||
| install_requires=['setuptools'], | ||
| zip_safe=True, | ||
| maintainer='watonomous', | ||
| maintainer_email='watonomous@uwaterloo.ca', | ||
| description='Voxel grid generation for depth camera data', | ||
| license='Apache-2.0', | ||
| tests_require=['pytest'], | ||
| entry_points={ | ||
| 'console_scripts': [ | ||
| 'voxel_grid_node = voxel_grid.voxel_grid_node:main' | ||
| ], | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'np' is not used.