Skip to content

feat(dataclass): add a method to split points by sensors#280

Open
ktro2828 wants to merge 4 commits into
mainfrom
feat/pointcloud/split-by-sensor
Open

feat(dataclass): add a method to split points by sensors#280
ktro2828 wants to merge 4 commits into
mainfrom
feat/pointcloud/split-by-sensor

Conversation

@ktro2828
Copy link
Copy Markdown
Collaborator

@ktro2828 ktro2828 commented Jun 3, 2026

What

This pull request adds a new method for splitting point clouds by sensor and introduces comprehensive unit tests for the PointCloud dataclasses. The most significant changes are the addition of the split_by_sensor method and a new test suite that covers point cloud operations, validation, and file I/O.

PointCloud API Enhancements

  • Added a split_by_sensor method to the PointCloud class, allowing a point cloud to be split into multiple point clouds based on sensor tokens using the metainfo attribute. This method returns a dictionary mapping sensor tokens to their corresponding PointCloud instances and raises an error if metainfo is missing.

Testing Improvements

  • Added a new test suite in tests/dataclass/test_pointcloud.py that covers:
    • Construction and validation of Stamp, PointCloudSourceInfo, and PointCloudMetainfo objects.
    • Point cloud transformation operations (translate, rotate, transform).
    • Validation of source coverage and error handling for invalid configurations.
    • The new split_by_sensor method, including error cases and ensuring independence of split point clouds.
    • File reading for LidarPointCloud and SegmentationPointCloud, including points, labels, and metainfo parsing.

ktro2828 added 2 commits June 3, 2026 12:32
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@ktro2828 ktro2828 requested a review from Copilot June 3, 2026 03:34
@github-actions github-actions Bot added ci Continuous Integration (CI) processes and testing new-feature New feature or request labels Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

☂️ Python Coverage

current status: ❌

Overall Coverage

Lines Covered Coverage Threshold Status
4236 3558 84% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/dataclass/pointcloud.py 71% 🔴
TOTAL 71% 🔴

updated for commit: 35ace04 by action🐍

Copy link
Copy Markdown
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 extends the PointCloud dataclass API with a split_by_sensor() helper that partitions a concatenated point cloud into per-sensor point clouds using metainfo.sources, and adds a new unit test suite covering point cloud validation, transforms, splitting, and file I/O.

Changes:

  • Added PointCloud.split_by_sensor() to slice point buffers into per-sensor PointCloud instances based on metainfo.sources.
  • Added a comprehensive tests/dataclass/test_pointcloud.py suite covering timestamp/metainfo parsing, metainfo coverage validation, transform ops, splitting, and from_file readers.

Reviewed changes

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

File Description
t4_devkit/dataclass/pointcloud.py Adds split_by_sensor() to the PointCloud base class.
tests/dataclass/test_pointcloud.py Introduces unit tests for PointCloud-related dataclasses and I/O, including the new split method.

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

Comment thread t4_devkit/dataclass/pointcloud.py
Comment thread tests/dataclass/test_pointcloud.py
ktro2828 and others added 2 commits June 3, 2026 13:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration (CI) processes and testing new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants