Skip to content

Commit

Permalink
Update the code to use a non-deprecated header.
Browse files Browse the repository at this point in the history
This requires a little additional work, since Humble
does not have that header.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette committed Jun 26, 2023
1 parent 7b60f8d commit b103b86
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Expand Up @@ -2,15 +2,22 @@ cmake_minimum_required(VERSION 3.5)
project(depthimage_to_laserscan)
include(GenerateExportHeader)

# Default to C++14
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

message(STATUS "CHRIS: ROS_DISTRO: $ENV{ROS_DISTRO}")
if(DEFINED ENV{ROS_DISTRO})
if("$ENV{ROS_DISTRO}" STREQUAL "humble")
add_definitions(-DLEGACY_PINHOLE_CAMERA_INCLUDE=1)
endif()
endif()

find_package(ament_cmake_ros REQUIRED)

find_package(image_geometry REQUIRED)
Expand Down
4 changes: 4 additions & 0 deletions include/depthimage_to_laserscan/DepthImageToLaserScan.hpp
Expand Up @@ -38,7 +38,11 @@

#include "depthimage_to_laserscan/DepthImageToLaserScan_export.h"
#include "depthimage_to_laserscan/depth_traits.hpp"
#ifdef LEGACY_PINHOLE_CAMERA_INCLUDE
#include "image_geometry/pinhole_camera_model.h"
#else
#include "image_geometry/pinhole_camera_model.hpp"
#endif
#include <opencv2/core/core.hpp>
#include <sensor_msgs/msg/camera_info.hpp>
#include <sensor_msgs/msg/image.hpp>
Expand Down
3 changes: 3 additions & 0 deletions package.xml
Expand Up @@ -13,6 +13,9 @@

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<!-- Used to determine which ROS version is available at build time -->
<build_depend>ros_environment</build_depend>

<depend>image_geometry</depend>
<depend>libopencv-dev</depend>
<depend>rclcpp</depend>
Expand Down

0 comments on commit b103b86

Please sign in to comment.