Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
25 changes: 25 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "python",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"extra-files": [
"ros/pixi.toml",
"CMakeLists.txt",
{
"path": "ros/pixi.toml",
"type": "xml",
"xpath": "//package/version"
},
{
"type": "json",
"path": "vcpkg.json",
"jsonpath": "$.version"
}
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
5 changes: 5 additions & 0 deletions .github/scripts/vcpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
git clone https://github.com/microsoft/vcpkg.git .vcpkg/
cd .vcpkg
git switch --detach 2026.02.27
cd ..
./.vcpkg/bootstrap-vcpkg.sh
28 changes: 0 additions & 28 deletions .github/workflows/ci.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/on_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Main

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
# Release Please to create releases
release:
name: Release Please
runs-on: ubuntu-latest
outputs:
# fromJSON to convert string "true"/"false" to boolean
# https://github.com/googleapis/release-please-action/issues/912#issuecomment-2024459449
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}

# Always run checks
checks:
name: Checks
uses: ./.github/workflows/reusable_checks.yml
secrets: inherit

# Build main Python package
build:
name: Build
uses: ./.github/workflows/reusable_build.yml
secrets: inherit

# Build ROS 2 package
build_ros:
name: Build ROS
uses: ./.github/workflows/reusable_build_ros.yml
secrets: inherit
24 changes: 24 additions & 0 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR

on:
pull_request:
branches: ["main"]

jobs:
# Always run checks
checks:
name: Checks
uses: ./.github/workflows/reusable_checks.yml
secrets: inherit

# Build main Python package
build:
name: Build
uses: ./.github/workflows/reusable_build.yml
secrets: inherit

# Build ROS 2 package
build_ros:
name: Build ROS
uses: ./.github/workflows/reusable_build_ros.yml
secrets: inherit
40 changes: 40 additions & 0 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build Python package"

on:
workflow_call:

jobs:
build:
runs-on: ${{ matrix.os }}
env:
VCPKG_BINARY_SOURCES: ${{ vars.VCPKG_BINARY_SOURCES }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }}
# only required until R2 supports CRC64NVME checksums
# https://community.cloudflare.com/t/an-error-occurred-internalerror-when-calling-the-putobject-operation/764905/11
AWS_REQUEST_CHECKSUM_CALCULATION: when_required
AWS_RESPONSE_CHECKSUM_VALIDATION: when_required
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- "3.11"
- "3.14"
steps:
- uses: actions/checkout@v4
name: Checkout

- name: Install vcpkg
run: ./.github/scripts/vcpkg.sh

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Build and install the project
run: uv sync --verbose
22 changes: 22 additions & 0 deletions .github/workflows/reusable_build_ros.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Build ROS 2 package"

on:
workflow_call:

jobs:
build_ros:
name: Build ROS (linux-64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout

- uses: prefix-dev/[email protected]
name: Setup pixi
with:
pixi-version: v0.41.4
manifest-path: ros/pixi.toml
cache: true

- name: Build ROS 2 package
run: pixi run --manifest-path ros/pixi.toml build
27 changes: 27 additions & 0 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Checks: Lint and Types"

on:
workflow_call:

jobs:
# Check Python formatting
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: astral-sh/ruff-action@v3
name: Ruff

# Check C++ formatting
clang-format:
name: Clang-Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: jidicula/[email protected]
name: Clang-Format
with:
clang-format-version: '22'
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
build*
.cache
# pixi environments
.pixi
*.egg-info
compile_commands.json

# ros env
Expand All @@ -24,6 +21,7 @@ log
*.synctex
*.run.xml
*.rrd
.vcpkg*

# python
__pycache__
Expand All @@ -35,3 +33,4 @@ evalio_results
*.png
figures
graphics*
*.mp4
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# First thing, we check if vcpkg is installed and if so, use it for dependencies
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.vcpkg/scripts/buildsystems/vcpkg.cmake")
set(CMAKE_TOOLCHAIN_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/.vcpkg/scripts/buildsystems/vcpkg.cmake"
)
endif()

cmake_minimum_required(VERSION 3.16)

project(form
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<br />
<br />
<a href="https://github.com/rpl-cmu/form/releases"><img src="https://img.shields.io/github/v/release/rpl-cmu/form" /></a>
<a href="https://github.com/rpl-cmu/form/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/rpl-cmu/form/ci.yml" /></a>
<a href="https://github.com/rpl-cmu/form/actions/workflows/on_main.yml"><img src="https://img.shields.io/github/actions/workflow/status/rpl-cmu/form/on_main.yml" /></a>
<a href="https://github.com/rpl-cmu/form/blob/master/LICENSE"><img src="https://img.shields.io/github/license/rpl-cmu/form" /></a>
<a href="https://arxiv.org/abs/2510.09966"><img src="https://img.shields.io/badge/arXiv-2510.09966-b31b1b.svg" /></a>
<br />
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ dependencies = [
"seaborn>=0.13.2",
]

[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"
[dependency-groups]
dev = ["snakeviz>=2.2.2"]

[build-system]
requires = ["scikit-build-core>=0.10", "nanobind", "evalio>=0.4"]
build-backend = "scikit_build_core.build"

[dependency-groups]
dev = ["snakeviz>=2.2.2"]
[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"

[tool.scikit-build.cmake.define]
FORM_BUILD_PYTHON = true
CMAKE_BUILD_TYPE = "Release"
# CMAKE_BUILD_TYPE = "RelWithDebInfo"
VCPKG_INSTALLED_DIR = "./.vcpkg_installed"

[tool.basedpyright]
typeCheckingMode = "standard"
Expand Down
2 changes: 1 addition & 1 deletion ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16...3.26)
project(form VERSION 0.1.0 LANGUAGES CXX)
project(form VERSION 0.1.0 LANGUAGES CXX) # x-release-please-version

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Expand Down
2 changes: 1 addition & 1 deletion ros/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Easton Potokar <[email protected]>"]
channels = ["robostack-jazzy", "conda-forge"]
name = "ros"
platforms = ["linux-64"]
version = "0.1.0"
version = "0.1.0" # x-release-please-version

[activation]
scripts = ["install/setup.sh"]
Expand Down
11 changes: 6 additions & 5 deletions ros/src/ros_pc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,21 @@ PointCloud2ToForm(const sensor_msgs::msg::PointCloud2::ConstSharedPtr &msg,
} else if (field.name == "z") {
func_z = data_getter<float>(field.datatype, field.offset);
has_z = true;
} else if (field.name == "ring" || field.name == "row" || field.name == "channel") {
} else if (field.name == "ring" || field.name == "row" ||
field.name == "channel") {
func_row = data_getter<uint8_t>(field.datatype, field.offset);
has_row = true;
}
}

// Validate that all required fields were found
if (!has_x || !has_y || !has_z) {
throw std::runtime_error(
"PointCloud2ToForm: Missing required point fields; expected fields 'x', 'y', and 'z'.");
throw std::runtime_error("PointCloud2ToForm: Missing required point fields; "
"expected fields 'x', 'y', and 'z'.");
}
if (!has_row) {
throw std::runtime_error(
"PointCloud2ToForm: Missing required row indicator field; expected one of 'ring', 'row', or 'channel'.");
throw std::runtime_error("PointCloud2ToForm: Missing required row indicator "
"field; expected one of 'ring', 'row', or 'channel'.");
}

// Parse all points
Expand Down
Loading
Loading