Skip to content

Commit

Permalink
Add rosmon
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias-Fischer committed Feb 18, 2024
1 parent 4db39d9 commit 9334127
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 4 deletions.
24 changes: 24 additions & 0 deletions patch/ros-noetic-catch-ros.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8e8f70..fa1f242 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

add_library(catch_ros_standalone
src/standalone_main.cpp
+ src/meta_info.cpp
)
target_link_libraries(catch_ros_standalone
${Boost_LIBRARIES}
@@ -27,9 +28,11 @@ target_link_libraries(catch_ros_standalone

add_library(catch_ros_rostest
src/rostest_main.cpp
+ src/meta_info.cpp
)
target_link_libraries(catch_ros_rostest
${Boost_LIBRARIES}
+ ${catkin_LIBRARIES}
)

install(FILES src/meta_info.cpp DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
93 changes: 93 additions & 0 deletions patch/ros-noetic-rosfmt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87b8d9b..df90eb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,74 +7,26 @@ find_package(catkin REQUIRED COMPONENTS
rosconsole
)

-# Get fmt from an official release
-include(ExternalProject)
-ExternalProject_Add(
- fmt
- URL https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip
- URL_HASH SHA256=cceb4cb9366e18a5742128cb3524ce5f50e88b476f1e54737a47ffdf4df4c996
- CONFIGURE_COMMAND ""
-
- # We touch all downloaded files, otherwise they get some timestamp in the
- # past and may confuse the dependency tracking below.
- BUILD_COMMAND find <SOURCE_DIR> -type f -exec touch {} +
- INSTALL_COMMAND ""
-)
-
-# Now extract the needed files. We need to copy headers to the devel space
-# b/c of catkin policies (they count as "generated headers").
-ExternalProject_Get_property(fmt SOURCE_DIR)
-set(fmt_SOURCE_DIR "${SOURCE_DIR}")
-set(fmt_HEADER_DEST "${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
-
-file(MAKE_DIRECTORY ${fmt_HEADER_DEST})
-foreach(FILE args.h chrono.h color.h compile.h core.h format-inl.h format.h os.h ostream.h printf.h ranges.h std.h xchar.h)
- set(in "${fmt_SOURCE_DIR}/include/fmt/${FILE}")
- set(out "${fmt_HEADER_DEST}/fmt/${FILE}")
- list(APPEND fmt_HEADERS_OUT ${out})
-
- set_source_files_properties(${in} PROPERTIES GENERATED TRUE)
- set_source_files_properties(${out} PROPERTIES GENERATED TRUE)
-
- add_custom_command(
- OUTPUT ${out}
- DEPENDS ${in} fmt
- COMMAND cmake -E copy_if_different "${in}" "${out}"
- )
-endforeach()
-
-add_custom_target(fmt_headers
- DEPENDS ${fmt_HEADERS_OUT}
-)
+find_package(fmt REQUIRED)

catkin_package(
- INCLUDE_DIRS include ${fmt_HEADER_DEST}
+ INCLUDE_DIRS include
CATKIN_DEPENDS roscpp rosconsole
LIBRARIES rosfmt9
)

include_directories(
- ${fmt_HEADER_DEST}
include
${catkin_INCLUDE_DIRS}
)

-set_source_files_properties(
- ${fmt_SOURCE_DIR}/src/format.cc
- ${fmt_SOURCE_DIR}/src/os.cc
- PROPERTIES GENERATED TRUE
-)
-
add_library(rosfmt9
- ${fmt_HEADERS_OUT}
- ${fmt_SOURCE_DIR}/src/format.cc
- ${fmt_SOURCE_DIR}/src/os.cc
src/rosfmt.cpp
)
target_link_libraries(rosfmt9
${catkin_LIBRARIES}
+ fmt::fmt
)
-add_dependencies(rosfmt9 fmt fmt_headers)

if(CATKIN_ENABLE_TESTING)
add_executable(simple_test
@@ -91,10 +43,6 @@ if(CATKIN_ENABLE_TESTING)
add_dependencies(run_tests run_simple_test)
endif()

-install(
- DIRECTORY ${fmt_HEADER_DEST}/fmt/
- DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/fmt
-)
install(
DIRECTORY include/rosfmt/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
6 changes: 2 additions & 4 deletions vinca_linux_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,13 @@ packages_select_by_deps:
- audio-common-msgs
- sound-play
- pid
- rosfmt
- rosmon

# Needs fixing in CI, uploaded manually
- rtabmap
- rtabmap-ros

# Used to work on robostack-staging, now broken
# - rosfmt # see https://github.com/xqms/rosfmt/issues/12
# - rosmon # because of https://github.com/xqms/rosfmt/issues/12

# Not compatible with recent libabsl
# - libfranka
# - franka
Expand Down
1 change: 1 addition & 0 deletions vinca_osx_arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,6 @@ packages_select_by_deps:
- slam-toolbox
- turtlebot3-teleop
- move-base
- rosfmt

patch_dir: patch

0 comments on commit 9334127

Please sign in to comment.