Skip to content

Commit b419432

Browse files
authored
Merge pull request #14 from wep21/feature/ros2-migration
ROS2 Migration
2 parents ed2ee3a + 9067b5e commit b419432

11 files changed

+624
-399
lines changed

.github/workflows/build_and_test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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: setup directories
35+
run: mkdir -p ros_ws/src
36+
- name: checkout
37+
uses: actions/checkout@v2
38+
with:
39+
path: ros_ws/src
40+
- name: build and test
41+
uses: ros-tooling/action-ros-ci@master
42+
with:
43+
package-name: octomap_ros
44+
target-ros2-distro: ${{ matrix.ros_distribution }}
45+
vcs-repo-file-url: ""

.travis.yml

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

CMakeLists.txt

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
cmake_minimum_required(VERSION 2.8)
1+
cmake_minimum_required(VERSION 3.5)
22
project(octomap_ros)
33

4-
find_package(catkin REQUIRED COMPONENTS octomap_msgs sensor_msgs tf)
5-
find_package(OCTOMAP REQUIRED)
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()
612

7-
catkin_package(
8-
INCLUDE_DIRS include
9-
LIBRARIES ${PROJECT_NAME}
10-
CATKIN_DEPENDS octomap_msgs sensor_msgs tf
11-
DEPENDS OCTOMAP)
13+
find_package(ament_cmake_auto REQUIRED)
14+
ament_auto_find_build_dependencies()
1215

13-
include_directories(include ${catkin_INCLUDE_DIRS})
16+
ament_auto_add_library(${PROJECT_NAME} SHARED
17+
src/conversions.cpp
18+
)
1419

15-
add_library(${PROJECT_NAME} src/conversions.cpp)
16-
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
17-
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OCTOMAP_LIBRARIES})
18-
target_include_directories(${PROJECT_NAME}
19-
SYSTEM PUBLIC ${catkin_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS}
20-
PUBLIC include)
20+
if(BUILD_TESTING)
21+
find_package(ament_lint_auto REQUIRED)
22+
ament_lint_auto_find_test_dependencies()
2123

22-
install(TARGETS ${PROJECT_NAME}
23-
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
24-
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
24+
ament_add_gtest(test_${PROJECT_NAME}
25+
test/test_conversions.cpp
26+
)
27+
target_link_libraries(test_${PROJECT_NAME}
28+
gtest_main
29+
octomap
30+
octomap_ros
31+
)
32+
endif()
2533

26-
install(DIRECTORY include/${PROJECT_NAME}/
27-
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/${PROJECT_NAME}/
28-
FILES_MATCHING PATTERN "*.h"
29-
PATTERN ".svn" EXCLUDE)
34+
ament_auto_package()

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

include/octomap_ros/conversions.h

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

0 commit comments

Comments
 (0)