Skip to content

Commit 146f71a

Browse files
authored
Merge pull request #41 from wep21/feature/ros2-migration
ROS2 Migration
2 parents 09bc9ad + 8be3ad4 commit 146f71a

19 files changed

+1544
-893
lines changed

.github/workflows/build_and_test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ROS2 CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'ros2'
7+
8+
jobs:
9+
test_environment:
10+
runs-on: [ubuntu-latest]
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
ros_distribution:
15+
- foxy
16+
- galactic
17+
- rolling
18+
include:
19+
# Foxy Fitzroy (June 2020 - May 2023)
20+
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
21+
ros_distribution: foxy
22+
ros_version: 2
23+
# Galactic Geochelone (May 2021 - November 2022)
24+
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
25+
ros_distribution: galactic
26+
ros_version: 2
27+
# Rolling Ridley (June 2020 - Present)
28+
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
29+
ros_distribution: rolling
30+
ros_version: 2
31+
container:
32+
image: ${{ matrix.docker_image }}
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 2
38+
39+
- name: Search packages in this repository
40+
id: list_packages
41+
run: |
42+
echo ::set-output name=package_list::$(colcon list --names-only)
43+
- name: Setup ROS environment
44+
uses: ros-tooling/setup-ros@v0.2
45+
with:
46+
required-ros-distributions: ${{ matrix.ros_distribution }}
47+
48+
- name: build and test
49+
uses: ros-tooling/action-ros-ci@v0.2
50+
with:
51+
package-name: ${{ steps.list_packages.outputs.package_list }}
52+
target-ros2-distro: ${{ matrix.ros_distribution }}
53+
vcs-repo-file-url: ""

.github/workflows/industrial_ci_action.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
2-
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)
3-
4-
name: CI
5-
6-
# This determines when this workflow is run
1+
name: Industrial-CI
72
on: [push, pull_request] # on all pushes and PRs
83

94
jobs:
105
CI:
116
strategy:
127
matrix:
138
env:
14-
- {ROS_DISTRO: kinetic}
15-
- {ROS_DISTRO: melodic}
16-
- {ROS_DISTRO: noetic}
17-
- {ROS_DISTRO: kinetic, PRERELEASE: true}
18-
- {ROS_DISTRO: melodic, PRERELEASE: true}
19-
- {ROS_DISTRO: noetic, PRERELEASE: true}
9+
- {ROS_DISTRO: foxy}
10+
- {ROS_DISTRO: galactic}
11+
- {ROS_DISTRO: rolling}
12+
- {ROS_DISTRO: foxy, PRERELEASE: true}
13+
- {ROS_DISTRO: galactic, PRERELEASE: true}
14+
- {ROS_DISTRO: rolling, PRERELEASE: true}
2015
env:
2116
CCACHE_DIR: /github/home/.ccache # Enable ccache
2217
runs-on: ubuntu-latest

CMakeLists.txt

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,66 @@
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+
# Check version of rclcpp to switch between features (message_lost_callback):
47+
# - Foxy is on rclcpp 2.x
48+
# - Galactic is on rclcpp 9.x
49+
# - Rolling (currently) is on rclcpp 14.x
50+
if(${rclcpp_VERSION_MAJOR} VERSION_LESS "3.0.0")
51+
target_compile_definitions(${PROJECT_NAME} PRIVATE "FOXY")
52+
endif()
53+
54+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
55+
56+
if(BUILD_TESTING)
57+
find_package(ament_lint_auto REQUIRED)
58+
ament_lint_auto_find_test_dependencies()
59+
endif()
6360

64-
install(FILES plugin_description.xml
65-
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
61+
ament_auto_package(
62+
INSTALL_TO_SHARE
63+
icons
6664
)
6765

6866

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)