-
Notifications
You must be signed in to change notification settings - Fork 34
RobotVision CMake refactor + Tracker service introduction #817
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
Conversation
…ent lambda to keep RobotVision warning‑free under modern C++ standards without changing behavior.
There was a problem hiding this 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 modernizes RobotVision's CMake configuration by replacing deprecated C++ constructs, introducing per-target C++ standard settings, and creating a new Tracker service that consumes RobotVision as a library dependency.
Key changes:
- Refactored CMake to use
CMAKE_CURRENT_SOURCE_DIRfor subproject compatibility and introducedBUILD_PYTHON_BINDINGSoption - Replaced deprecated
std::bind1stwith lambda expression for modern C++ compliance - Introduced per-target C++ standard configuration (
RV_CXX_STANDARD) with C++17 default for RobotVision - Created reusable
scenescape::security_optionsINTERFACE target for consistent security hardening - Added new Tracker service with its own C++20 standard that integrates RobotVision as a library
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracker/src/main.cpp | New minimal tracker application demonstrating RobotVision integration |
| tracker/Makefile | Build automation for tracker service including Docker targets |
| tracker/Dockerfile | Multi-stage Docker build for tracker with distroless runtime |
| tracker/CMakeLists.txt | Tracker CMake configuration consuming RobotVision with C++20 |
| controller/src/robot_vision/test/CMakeLists.txt | Updated test configuration to use per-target C++ standard and new security target |
| controller/src/robot_vision/include/rv/apollo/gated_hungarian_bigraph_matcher.hpp | Replaced deprecated std::bind1st with lambda |
| controller/src/robot_vision/cmake/security_options.cmake | New module encapsulating security compiler/linker flags |
| controller/src/robot_vision/cmake/opencv.cmake | New module normalizing OpenCV target interface |
| controller/src/robot_vision/benchmarks/CMakeLists.txt | Updated benchmark configuration for per-target standards |
| controller/src/robot_vision/Makefile | Added cpp-tests target for C++ test execution |
| controller/src/robot_vision/CMakeLists.txt | Major refactor replacing global settings with per-target configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Collect all runtime library dependencies for the tracker binary | ||
| RUN mkdir -p /scenescape/runtime-libs | ||
| WORKDIR /scenescape/runtime-libs | ||
| RUN ldd /scenescape/tracker/build/tracker \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure that the intermediate build binaries are not copied and only the runtime lib files are copied? alternative is to create a deb package and dpkg install in the runtime stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation already ensures only runtime shared libraries are copied, not intermediate build artifacts. Here's the step-by-step breakdown with actual output from the build:
How the pipeline works
ldd /scenescape/tracker/build/tracker \
| awk '{print $3}' \
| grep '^/' \
| xargs -I '{}' cp -v '{}' .Step 1: ldd — list all runtime dependencies
$ ldd /scenescape/tracker/build/tracker
linux-vdso.so.1 (0x00007ffff7fc5000)
libRobotVision.so => /scenescape/tracker/build/robot_vision/libRobotVision.so (0x00007ffff7f6e000)
libopencv_core.so.410 => /lib/x86_64-linux-gnu/libopencv_core.so.410 (0x00007ffff7b90000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffff792a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffff78fd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7708000)
libopencv_tracking.so.410 => /lib/x86_64-linux-gnu/libopencv_tracking.so.410 (0x00007ffff7516000)
libopencv_calib3d.so.410 => /lib/x86_64-linux-gnu/libopencv_calib3d.so.410 (0x00007ffff72b4000)
libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007ffff725f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffff716f000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ffff714f000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007ffff7119000)
liblapack.so.3 => /lib/x86_64-linux-gnu/liblapack.so.3 (0x00007ffff69e0000)
libblas.so.3 => /lib/x86_64-linux-gnu/libblas.so.3 (0x00007ffff695f000)
libtbb.so.12 => /lib/x86_64-linux-gnu/libtbb.so.12 (0x00007ffff6907000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffff7fc7000)
libopencv_video.so.410 => /lib/x86_64-linux-gnu/libopencv_video.so.410 (0x00007ffff6880000)
libopencv_imgproc.so.410 => /lib/x86_64-linux-gnu/libopencv_imgproc.so.410 (0x00007ffff62ad000)
libopencv_features2d.so.410 => /lib/x86_64-linux-gnu/libopencv_features2d.so.410 (0x00007ffff61db000)
libopencv_flann.so.410 => /lib/x86_64-linux-gnu/libopencv_flann.so.410 (0x00007ffff6169000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007ffff60b0000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007ffff5f68000)
libopenblas.so.0 => /lib/x86_64-linux-gnu/libopenblas.so.0 (0x00007ffff3988000)
libgfortran.so.5 => /lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007ffff3684000)
libopencv_dnn.so.410 => /lib/x86_64-linux-gnu/libopencv_dnn.so.410 (0x00007ffff314e000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ffff3123000)
libprotobuf.so.32 => /lib/x86_64-linux-gnu/libprotobuf.so.32 (0x00007ffff2dc6000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007ffff5f61000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ffff2dbc000)
Step 2: awk '{print $3}' — extract library paths (3rd column)
/scenescape/tracker/build/robot_vision/libRobotVision.so
/lib/x86_64-linux-gnu/libopencv_core.so.410
/lib/x86_64-linux-gnu/libstdc++.so.6
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libopencv_tracking.so.410
/lib/x86_64-linux-gnu/libopencv_calib3d.so.410
/lib/x86_64-linux-gnu/libgomp.so.1
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libGLX.so.0
/lib/x86_64-linux-gnu/liblapack.so.3
/lib/x86_64-linux-gnu/libblas.so.3
/lib/x86_64-linux-gnu/libtbb.so.12
/lib/x86_64-linux-gnu/libopencv_video.so.410
/lib/x86_64-linux-gnu/libopencv_imgproc.so.410
/lib/x86_64-linux-gnu/libopencv_features2d.so.410
/lib/x86_64-linux-gnu/libopencv_flann.so.410
/lib/x86_64-linux-gnu/libGLdispatch.so.0
/lib/x86_64-linux-gnu/libX11.so.6
/lib/x86_64-linux-gnu/libopenblas.so.0
/lib/x86_64-linux-gnu/libgfortran.so.5
/lib/x86_64-linux-gnu/libopencv_dnn.so.410
/lib/x86_64-linux-gnu/libxcb.so.1
/lib/x86_64-linux-gnu/libprotobuf.so.32
/lib/x86_64-linux-gnu/libXau.so.6
/lib/x86_64-linux-gnu/libXdmcp.so.6
Step 3: grep '^/' — filter to absolute paths only
This removes virtual entries like linux-vdso.so.1 which have no filesystem path.
Step 4: xargs ... cp -v — copy only these .so files
'/scenescape/tracker/build/robot_vision/libRobotVision.so' -> './libRobotVision.so'
'/lib/x86_64-linux-gnu/libopencv_core.so.410' -> './libopencv_core.so.410'
'/lib/x86_64-linux-gnu/libstdc++.so.6' -> './libstdc++.so.6'
'/lib/x86_64-linux-gnu/libgcc_s.so.1' -> './libgcc_s.so.1'
'/lib/x86_64-linux-gnu/libc.so.6' -> './libc.so.6'
'/lib/x86_64-linux-gnu/libopencv_tracking.so.410' -> './libopencv_tracking.so.410'
'/lib/x86_64-linux-gnu/libopencv_calib3d.so.410' -> './libopencv_calib3d.so.410'
'/lib/x86_64-linux-gnu/libgomp.so.1' -> './libgomp.so.1'
'/lib/x86_64-linux-gnu/libm.so.6' -> './libm.so.6'
'/lib/x86_64-linux-gnu/libz.so.1' -> './libz.so.1'
'/lib/x86_64-linux-gnu/libGLX.so.0' -> './libGLX.so.0'
'/lib/x86_64-linux-gnu/liblapack.so.3' -> './liblapack.so.3'
'/lib/x86_64-linux-gnu/libblas.so.3' -> './libblas.so.3'
'/lib/x86_64-linux-gnu/libtbb.so.12' -> './libtbb.so.12'
'/lib/x86_64-linux-gnu/libopencv_video.so.410' -> './libopencv_video.so.410'
'/lib/x86_64-linux-gnu/libopencv_imgproc.so.410' -> './libopencv_imgproc.so.410'
'/lib/x86_64-linux-gnu/libopencv_features2d.so.410' -> './libopencv_features2d.so.410'
'/lib/x86_64-linux-gnu/libopencv_flann.so.410' -> './libopencv_flann.so.410'
'/lib/x86_64-linux-gnu/libGLdispatch.so.0' -> './libGLdispatch.so.0'
'/lib/x86_64-linux-gnu/libX11.so.6' -> './libX11.so.6'
'/lib/x86_64-linux-gnu/libopenblas.so.0' -> './libopenblas.so.0'
'/lib/x86_64-linux-gnu/libgfortran.so.5' -> './libgfortran.so.5'
'/lib/x86_64-linux-gnu/libopencv_dnn.so.410' -> './libopencv_dnn.so.410'
'/lib/x86_64-linux-gnu/libxcb.so.1' -> './libxcb.so.1'
'/lib/x86_64-linux-gnu/libprotobuf.so.32' -> './libprotobuf.so.32'
'/lib/x86_64-linux-gnu/libXau.so.6' -> './libXau.so.6'
'/lib/x86_64-linux-gnu/libXdmcp.so.6' -> './libXdmcp.so.6'
Final result: files in /scenescape/runtime-libs
total 82888
-rw-r--r-- 1 root root 141744 libGLX.so.0
-rw-r--r-- 1 root root 723248 libGLdispatch.so.0
-rwxr-xr-x 1 root root 357072 libRobotVision.so
-rw-r--r-- 1 root root 1342984 libX11.so.6
-rw-r--r-- 1 root root 14472 libXau.so.6
-rw-r--r-- 1 root root 26728 libXdmcp.so.6
-rw-r--r-- 1 root root 522656 libblas.so.3
-rwxr-xr-x 1 root root 1999312 libc.so.6
-rw-r--r-- 1 root root 182856 libgcc_s.so.1
-rw-r--r-- 1 root root 3157224 libgfortran.so.5
-rw-r--r-- 1 root root 348056 libgomp.so.1
-rw-r--r-- 1 root root 7572240 liblapack.so.3
-rw-r--r-- 1 root root 977112 libm.so.6
-rw-r--r-- 1 root root 39608152 libopenblas.so.0
-rw-r--r-- 1 root root 2496832 libopencv_calib3d.so.410
-rw-r--r-- 1 root root 3971840 libopencv_core.so.410
-rw-r--r-- 1 root root 5457000 libopencv_dnn.so.410
-rw-r--r-- 1 root root 846080 libopencv_features2d.so.410
-rw-r--r-- 1 root root 461392 libopencv_flann.so.410
-rw-r--r-- 1 root root 5450368 libopencv_imgproc.so.410
-rw-r--r-- 1 root root 2030752 libopencv_tracking.so.410
-rw-r--r-- 1 root root 547136 libopencv_video.so.410
-rw-r--r-- 1 root root 3524496 libprotobuf.so.32
-rw-r--r-- 1 root root 2497768 libstdc++.so.6
-rw-r--r-- 1 root root 268800 libtbb.so.12
-rw-r--r-- 1 root root 170936 libxcb.so.1
-rw-r--r-- 1 root root 125376 libz.so.1
What is NOT copied
| Artifact | Reason |
|---|---|
.o object files |
Not linked into final binary, ldd doesn't see them |
.a static archives |
Already linked, not runtime deps |
| CMake cache/build files | Not libraries, ldd ignores them |
Headers (.h, .hpp) |
Not executables or libraries |
| Source files | Not in ldd output |
Why not a .deb package?
The runtime stage uses distroless/cc-debian13 which doesn't include dpkg or any package manager. The ldd + copy approach is the standard pattern for distroless images — it's essentially a manual "shrink-wrap" of runtime dependencies without adding packaging complexity.
Summary
Only 27 shared library files (all .so files) totaling ~83MB are copied to the runtime image. No intermediate build artifacts (object files, CMake files, headers, etc.) are included.
📝 Description
This PR modernizes RobotVision’s CMake configuration around per‑target C++ standards and shared helpers, and introduces a new minimal Tracker service that consumes the RobotVision library via the updated targets.
Changes
Tests
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: