Skip to content

fix: build with Clang, Eigen 5 and OpenCV 5 - #556

Closed
wep21 wants to merge 3 commits into
ANYbotics:rollingfrom
wep21:fix/clang-eigen5-opencv5
Closed

wep21 wants to merge 3 commits into
ANYbotics:rollingfrom
wep21:fix/clang-eigen5-opencv5

Conversation

@wep21

@wep21 wep21 commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

What

Three small fixes for toolchains that the Ubuntu CI does not cover. With #551, #552 and #553, grid_map builds and passes its tests on Lyrical with Ubuntu 26.04. These commits make it build with Clang, Eigen 5 and OpenCV 5 too, for example with the RoboStack (conda-forge) packages on macOS.

  1. fix: take ConstSharedPtr in the subscription callbacks: rclcpp deprecates subscription callbacks that take std::shared_ptr<MessageT>. Clang reports the deprecation through the template instantiation from create_subscription(), although the rclcpp headers are system headers, so grid_map_visualization and grid_map_demos fail with -Werror. GCC does not report it. The three callbacks only read the message.
  2. fix(grid_map_cv): use the cv::COLOR_* constants: OpenCV 5 removed CV_BGR2GRAY, CV_BGRA2GRAY and CV_BGRA2RGB. The cv::COLOR_* constants also exist in OpenCV 3 and 4. RoboStack carries this change as a patch.
  3. test(grid_map_core): remove unused variables in SubmapIteratorTest: with Eigen 5, Clang reports two unused Eigen::Array2i variables with -Wunused-variable.

None of them changes the behavior.

How it was tested

  • With the RoboStack Lyrical packages (pixi, osx-arm64, Clang 21, Eigen 5.0.1, OpenCV 5.0.0): colcon build builds all 15 packages, and colcon test gives 841 tests, 0 errors, 0 failures, 195 skipped. Without each commit, the package that it fixes does not build.
  • The same tree passed the Lyrical and Rolling CI on Ubuntu 26.04 in Check CI on Lyrical with all the pending fixes (do not merge) #555.

🤖 Generated with Claude Code

Daisuke Nishimatsu and others added 3 commits November 14, 2026 17:12
rclcpp deprecates subscription callbacks that take
std::shared_ptr<MessageT>. Clang reports the deprecation through the
template instantiation from create_subscription(), although the rclcpp
headers are system headers, so grid_map_visualization and grid_map_demos
do not build with -Werror. GCC does not report it.

The three callbacks only read the message, so they can take
std::shared_ptr<const MessageT>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenCV 5 removed the C constants CV_BGR2GRAY, CV_BGRA2GRAY and CV_BGRA2RGB,
so GridMapCvConverter.hpp does not compile with it. conda-forge ships
OpenCV 5, and RoboStack carries this change as a patch for Lyrical.
The cv::COLOR_* constants also exist in OpenCV 3 and 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests declare two Eigen::Array2i variables that they never use.
With Eigen 5, Clang reports them with -Wunused-variable, and the test
does not build with -Werror.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wep21

wep21 commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Split into #557, #558 and #559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant