Skip to content

feat: add ouster ros + win patches #29

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

Merged
merged 8 commits into from
Jun 12, 2025
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
10 changes: 5 additions & 5 deletions .github/workflows/testpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,29 @@ jobs:
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
# env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
- name: Build recipes for linux-aarch64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-aarch64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
# env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
- name: Build recipes for osx-64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
# env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
- name: Build recipes for osx-arm64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-arm64'
run: |
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
# env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
- name: Build recipes for win-64
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'win-64'
run: |
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
# $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
16 changes: 16 additions & 0 deletions patch/ros-jazzy-apriltag-detector.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35b0303..b7b031a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,10 @@
cmake_minimum_required(VERSION 3.16)
project(apriltag_detector)

-add_compile_options(-Wall -Wextra -Wpedantic -Werror)
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ add_compile_options(-Wall -Wextra -Wpedantic -Werror)
+endif()
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# find dependencies
find_package(ament_cmake REQUIRED)
36 changes: 0 additions & 36 deletions patch/ros-jazzy-foxglove-bridge.win.patch
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,6 @@ index 4b85891..6a946ee 100644
+extern FOXGLOVE_BRIDGE_BASE_EXPORT const char FOXGLOVE_BRIDGE_GIT_HASH[];

} // namespace foxglove
diff --git a/ros2_foxglove_bridge/src/generic_client.cpp b/ros2_foxglove_bridge/src/generic_client.cpp
index 7c58801..3e0b015 100644
--- a/ros2_foxglove_bridge/src/generic_client.cpp
+++ b/ros2_foxglove_bridge/src/generic_client.cpp
@@ -11,17 +11,20 @@

// clang-format off
/* True if the version of RCLCPP is at least major.minor.patch */
-#define RCLCPP_VERSION_GTE(major, minor, patch) \
- (major < RCLCPP_VERSION_MAJOR \
- ? true \
- : major > RCLCPP_VERSION_MAJOR \
- ? false \
- : minor < RCLCPP_VERSION_MINOR \
- ? true \
- : minor > RCLCPP_VERSION_MINOR \
- ? false \
- : patch < RCLCPP_VERSION_PATCH ? true \
- : patch > RCLCPP_VERSION_PATCH ? false : true)
+#define RCLCPP_VERSION_MAJOR_GT(major) ((major) < RCLCPP_VERSION_MAJOR)
+#define RCLCPP_VERSION_MAJOR_LT(major) ((major) > RCLCPP_VERSION_MAJOR)
+#define RCLCPP_VERSION_MINOR_GT(minor) ((minor) < RCLCPP_VERSION_MINOR)
+#define RCLCPP_VERSION_MINOR_LT(minor) ((minor) > RCLCPP_VERSION_MINOR)
+#define RCLCPP_VERSION_PATCH_GT(patch) ((patch) < RCLCPP_VERSION_PATCH)
+#define RCLCPP_VERSION_PATCH_LT(patch) ((patch) > RCLCPP_VERSION_PATCH)
+
+#define RCLCPP_VERSION_GTE(major, minor, patch) \
+ (RCLCPP_VERSION_MAJOR_GT(major) || \
+ (!RCLCPP_VERSION_MAJOR_LT(major) && \
+ (RCLCPP_VERSION_MINOR_GT(minor) || \
+ (!RCLCPP_VERSION_MINOR_LT(minor) && \
+ (RCLCPP_VERSION_PATCH_GT(patch) || \
+ (!RCLCPP_VERSION_PATCH_LT(patch)))))))
// clang-format on

namespace {
diff --git a/ros2_foxglove_bridge/src/message_definition_cache.cpp b/ros2_foxglove_bridge/src/message_definition_cache.cpp
index 262c482..2d72a3a 100644
--- a/ros2_foxglove_bridge/src/message_definition_cache.cpp
Expand Down
26 changes: 26 additions & 0 deletions patch/ros-jazzy-ouster-ros.osx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e07dcf4..1b430f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,7 +78,7 @@ target_link_libraries(ouster_ros_library
ouster_build
pcl_common
# PRIVATE (unsupported)
- -Wl,--whole-archive ouster_client -Wl,--no-whole-archive
+ ouster_client
)

# helper method to construct ouster-ros components
diff --git a/src/os_ros.cpp b/src/os_ros.cpp
index 0ddbf8e..a326b1a 100644
--- a/src/os_ros.cpp
+++ b/src/os_ros.cpp
@@ -127,7 +127,7 @@ void copy_scan_to_cloud(ouster_ros::Cloud& cloud, const ouster::LidarScan& ls,
const auto rf = reflectivity.data();
const auto nr = near_ir.data();
const auto sg = signal.data();
- const auto t_zero = std::chrono::duration<long int, std::nano>::zero();
+ constexpr std::chrono::nanoseconds t_zero{0};

#ifdef __OUSTER_UTILIZE_OPENMP__
#pragma omp parallel for collapse(2)
27 changes: 27 additions & 0 deletions patch/ros-jazzy-ouster-ros.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e07dcf4..8d23997 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,13 +23,21 @@ find_package(pcl_conversions REQUIRED)
find_package(tf2_eigen REQUIRED)

# ==== Options ====
-add_compile_options(-Wall -Wextra)
+if(MSVC)
+ add_compile_options(/W2)
+ add_compile_definitions(NOMINMAX _USE_MATH_DEFINES WIN32_LEAN_AND_MEAN)
+else()
+ add_compile_options(-Wall -Wextra)
+endif()
+
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
option(CMAKE_POSITION_INDEPENDENT_CODE "Build position independent code." ON)

+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
set(_ouster_ros_INCLUDE_DIRS
include
ouster-sdk/ouster_client/include
2 changes: 2 additions & 0 deletions vinca_linux_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,7 @@ packages_select_by_deps:

- odom_to_tf_ros2

- ouster_ros

patch_dir: patch
rosdistro_snapshot: rosdistro_snapshot.yaml
2 changes: 2 additions & 0 deletions vinca_linux_aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ packages_select_by_deps:

- odom_to_tf_ros2

- ouster_ros

patch_dir: patch
rosdistro_snapshot: rosdistro_snapshot.yaml
2 changes: 2 additions & 0 deletions vinca_osx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,7 @@ packages_select_by_deps:

- odom_to_tf_ros2

- ouster_ros

patch_dir: patch
rosdistro_snapshot: rosdistro_snapshot.yaml
2 changes: 2 additions & 0 deletions vinca_osx_arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,7 @@ packages_select_by_deps:

- odom_to_tf_ros2

- ouster_ros

patch_dir: patch
rosdistro_snapshot: rosdistro_snapshot.yaml
2 changes: 2 additions & 0 deletions vinca_win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,7 @@ packages_select_by_deps:

- behaviortree_cpp

- ouster_ros

patch_dir: patch
rosdistro_snapshot: rosdistro_snapshot.yaml
Loading