Repository navigation
cartographer_ros: build offline_node.cpp into cartographer_offline_node, not the library - #233
Open
lucascolley wants to merge 1 commit into
Open
lucascolley wants to merge 1 commit into
lucascolley wants to merge 1 commit into
Conversation
…de, not the library src/offline_node.cpp defines gflags (collect_metrics, configuration_directory, ...) that node_main.cpp and assets_writer_main.cpp define too. Upstream builds the library statically, so the linker leaves offline_node.o out of the other executables; RoboStack builds it shared, so every executable loads it, gflags registers each flag twice and cartographer_node aborts at startup: ERROR: flag 'collect_metrics' was defined more than once (in files '.../src/offline_node.cpp' and '.../src/node_main.cpp') Move offline_node.cpp into the cartographer_offline_node executable, in every distribution's patch (lyrical and rolling, whose patch links each target explicitly, also link that executable to urdf and tf2_msgs, which the library links privately). New build of cartographer_ros in every distribution. Verified on osx-arm64 for humble, jazzy, lyrical and rolling: cartographer_node gets past flag registration (fails on the missing configuration instead), and cartographer_offline_node links and parses its own flags.
Tobias-Fischer
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR fixes a shared library vs. static library problem with the build of
cartographer_ros, for tartanroboticscollective/ros2-workshop-turtlebot3#30.LLM text:
src/offline_node.cppdefines gflags (collect_metrics,configuration_directory,...) that
node_main.cppandassets_writer_main.cppdefine too. Upstream buildsthe library statically, so the linker leaves
offline_node.oout of the otherexecutables; RoboStack builds it shared, so every executable loads it, gflags
registers each flag twice and
cartographer_nodeaborts at startup:Move
offline_node.cppinto thecartographer_offline_nodeexecutable, in everydistribution's patch (lyrical and rolling, whose patch links each target
explicitly, also link that executable to
urdfandtf2_msgs, which the librarylinks privately). New build of
cartographer_rosin every distribution.Verified on osx-arm64 for humble, jazzy, lyrical and rolling:
cartographer_nodegets past flag registration (fails on the missing configuration instead), and
cartographer_offline_nodelinks and parses its own flags.