forked from Slamtec/rplidar_ros
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ROS 2 port * Port CMakeLists.txt * Port package.xml * Port client.cpp * Port node.cpp Fix compilation Signed-off-by: Hunter L. Allen <[email protected]>
- Loading branch information
Showing
4 changed files
with
134 additions
and
80 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,41 +1,53 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
cmake_minimum_required(VERSION 3.9.5) | ||
project(rplidar_ros) | ||
|
||
# Default to C++14 | ||
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) | ||
endif() | ||
|
||
set(RPLIDAR_SDK_PATH "./sdk/") | ||
|
||
FILE(GLOB RPLIDAR_SDK_SRC | ||
FILE(GLOB RPLIDAR_SDK_SRC | ||
"${RPLIDAR_SDK_PATH}/src/arch/linux/*.cpp" | ||
"${RPLIDAR_SDK_PATH}/src/hal/*.cpp" | ||
"${RPLIDAR_SDK_PATH}/src/*.cpp" | ||
) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
roscpp | ||
rosconsole | ||
sensor_msgs | ||
set(req_deps | ||
"rclcpp" | ||
# "rosconsole" | ||
"sensor_msgs" | ||
) | ||
|
||
find_package(ament_cmake_auto REQUIRED) | ||
find_package(ament_cmake_ros REQUIRED) | ||
|
||
ament_auto_find_build_dependencies(REQUIRED ${req_deps}) | ||
|
||
include_directories( | ||
${RPLIDAR_SDK_PATH}/include | ||
${RPLIDAR_SDK_PATH}/src | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
|
||
catkin_package() | ||
ament_auto_add_executable(rplidarNode src/node.cpp ${RPLIDAR_SDK_SRC}) | ||
ament_target_dependencies(rplidarNode ${req_deps}) | ||
|
||
add_executable(rplidarNode src/node.cpp ${RPLIDAR_SDK_SRC}) | ||
target_link_libraries(rplidarNode ${catkin_LIBRARIES}) | ||
ament_auto_add_executable(rplidarNodeClient src/client.cpp) | ||
ament_target_dependencies(rplidarNodeClient ${req_deps}) | ||
|
||
add_executable(rplidarNodeClient src/client.cpp) | ||
target_link_libraries(rplidarNodeClient ${catkin_LIBRARIES}) | ||
|
||
install(TARGETS rplidarNode rplidarNodeClient | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
install( | ||
TARGETS rplidarNode rplidarNodeClient | ||
DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
install(DIRECTORY launch rviz sdk | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
USE_SOURCE_PERMISSIONS | ||
) | ||
# TODO(hallen): port this | ||
# install(DIRECTORY launch rviz sdk | ||
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
# USE_SOURCE_PERMISSIONS | ||
# ) | ||
|
||
ament_auto_package() |
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,20 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<package format="3"> | ||
<name>rplidar_ros</name> | ||
<version>1.10.0</version> | ||
<description>The rplidar ros package, support rplidar A2/A1 and A3/S1</description> | ||
|
||
<maintainer email="[email protected]">Slamtec ROS Maintainer</maintainer> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<build_depend>roscpp</build_depend> | ||
<build_depend>rosconsole</build_depend> | ||
<buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
<buildtool_depend>ament_cmake_ros</buildtool_depend> | ||
|
||
<build_depend>rclcpp</build_depend> | ||
<!-- <build_depend>rosconsole</build_depend> --> | ||
<build_depend>sensor_msgs</build_depend> | ||
<build_depend>std_srvs</build_depend> | ||
<run_depend>roscpp</run_depend> | ||
<run_depend>rosconsole</run_depend> | ||
<run_depend>sensor_msgs</run_depend> | ||
<run_depend>std_srvs</run_depend> | ||
|
||
<exec_depend>rclcpp</exec_depend> | ||
<!-- <exec_depend>rosconsole</exec_depend> --> | ||
<exec_depend>sensor_msgs</exec_depend> | ||
<exec_depend>std_srvs</exec_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
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