-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor project structure and update README for clarity #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
fab74be
825aa5a
9b08c33
de0b4cc
9951fb5
0220f23
154b873
5718197
b3b8e5b
074ba63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,14 @@ | ||||||||||||
| cmake_minimum_required(VERSION 3.28) | ||||||||||||
| project(f4f_ros2_template) | ||||||||||||
| project(ros2_pkg_template) | ||||||||||||
|
|
||||||||||||
| # --- Export & Symlink compile_commands.json --- | ||||||||||||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||||||||||||
| set(SOURCE_JSON "${CMAKE_SOURCE_DIR}/compile_commands.json") | ||||||||||||
| set(BINARY_JSON "${CMAKE_BINARY_DIR}/compile_commands.json") | ||||||||||||
|
|
||||||||||||
| if(EXISTS ${BINARY_JSON} AND NOT EXISTS ${SOURCE_JSON}) | ||||||||||||
| message(STATUS "Symlinking compile_commands.json to source directory") | ||||||||||||
| execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${BINARY_JSON} ${SOURCE_JSON}) | ||||||||||||
| message(STATUS "Symlinking compile_commands.json to source directory") | ||||||||||||
| execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${BINARY_JSON} ${SOURCE_JSON}) | ||||||||||||
| endif() | ||||||||||||
|
|
||||||||||||
| # set the correct standards | ||||||||||||
|
|
@@ -21,7 +21,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) | |||||||||||
| set(USE_ROS_TIMER 0) | ||||||||||||
|
|
||||||||||||
| if(${USE_ROS_TIMER}) | ||||||||||||
| MESSAGE(WARNING "[f4f_ros2_template]: Compiling with ROS Timers. This can cause high CPU load in runtime.") | ||||||||||||
| message(WARNING "[ros2_pkg_template]: Compiling with ROS Timers. This can cause high CPU load in runtime.") | ||||||||||||
| endif() | ||||||||||||
|
|
||||||||||||
| # set the compile options to show code warnings | ||||||||||||
|
|
@@ -51,7 +51,7 @@ find_package(std_srvs REQUIRED) | |||||||||||
| ## -------------------------------------------------------------- | ||||||||||||
|
|
||||||||||||
| # Define the shared library created by this package | ||||||||||||
| add_library(F4FROS2Template_ROS2TemplateComponent SHARED) | ||||||||||||
| add_library(ROS2PKGTemplate_ROS2TemplateComponent SHARED) | ||||||||||||
|
|
||||||||||||
| # Add sources to the shared library | ||||||||||||
| # - Source files should be listed in private section. | ||||||||||||
|
|
@@ -60,9 +60,9 @@ add_library(F4FROS2Template_ROS2TemplateComponent SHARED) | |||||||||||
| # handle them: | ||||||||||||
| # - public headers: `example_plugin_manager` | ||||||||||||
| # - private headers: `example_waypoint_flier_native` | ||||||||||||
| target_sources(F4FROS2Template_ROS2TemplateComponent | ||||||||||||
| target_sources(ROS2PKGTemplate_ROS2TemplateComponent | ||||||||||||
| PRIVATE | ||||||||||||
| "src/ros2_template.cpp" | ||||||||||||
| "src/ros2_template.cpp" | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| # Link to the dependencies used by the library | ||||||||||||
|
|
@@ -72,19 +72,19 @@ target_sources(F4FROS2Template_ROS2TemplateComponent | |||||||||||
| # `<package>::<package>` that include the whole library. | ||||||||||||
| # Message libraries unfortunately do not provide this target and users must link | ||||||||||||
| # against: `${<package>_TARGETS}`. | ||||||||||||
| target_link_libraries(F4FROS2Template_ROS2TemplateComponent | ||||||||||||
| target_link_libraries(ROS2PKGTemplate_ROS2TemplateComponent | ||||||||||||
| PRIVATE | ||||||||||||
| rclcpp::rclcpp | ||||||||||||
| rclcpp_components::component | ||||||||||||
| mrs_lib::mrs_lib | ||||||||||||
| ${mrs_msgs_TARGETS} | ||||||||||||
| ${std_srvs_TARGETS} | ||||||||||||
| rclcpp::rclcpp | ||||||||||||
| rclcpp_components::component | ||||||||||||
| mrs_lib::mrs_lib | ||||||||||||
| ${mrs_msgs_TARGETS} | ||||||||||||
| ${std_srvs_TARGETS} | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+80
to
83
|
||||||||||||
| ${mrs_msgs_TARGETS} | |
| ${std_srvs_TARGETS} | |
| ) | |
| ${std_srvs_TARGETS} | |
| ) |
Copilot
AI
Mar 3, 2026
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.
rclcpp_components_register_nodes() registers the component as ros2_pkg_template::ROS2Template, but the actual component in src/ros2_template.cpp is still declared/registered under the f4f_ros2_template namespace. This mismatch will prevent ros2 launch / component loading from finding the plugin. Align the fully-qualified class name here with the C++ namespace (and update the launch files’ plugin= accordingly if the rename is intentional).
| "ros2_pkg_template::ROS2Template" | |
| "f4f_ros2_template::ROS2Template" |
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.
target_link_libraries()links${mrs_msgs_TARGETS}, but this CMakeLists does notfind_package(mrs_msgs ...)and the sources in this repo don’t appear to usemrs_msgs. Either add the missingfind_package(mrs_msgs REQUIRED)or drop${mrs_msgs_TARGETS}to avoid confusing/fragile link configuration.