Skip to content

ROS2 Migration #41

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

Merged
merged 8 commits into from
Dec 21, 2021
Merged
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
53 changes: 53 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ROS2 CI

on:
pull_request:
branches:
- 'ros2'

jobs:
test_environment:
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
ros_distribution:
- foxy
- galactic
- rolling
include:
# Foxy Fitzroy (June 2020 - May 2023)
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-foxy-ros-base-latest
ros_distribution: foxy
ros_version: 2
# Galactic Geochelone (May 2021 - November 2022)
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-ros-base-latest
ros_distribution: galactic
ros_version: 2
# Rolling Ridley (June 2020 - Present)
- docker_image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
ros_distribution: rolling
ros_version: 2
container:
image: ${{ matrix.docker_image }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Search packages in this repository
id: list_packages
run: |
echo ::set-output name=package_list::$(colcon list --names-only)
- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.2
with:
required-ros-distributions: ${{ matrix.ros_distribution }}

- name: build and test
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: ${{ steps.list_packages.outputs.package_list }}
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ""
19 changes: 7 additions & 12 deletions .github/workflows/industrial_ci_action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: CI

# This determines when this workflow is run
name: Industrial-CI
on: [push, pull_request] # on all pushes and PRs

jobs:
CI:
strategy:
matrix:
env:
- {ROS_DISTRO: kinetic}
- {ROS_DISTRO: melodic}
- {ROS_DISTRO: noetic}
- {ROS_DISTRO: kinetic, PRERELEASE: true}
- {ROS_DISTRO: melodic, PRERELEASE: true}
- {ROS_DISTRO: noetic, PRERELEASE: true}
- {ROS_DISTRO: foxy}
- {ROS_DISTRO: galactic}
- {ROS_DISTRO: rolling}
- {ROS_DISTRO: foxy, PRERELEASE: true}
- {ROS_DISTRO: galactic, PRERELEASE: true}
- {ROS_DISTRO: rolling, PRERELEASE: true}
env:
CCACHE_DIR: /github/home/.ccache # Enable ccache
runs-on: ubuntu-latest
Expand Down
94 changes: 46 additions & 48 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,66 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.5z)
project(octomap_rviz_plugins)

find_package(catkin REQUIRED COMPONENTS octomap_msgs
roscpp
rviz
)

find_package(octomap REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread )
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
set(QT_LIBRARIES Qt5::Widgets)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

find_package(Qt5 REQUIRED COMPONENTS Widgets)
set(CMAKE_AUTOMOC ON)

add_definitions(-DQT_NO_KEYWORDS)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS octomap_msgs
roscpp
rviz
DEPENDS OCTOMAP
set(octomap_rviz_plugins_headers_to_moc
include/octomap_rviz_plugins/occupancy_grid_display.hpp
include/octomap_rviz_plugins/occupancy_map_display.hpp
)


include_directories(include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS})

link_directories(${catkin_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
${OCTOMAP_LIBRARY_DIRS})

foreach(header "${octomap_rviz_plugins_headers_to_moc}")
qt5_wrap_cpp(octomap_rviz_plugins_moc_files "${header}")
endforeach()

set(SOURCE_FILES
ament_auto_add_library(${PROJECT_NAME} SHARED
${octomap_rviz_plugins_moc_files}
src/occupancy_grid_display.cpp
src/occupancy_map_display.cpp
src/occupancy_map_display.cpp
)

set(HEADER_FILES
include/octomap_rviz_plugins/occupancy_grid_display.h
include/octomap_rviz_plugins/occupancy_map_display.h
target_link_libraries(${PROJECT_NAME}
Qt5::Widgets
${OCTOMAP_LIBRARIES}
)

add_library(${PROJECT_NAME} MODULE ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES} ${catkin_LIBRARIES})
target_compile_options(${PROJECT_NAME} PUBLIC "-Wno-register") # Avoid OGRE deprecaton warnings under C++17

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
target_include_directories(${PROJECT_NAME} PUBLIC
${Qt5Widgets_INCLUDE_DIRS}
)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
target_compile_definitions(${PROJECT_NAME} PRIVATE "OCTOMAP_RVIZ_PLUGINS_BUILDING_LIBRARY")

# Check version of rclcpp to switch between features (message_lost_callback):
# - Foxy is on rclcpp 2.x
# - Galactic is on rclcpp 9.x
# - Rolling (currently) is on rclcpp 14.x
if(${rclcpp_VERSION_MAJOR} VERSION_LESS "3.0.0")
target_compile_definitions(${PROJECT_NAME} PRIVATE "FOXY")
endif()

pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(FILES plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
ament_auto_package(
INSTALL_TO_SHARE
icons
)


18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Any contribution that you make to this repository will
be under the 3-Clause BSD License, as dictated by that
[license](https://opensource.org/licenses/BSD-3-Clause).

~~~
1. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~

Contributors must sign-off each commit by adding a `Signed-off-by: ...`
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
[Developer Certificate of Origin (DCO)](https://developercertificate.org/).
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) 2013, Willow Garage, Inc.
Copyright (c) 2018, Bosch Software Innovations GmbH.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file added icons/classes/ColorOccupancyGrid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/classes/OccupancyGrid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/classes/OccupancyGridStamped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/classes/OccupancyMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/classes/OccupancyMapStamped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 0 additions & 146 deletions include/octomap_rviz_plugins/occupancy_grid_display.h

This file was deleted.

Loading