Skip to content

Commit 0d3ce5a

Browse files
wep21wxmerkt
authored andcommitted
feat: ros2 migration
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
1 parent 948d0f8 commit 0d3ce5a

17 files changed

+1469
-878
lines changed

CMakeLists.txt

Lines changed: 38 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,58 @@
1-
cmake_minimum_required(VERSION 3.0.2)
1+
cmake_minimum_required(VERSION 3.5z)
22
project(octomap_rviz_plugins)
33

4-
find_package(catkin REQUIRED COMPONENTS octomap_msgs
5-
roscpp
6-
rviz
7-
8-
)
9-
10-
find_package(octomap REQUIRED)
11-
find_package(Boost REQUIRED COMPONENTS thread )
4+
if(NOT CMAKE_CXX_STANDARD)
5+
set(CMAKE_CXX_STANDARD 14)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
endif()
9+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
endif()
1212

13-
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
14-
set(QT_LIBRARIES Qt5::Widgets)
13+
find_package(ament_cmake_auto REQUIRED)
14+
ament_auto_find_build_dependencies()
1515

16+
find_package(Qt5 REQUIRED COMPONENTS Widgets)
1617
set(CMAKE_AUTOMOC ON)
1718

18-
add_definitions(-DQT_NO_KEYWORDS)
19-
20-
catkin_package(
21-
INCLUDE_DIRS include
22-
LIBRARIES ${PROJECT_NAME}
23-
CATKIN_DEPENDS octomap_msgs
24-
roscpp
25-
rviz
26-
DEPENDS OCTOMAP
19+
set(octomap_rviz_plugins_headers_to_moc
20+
include/octomap_rviz_plugins/occupancy_grid_display.hpp
21+
include/octomap_rviz_plugins/occupancy_map_display.hpp
2722
)
28-
29-
30-
include_directories(include
31-
${catkin_INCLUDE_DIRS}
32-
${Boost_INCLUDE_DIRS}
33-
${OCTOMAP_INCLUDE_DIRS})
34-
35-
link_directories(${catkin_LIBRARY_DIRS}
36-
${Boost_LIBRARY_DIRS}
37-
${OCTOMAP_LIBRARY_DIRS})
3823

24+
foreach(header "${octomap_rviz_plugins_headers_to_moc}")
25+
qt5_wrap_cpp(octomap_rviz_plugins_moc_files "${header}")
26+
endforeach()
3927

40-
set(SOURCE_FILES
28+
ament_auto_add_library(${PROJECT_NAME} SHARED
29+
${octomap_rviz_plugins_moc_files}
4130
src/occupancy_grid_display.cpp
42-
src/occupancy_map_display.cpp
31+
src/occupancy_map_display.cpp
4332
)
4433

45-
set(HEADER_FILES
46-
include/octomap_rviz_plugins/occupancy_grid_display.h
47-
include/octomap_rviz_plugins/occupancy_map_display.h
34+
target_link_libraries(${PROJECT_NAME}
35+
Qt5::Widgets
36+
${OCTOMAP_LIBRARIES}
4837
)
4938

50-
add_library(${PROJECT_NAME} MODULE ${SOURCE_FILES} ${HEADER_FILES})
51-
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES} ${catkin_LIBRARIES})
52-
target_compile_options(${PROJECT_NAME} PUBLIC "-Wno-register") # Avoid OGRE deprecaton warnings under C++17
53-
54-
install(DIRECTORY include/${PROJECT_NAME}/
55-
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
39+
target_include_directories(${PROJECT_NAME} PUBLIC
40+
${Qt5Widgets_INCLUDE_DIRS}
5641
)
5742

58-
install(TARGETS ${PROJECT_NAME}
59-
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
60-
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
61-
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
62-
)
43+
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
44+
target_compile_definitions(${PROJECT_NAME} PRIVATE "OCTOMAP_RVIZ_PLUGINS_BUILDING_LIBRARY")
45+
46+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
47+
48+
if(BUILD_TESTING)
49+
find_package(ament_lint_auto REQUIRED)
50+
ament_lint_auto_find_test_dependencies()
51+
endif()
6352

64-
install(FILES plugin_description.xml
65-
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
53+
ament_auto_package(
54+
INSTALL_TO_SHARE
55+
icons
6656
)
6757

6858

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Any contribution that you make to this repository will
2+
be under the 3-Clause BSD License, as dictated by that
3+
[license](https://opensource.org/licenses/BSD-3-Clause).
4+
5+
~~~
6+
1. Submission of Contributions. Unless You explicitly state otherwise,
7+
any Contribution intentionally submitted for inclusion in the Work
8+
by You to the Licensor shall be under the terms and conditions of
9+
this License, without any additional terms or conditions.
10+
Notwithstanding the above, nothing herein shall supersede or modify
11+
the terms of any separate license agreement you may have executed
12+
with Licensor regarding such Contributions.
13+
~~~
14+
15+
Contributors must sign-off each commit by adding a `Signed-off-by: ...`
16+
line to commit messages to certify that they have the right to submit
17+
the code they are contributing to the project according to the
18+
[Developer Certificate of Origin (DCO)](https://developercertificate.org/).

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2013, Willow Garage, Inc.
4+
Copyright (c) 2018, Bosch Software Innovations GmbH.
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
* Neither the name of the copyright holder nor the names of its
18+
contributors may be used to endorse or promote products derived from
19+
this software without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

icons/classes/ColorOccupancyGrid.png

62.5 KB
Loading

icons/classes/OccupancyGrid.png

62.5 KB
Loading
62.5 KB
Loading

icons/classes/OccupancyMap.png

260 Bytes
Loading

icons/classes/OccupancyMapStamped.png

260 Bytes
Loading

include/octomap_rviz_plugins/occupancy_grid_display.h

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)