Skip to content
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

Removed catkin_simple and make catkin optional for base package. #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ The library can be compiled separately from the ROS interface if you're not usin

Requires the following dependencies to be installed:

- *catkin_simple* `https://github.com/catkin/catkin_simple.git`
- *eigen_conversions* `sudo apt install ros-noetic-eigen-conversions`

Compile using your favorite catkin build tool (e.g. `catkin build linefit_ground_segmentation_ros`)
Expand Down
56 changes: 44 additions & 12 deletions linefit_ground_segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
cmake_minimum_required(VERSION 2.8.3)
project(linefit_ground_segmentation)

find_package(catkin_simple 0.1.0 REQUIRED )
find_package(catkin)

catkin_simple(ALL_DEPS_REQUIRED)
find_package(PCL REQUIRED)

find_package(Eigen3 REQUIRED)

add_definitions(-std=c++14)
IF(catkin_FOUND)

catkin_package(
INCLUDE_DIRS include ${EIGEN3_INCLUDE_DIR}
LIBRARIES ${PROJECT_NAME}
DEPENDS PCL
)

ENDIF()

include_directories(
include
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} SHARED
src/ground_segmentation.cc
src/segment.cc
src/bin.cc
src/viewer.cc
)

target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

find_package(Eigen3 REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})

cs_add_library(${PROJECT_NAME} src/ground_segmentation.cc src/segment.cc src/bin.cc src/viewer.cc)
IF(catkin_FOUND)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

install(DIRECTORY include/
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)

#add_doxygen(NOT_AUTOMATIC)
ENDIF()

cs_install()
cs_export()

#############
# QTCREATOR #
Expand Down
1 change: 0 additions & 1 deletion linefit_ground_segmentation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>catkin_simple</buildtool_depend>

</package>

52 changes: 38 additions & 14 deletions linefit_ground_segmentation_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
cmake_minimum_required(VERSION 2.8.3)
project(linefit_ground_segmentation_ros)

find_package(catkin_simple 0.1.0 REQUIRED )

catkin_simple(ALL_DEPS_REQUIRED)

add_definitions(-std=c++14)

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
find_package(catkin REQUIRED
eigen_conversions
linefit_ground_segmentation
pcl_conversions
pcl_ros
roscpp
tf2_ros
)

catkin_package(
CATKIN_DEPENDS
eigen_conversions
linefit_ground_segmentation
pcl_conversions
pcl_ros
roscpp
tf2_ros
)
message(catkin_INCLUDE_DIRS="${catkin_INCLUDE_DIRS}")

include_directories(
${catkin_INCLUDE_DIRS}
)

add_executable(ground_segmentation_node src/ground_segmentation_node.cc)
add_executable(ground_segmentation_test_node src/ground_segmentation_test_node.cc)
target_link_libraries(ground_segmentation_node ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(ground_segmentation_test_node ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(ground_segmentation_node ${catkin_LIBRARIES})
target_link_libraries(ground_segmentation_test_node ${catkin_LIBRARIES})
target_compile_features(ground_segmentation_node PRIVATE cxx_std_14)
target_compile_features(ground_segmentation_test_node PRIVATE cxx_std_14)

#add_doxygen(NOT_AUTOMATIC)

cs_install()
cs_export()
install(TARGETS ground_segmentation_node ground_segmentation_test_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(
FILES
launch/segmentation.launch
launch/test.launch
launch/segmentation_params.yaml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

#############
# QTCREATOR #
Expand Down
8 changes: 4 additions & 4 deletions linefit_ground_segmentation_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>catkin_simple</buildtool_depend>

<depend>eigen_conversions</depend>
<depend>roscpp</depend>
<depend>tf2_ros</depend>

<depend>linefit_ground_segmentation</depend>
<depend>roscpp</depend>
<depend>pcl_conversions</depend>
<depend>pcl_ros</depend>
<depend>tf2_ros</depend>

</package>

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <eigen_conversions/eigen_msg.h>
#include <ros/ros.h>
#include <pcl/common/transforms.h>
#include <pcl/io/ply_io.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl_ros/point_cloud.h>
#include <tf2_ros/transform_listener.h>
Expand Down