Bsb/lyrical jetty build#889
Conversation
The previous CMake read gz-rendering::ogre2's LOCATION to guess the Ogre-Next include dir, falling back to a hardcoded /usr/include/OGRE-2.3. LOCATION is empty for imported/interface targets (NOTFOUND on the ROS gz vendor + Gazebo Jetty), so configure dropped to the wrong fallback and failed with "OgreRoot.h not found". Replace it with a find_path seeded by the ogre2 target's INTERFACE_INCLUDE_DIRECTORIES, with PATH_SUFFIXES limited to Ogre-Next dirs so classic Ogre 1.x is never selected. Version-agnostic across Harmonic, Jetty, ROS-vendor, and system installs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Brian Bingham <briansbingham@gmail.com>
The existing osrf/vrx-devel image is Jazzy/Harmonic; add a reproducible ROS 2 Lyrical + Gazebo Jetty environment. Modernized Dockerfile on ros:lyrical-ros-base installs the real ros-lyrical-gz-*-vendor packages (dropping the legacy fake-vendor / build-ros_gz-from-source workaround). Adds a Docker Compose workflow (compose.yaml + run_compose.bash) for a GPU + X11 + home-mounted interactive dev container that also sidesteps rocker's hardcoded Ubuntu list (rocker refuses 26.04). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Brian Bingham <briansbingham@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Carlos Aguero <caguero@honurobotics.com>
It should be fixed in 9341308 |
caguero
left a comment
There was a problem hiding this comment.
A few more comments inline. It would also be nice to eventually add a CI job that builds this image and compiles gz_waves_rendering inside it, so Lyrical and Jetty breakage shows up early.
| find_path(OGRE_NEXT_INCLUDE_DIR | ||
| NAMES OgreRoot.h | ||
| HINTS ${_ogre2_incs} | ||
| PATHS | ||
| /opt/ros/$ENV{ROS_DISTRO}/opt/gz_ogre_next_vendor/include | ||
| /usr/include | ||
| PATH_SUFFIXES OGRE-Next OGRE-2.4 OGRE-2.3 | ||
| ) |
There was a problem hiding this comment.
find_path checks the standard system paths before these PATHS, so on a host with both libogre-next-dev and gz_ogre_next_vendor it can pick the mismatched /usr/include copy and silently reintroduce the slow Hlms path. Consider a first pass with NO_DEFAULT_PATH so the vendor headers win, then a plain fallback.
| /usr/include | ||
| PATH_SUFFIXES OGRE-Next OGRE-2.4 OGRE-2.3 | ||
| ) | ||
| if(NOT OGRE_NEXT_INCLUDE_DIR) |
There was a problem hiding this comment.
find_path reuses a stale cached value even if the path no longer exists, so keeping the old EXISTS check on OgreRoot.h would still catch that case.
| # | ||
| # Manually: | ||
| # xhost +SI:localuser:$(id -un) # let the container reach your X server (once per login) | ||
| # cd ~/WorkingCopies/oceansim/vrx_ws/src/vrx |
There was a problem hiding this comment.
This personal path is still here. Maybe something generic like cd <your vrx_ws>/src/vrx.
| # NVIDIA reservation refuses to start the container on a host without an NVIDIA | ||
| # GPU, so only layer the overlay in when nvidia-smi actually reports one. | ||
| compose_files=(-f "${SCRIPT_DIR}/compose.yaml") | ||
| if command -v nvidia-smi >/dev/null 2>&1 && nvidia-smi -L >/dev/null 2>&1; then |
There was a problem hiding this comment.
If the driver is present but the nvidia container toolkit is not, compose fails to start instead of falling back to the iGPU. Maybe also check docker info for the nvidia runtime.
| @@ -0,0 +1,45 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
build.bash carries the Apache header but this script does not. Should we add it for consistentcy?
| docker build --rm -t "$image_plus_tag" -f "${context}/Dockerfile" "${context}" && \ | ||
| docker tag "$image_plus_tag" "$image_name:$distro" && \ | ||
| echo "Built $image_plus_tag and tagged as $image_name:$distro" && \ | ||
| echo "To run: ./docker/run_compose.bash" No newline at end of file |
There was a problem hiding this comment.
Missing newline at end of file.
| # NOTE: nav2 (navigation2, nav2-bringup, nav2-minimal-*) is intentionally | ||
| # omitted — it is often not yet released early in a new distro's life. Add | ||
| # ros-${ROS_DISTRO}-navigation2 etc. once available on Lyrical. | ||
| RUN apt-get update \ |
There was a problem hiding this comment.
This list can drift from our package.xml files over time. Maybe generate it with rosdep or note rosdep as the source of truth.
| && apt-get install -y --no-install-recommends \ | ||
| atop expect gdb gnutls-bin iputils-ping libbluetooth-dev libcwiid-dev \ | ||
| net-tools python3-dbg python3-pip python3-venv vim wget xvfb \ | ||
| && dpkg --add-architecture i386 \ |
There was a problem hiding this comment.
Do we need the i386 GL libs? Nothing in VRX is 32 bit, so this block could probably go.
| RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/profile.d/ros.sh \ | ||
| && chmod +x /etc/profile.d/ros.sh \ | ||
| && echo "source /etc/profile.d/ros.sh" >> /etc/bash.bashrc | ||
| ENV BASH_ENV=/etc/profile.d/ros.sh |
There was a problem hiding this comment.
Heads up: BASH_ENV makes every noninteractive bash source the ROS setup, which can surprise scripts that use set -u.

Symptom
Building gz_waves_rendering on ROS 2 Lyrical + Gazebo Jetty fails at CMake configure:
The package never compiles; the FFT/Gerstner providers building in parallel get aborted with it.
Explanation
No consistent dev environment for the target stack. The wave packages target ROS 2 Lyrical + Gazebo Jetty
Brittle, hardcoded Ogre-Next header discovery. gz_waves_rendering/CMakeLists.txt locates the Ogre-Next headers by reading gz-rendering::ogre2's LOCATION property and regex-matching a /opt/ros// path, else falling back to a hardcoded /usr/include/OGRE-2.3. For an imported/interface target LOCATION is empty, so the regex never matches and it drops to the hardcoded fallback — which does not exist on Jetty (newer Ogre-Next).
Multiple OgreRoot.h in the environment. The Jetty container ships three, only one of which is Ogre-Next:
A naive path guess can miss the right header or grab an incompatible classic-Ogre one — the detection only ever worked on the single environment it was written for.
Proposed fix
a) Robust header discovery. Replace the LOCATION probe with a find_path for OgreRoot.h, seeded by the ogre2 target's own INTERFACE_INCLUDE_DIRECTORIES, with PATH_SUFFIXES limited to Ogre-Next dirs (OGRE-Next, OGRE-2.4, OGRE-2.3) so classic Ogre 1.x is never selected. Version-agnostic across Harmonic, Jetty, ROS-vendor, and system installs.
b) A Lyrical/Jetty dev container via Docker compose:
Test / Verify