@@ -20,26 +20,42 @@ find_package(camera_info_manager REQUIRED)
20
20
find_package (cv_bridge REQUIRED )
21
21
pkg_check_modules (libcamera REQUIRED libcamera>=0.1 )
22
22
23
+ # new param callbacks need at least 17.0.0
24
+ if (${rclcpp_VERSION} VERSION_GREATER_EQUAL "17" )
25
+ add_compile_definitions (RCLCPP_HAS_PARAM_EXT_CB )
26
+ endif ()
27
+
23
28
# library with common utility functions for type conversions
24
29
add_library (utils OBJECT
25
- src/clamp.cpp
26
- src/cv_to_pv.cpp
27
30
src/format_mapping.cpp
28
- src/parameter_conflict_check.cpp
29
31
src/pretty_print.cpp
30
- src/pv_to_cv.cpp
31
- src/types.cpp
32
- src/type_extent.cpp
33
32
)
34
33
target_include_directories (utils PUBLIC ${libcamera_INCLUDE_DIRS} )
35
34
target_link_libraries (utils ${libcamera_LINK_LIBRARIES} )
36
35
ament_target_dependencies (
37
36
utils
38
- "rclcpp"
39
37
"sensor_msgs"
40
38
)
41
39
set_property (TARGET utils PROPERTY POSITION_INDEPENDENT_CODE ON )
42
40
41
+ # library for parameter/controls handling and conversion
42
+ add_library (param OBJECT
43
+ src/clamp.cpp
44
+ src/cv_to_pv.cpp
45
+ # src/parameter_conflict_check.cpp
46
+ src/pv_to_cv.cpp
47
+ src/types.cpp
48
+ src/type_extent.cpp
49
+ src/ParameterHandler.cpp
50
+ )
51
+ target_include_directories (param PUBLIC ${libcamera_INCLUDE_DIRS} )
52
+ target_link_libraries (param ${libcamera_LINK_LIBRARIES} )
53
+ ament_target_dependencies (
54
+ param
55
+ "rclcpp"
56
+ )
57
+ set_property (TARGET param PROPERTY POSITION_INDEPENDENT_CODE ON )
58
+
43
59
# composable ROS2 node
44
60
add_library (camera_component SHARED src/CameraNode.cpp )
45
61
rclcpp_components_register_node (camera_component PLUGIN "camera::CameraNode" EXECUTABLE "camera_node" )
@@ -57,7 +73,7 @@ ament_target_dependencies(
57
73
)
58
74
59
75
target_include_directories (camera_component PUBLIC ${libcamera_INCLUDE_DIRS} )
60
- target_link_libraries (camera_component ${libcamera_LINK_LIBRARIES} utils )
76
+ target_link_libraries (camera_component ${libcamera_LINK_LIBRARIES} utils param )
61
77
62
78
install (TARGETS camera_component
63
79
DESTINATION lib )
0 commit comments