Skip to content

Commit

Permalink
work around compile error on Iron
Browse files Browse the repository at this point in the history
  • Loading branch information
berndpfrommer committed Jul 10, 2024
1 parent 39fe5fa commit 61d52a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spinnaker_camera_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ message(STATUS "libSpinnaker include location: ${SPINNAKER_INCLUDE_DIRS}")

find_package(SPINNAKER REQUIRED)

# special case the older Spinnaker API
if(DEFINED ENV{ROS_DISTRO})
if($ENV{ROS_DISTRO} STREQUAL "foxy" OR
$ENV{ROS_DISTRO} STREQUAL "galactic")
add_definitions(-DUSE_OLD_SPINNAKER_API)
endif()
else()
message(FATAL_ERROR "ROS_DISTRO environment variable is not set!")
endif()

include_directories(SYSTEM
${SPINNAKER_INCLUDE_DIRS})

Expand All @@ -79,7 +89,6 @@ set(ROS_DEPENDENCIES
"image_transport"
"flir_camera_msgs")


# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions spinnaker_camera_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>ros_environment</buildtool_depend> <!-- ROS_VERSION + ROS_DISTRO -->

<build_depend>python3-distro</build_depend> <!-- to get lsb_release for downloading Spinnaker -->
<build_depend>curl</build_depend> <!-- to get ca-certificates for downloading Spinnaker -->
Expand Down
7 changes: 7 additions & 0 deletions spinnaker_camera_driver/src/spinnaker_wrapper_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ SpinnakerWrapperImpl::SpinnakerWrapperImpl()

void SpinnakerWrapperImpl::refreshCameraList()
{
#ifdef USE_OLD_SPINNAKER_API
cameraList_ = system_->GetCameras();
for (size_t cam_idx = 0; cam_idx < cameraList_.GetSize(); cam_idx++) {
const auto cam = cameraList_[cam_idx];
}
#else
cameraList_.Clear();

Spinnaker::InterfaceList interfaceList = system_->GetInterfaces();
Expand Down Expand Up @@ -150,6 +156,7 @@ void SpinnakerWrapperImpl::refreshCameraList()
} // end for interfaceList

interfaceList.Clear();
#endif
}

SpinnakerWrapperImpl::~SpinnakerWrapperImpl()
Expand Down

0 comments on commit 61d52a5

Please sign in to comment.