-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from klintan/image-proc-dashing
Dashing: Image_proc with old PR comments fixed
- Loading branch information
Showing
18 changed files
with
528 additions
and
1,331 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,97 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(image_proc) | ||
|
||
find_package(catkin REQUIRED) | ||
# ROS2 Flags | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 14) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
find_package(catkin REQUIRED cv_bridge dynamic_reconfigure image_geometry image_transport nodelet nodelet_topic_tools roscpp sensor_msgs) | ||
find_package(ament_cmake REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(rclcpp_components REQUIRED) | ||
find_package(cv_bridge REQUIRED) | ||
find_package(image_transport REQUIRED) | ||
find_package(sensor_msgs REQUIRED) | ||
find_package(OpenCV REQUIRED) | ||
find_package(Boost REQUIRED COMPONENTS thread) | ||
find_package(image_geometry REQUIRED) | ||
|
||
if(cv_bridge_VERSION VERSION_GREATER "1.12.0") | ||
add_compile_options(-std=c++11) | ||
endif() | ||
include_directories(include) | ||
|
||
# Dynamic reconfigure support | ||
generate_dynamic_reconfigure_options(cfg/CropDecimate.cfg cfg/Debayer.cfg cfg/Rectify.cfg cfg/Resize.cfg) | ||
add_library(rectify SHARED | ||
src/rectify.cpp) | ||
target_compile_definitions(rectify | ||
PRIVATE "COMPOSITION_BUILDING_DLL") | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS image_geometry roscpp sensor_msgs | ||
DEPENDS OpenCV | ||
INCLUDE_DIRS include | ||
LIBRARIES ${PROJECT_NAME} | ||
) | ||
ament_target_dependencies(rectify | ||
"image_geometry" | ||
"sensor_msgs" | ||
"cv_bridge" | ||
"class_loader" | ||
"image_transport" | ||
"rclcpp" | ||
"rclcpp_components" | ||
) | ||
|
||
rclcpp_components_register_nodes(rectify "image_proc::RectifyNode") | ||
set(node_plugins "${node_plugins}image_proc::RectifyNode;$<TARGET_FILE:rectify>\n") | ||
|
||
include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) | ||
|
||
# Temporary fix for DataType deprecation in OpenCV 3.3.1. We continue to use the deprecated form for now because | ||
# the new one is not available in OpenCV 2.4 (on Trusty). | ||
add_definitions(-DOPENCV_TRAITS_ENABLE_DEPRECATED) | ||
|
||
# Nodelet library | ||
add_library(${PROJECT_NAME} src/libimage_proc/processor.cpp | ||
src/nodelets/debayer.cpp | ||
src/nodelets/rectify.cpp | ||
src/nodelets/resize.cpp | ||
src/nodelets/crop_decimate.cpp | ||
src/libimage_proc/advertisement_checker.cpp | ||
src/nodelets/edge_aware.cpp | ||
src/nodelets/crop_non_zero.cpp | ||
) | ||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg) | ||
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OpenCV_LIBRARIES}) | ||
add_library(debayer SHARED | ||
src/debayer.cpp | ||
src/edge_aware.cpp | ||
) | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
) | ||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
) | ||
install(FILES nodelet_plugins.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
target_compile_definitions(debayer | ||
PRIVATE "COMPOSITION_BUILDING_DLL") | ||
|
||
ament_target_dependencies(debayer | ||
"sensor_msgs" | ||
"cv_bridge" | ||
"class_loader" | ||
"image_transport" | ||
"rclcpp" | ||
"rclcpp_components" | ||
) | ||
|
||
rclcpp_components_register_nodes(debayer "image_proc::DebayerNode") | ||
set(node_plugins "${node_plugins}image_proc::DebayerNode;$<TARGET_FILE:debayer>\n") | ||
|
||
add_executable(image_proc | ||
src/image_proc.cpp | ||
) | ||
target_link_libraries(image_proc | ||
debayer | ||
rectify | ||
ament_index_cpp::ament_index_cpp) | ||
|
||
# Standalone node | ||
add_executable(image_proc_exe src/nodes/image_proc.cpp) | ||
target_link_libraries(image_proc_exe ${PROJECT_NAME} ${Boost_LIBRARIES} ${OpenCV_LIBRARIES}) | ||
SET_TARGET_PROPERTIES(image_proc_exe PROPERTIES OUTPUT_NAME image_proc) | ||
install(TARGETS image_proc_exe | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
target_link_libraries(image_proc "stdc++fs") | ||
endif() | ||
|
||
ament_target_dependencies(image_proc | ||
"image_geometry" | ||
"sensor_msgs" | ||
"cv_bridge" | ||
"class_loader" | ||
"image_transport" | ||
"rclcpp" | ||
"rclcpp_components" | ||
"rcutils" | ||
) | ||
|
||
# install the launch file | ||
install(DIRECTORY launch | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/ | ||
install(TARGETS | ||
debayer | ||
rectify | ||
ARCHIVE DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
) | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
add_subdirectory(test) | ||
endif() | ||
install(TARGETS | ||
image_proc | ||
DESTINATION lib/${PROJECT_NAME}) | ||
ament_package() |
Empty file.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.