Skip to content

Commit

Permalink
support focal and jammy for galactic build
Browse files Browse the repository at this point in the history
  • Loading branch information
berndpfrommer committed Mar 27, 2024
1 parent 9b63c19 commit 8793d38
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/industrial_ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ROS_DISTRO: [humble]
ROS_DISTRO: [galactic, humble, iron]
ROS_REP: [testing, main]
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache" # directory for ccache (and how we enable ccache in industrial_ci)
Expand Down
9 changes: 1 addition & 8 deletions spinnaker_camera_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,9 @@ add_library(camera_driver SHARED
src/genicam_utils.cpp
)

# ament_target_dependencies(camera_driver PUBLIC ${ROS_DEPENDENCIES})
ament_target_dependencies(camera_driver PUBLIC ${ROS_DEPENDENCIES})
target_link_libraries(camera_driver
PUBLIC
rclcpp::rclcpp
rclcpp_components::component
camera_info_manager::camera_info_manager
image_transport::image_transport
${flir_camera_msgs_TARGETS}
${sensor_msgs_TARGETS}
${std_msgs_TARGETS}
yaml-cpp
PRIVATE
Spinnaker::Spinnaker)
Expand Down
5 changes: 2 additions & 3 deletions spinnaker_camera_driver/cmake/DownloadSpinnaker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ function(download_spinnaker FLIR_LIB_VAR FLIR_INCLUDE_DIR_VAR)
message(FATAL_ERROR "Downloading libSpinnaker for non-linux systems not supported")
endif()

#find_program(LSB_RELEASE_EXEC lsb_release REQUIRED)
find_program(LSB_RELEASE_EXEC lsb_release REQUIRED)
execute_process(
#COMMAND ${LSB_RELEASE_EXEC} -cs
COMMAND /usr/bin/echo jammy
COMMAND ${LSB_RELEASE_EXEC} -cs
OUTPUT_VARIABLE OS_CODE_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)

Expand Down
170 changes: 115 additions & 55 deletions spinnaker_camera_driver/cmake/download_spinnaker
Original file line number Diff line number Diff line change
Expand Up @@ -39,77 +39,137 @@ import glob

logging.basicConfig(level=logging.INFO)

URL_TEMPLATE = URL_TEMPLATES = {
'deb': 'https://packages.clearpathrobotics.com/stable/flir/Spinnaker/Ubuntu{version}/spinnaker-3.1.0.79-Ubuntu{version}-{arch}-pkg.tar.gz',
'src': None # if we ever have non-deb archives that require manual extraction, those package URLS will go here.
URL_TEMPLATES = {
'focal': {
'deb': 'https://packages.clearpathrobotics.com/stable/flir/Spinnaker/Ubuntu{version}/spinnaker-2.2.0.48-Ubuntu{version}-{arch}-pkg.tar.gz',
'src': None # if we ever have non-deb archives that require manual extraction, those package URLS will go here.
},
'jammy': {
'deb': 'https://packages.clearpathrobotics.com/stable/flir/Spinnaker/Ubuntu{version}/spinnaker-3.1.0.79-Ubuntu{version}-{arch}-pkg.tar.gz',
'src': None # if we ever have non-deb archives that require manual extraction, those package URLS will go here
}
}

ARCHS = {
'x86_64': {
'linux_arch': 'amd64',
'current': '22.04',
'type': 'deb',
'folder_name': 'spinnaker-3.1.0.79-amd64',
'shared_library': 'opt/spinnaker/lib/',
'debs':[
'libgentl_3.1.0.79_amd64.deb',
'libspinnaker_3.1.0.79_amd64.deb',
'libspinnaker-c_3.1.0.79_amd64.deb',
'libspinnaker-c-dev_3.1.0.79_amd64.deb',
'libspinnaker-dev_3.1.0.79_amd64.deb',
'libspinvideo_3.1.0.79_amd64.deb',
'libspinvideo-c_3.1.0.79_amd64.deb',
'libspinvideo-c-dev_3.1.0.79_amd64.deb',
'libspinvideo-dev_3.1.0.79_amd64.deb',
'spinnaker_3.1.0.79_amd64.deb',
'spinnaker-doc_3.1.0.79_amd64.deb',
'spinupdate_3.1.0.79_amd64.deb',
'spinupdate-dev_3.1.0.79_amd64.deb',
'spinview-qt_3.1.0.79_amd64.deb',
'spinview-qt-dev_3.1.0.79_amd64.deb'
]
'focal': {
'x86_64': {
'linux_arch': 'amd64',
'current': '20.04',
'type': 'deb',
'folder_name': 'spinnaker-2.2.0.48-amd64',
'shared_library': 'opt/spinnaker/lib/',
'debs':[
'libgentl_2.2.0.48_amd64.deb',
'libspinnaker_2.2.0.48_amd64.deb',
'libspinnaker-c_2.2.0.48_amd64.deb',
'libspinnaker-c-dev_2.2.0.48_amd64.deb',
'libspinnaker-dev_2.2.0.48_amd64.deb',
'libspinvideo_2.2.0.48_amd64.deb',
'libspinvideo-c_2.2.0.48_amd64.deb',
'libspinvideo-c-dev_2.2.0.48_amd64.deb',
'libspinvideo-dev_2.2.0.48_amd64.deb',
'spinnaker_2.2.0.48_amd64.deb',
'spinnaker-doc_2.2.0.48_amd64.deb',
'spinupdate_2.2.0.48_amd64.deb',
'spinupdate-dev_2.2.0.48_amd64.deb',
'spinview-qt_2.2.0.48_amd64.deb',
'spinview-qt-dev_2.2.0.48_amd64.deb'
]
},
'armv8': {
'linux_arch': 'arm64',
'current': '20.04',
'type': 'deb',
'shared_library': 'opt/spinnaker/lib/',
'folder_name': 'spinnaker-2.2.0.48-arm64',
'debs': [
'libgentl_2.2.0.48_arm64.deb',
'libspinnaker_2.2.0.48_arm64.deb',
'libspinnaker-c_2.2.0.48_arm64.deb',
'libspinnaker-c-dev_2.2.0.48_arm64.deb',
'libspinnaker-dev_2.2.0.48_arm64.deb',
'libspinvideo_2.2.0.48_arm64.deb',
'libspinvideo-c_2.2.0.48_arm64.deb',
'libspinvideo-c-dev_2.2.0.48_arm64.deb',
'libspinvideo-dev_2.2.0.48_arm64.deb',
'spinnaker_2.2.0.48_arm64.deb',
'spinnaker-doc_2.2.0.48_arm64.deb',
'spinupdate_2.2.0.48_arm64.deb',
'spinupdate-dev_2.2.0.48_arm64.deb',
'spinview-qt_2.2.0.48_arm64.deb',
'spinview-qt-dev_2.2.0.48_arm64.deb'
]
}
},
'armv8': {
'linux_arch': 'arm64',
'current': '22.04',
'type': 'deb',
'shared_library': 'opt/spinnaker/lib/',
'folder_name': 'spinnaker-3.1.0.79-arm64',
'debs': [
'libgentl_3.1.0.79_arm64.deb',
'libspinnaker_3.1.0.79_arm64.deb',
'libspinnaker-c_3.1.0.79_arm64.deb',
'libspinnaker-c-dev_3.1.0.79_arm64.deb',
'libspinnaker-dev_3.1.0.79_arm64.deb',
'libspinvideo_3.1.0.79_arm64.deb',
'libspinvideo-c_3.1.0.79_arm64.deb',
'libspinvideo-c-dev_3.1.0.79_arm64.deb',
'libspinvideo-dev_3.1.0.79_arm64.deb',
'spinnaker_3.1.0.79_arm64.deb',
'spinnaker-doc_3.1.0.79_arm64.deb',
'spinupdate_3.1.0.79_arm64.deb',
'spinupdate-dev_3.1.0.79_arm64.deb',
'spinview-qt_3.1.0.79_arm64.deb',
'spinview-qt-dev_3.1.0.79_arm64.deb'
]
'jammy': {
'x86_64': {
'linux_arch': 'amd64',
'type': 'deb',
'folder_name': 'spinnaker-3.1.0.79-amd64',
'shared_library': 'opt/spinnaker/lib/',
'debs':[
'libgentl_3.1.0.79_amd64.deb',
'libspinnaker_3.1.0.79_amd64.deb',
'libspinnaker-c_3.1.0.79_amd64.deb',
'libspinnaker-c-dev_3.1.0.79_amd64.deb',
'libspinnaker-dev_3.1.0.79_amd64.deb',
'libspinvideo_3.1.0.79_amd64.deb',
'libspinvideo-c_3.1.0.79_amd64.deb',
'libspinvideo-c-dev_3.1.0.79_amd64.deb',
'libspinvideo-dev_3.1.0.79_amd64.deb',
'spinnaker_3.1.0.79_amd64.deb',
'spinnaker-doc_3.1.0.79_amd64.deb',
'spinupdate_3.1.0.79_amd64.deb',
'spinupdate-dev_3.1.0.79_amd64.deb',
'spinview-qt_3.1.0.79_amd64.deb',
'spinview-qt-dev_3.1.0.79_amd64.deb'
]
},
'armv8': {
'linux_arch': 'arm64',
'type': 'deb',
'shared_library': 'opt/spinnaker/lib/',
'folder_name': 'spinnaker-3.1.0.79-arm64',
'debs': [
'libgentl_3.1.0.79_arm64.deb',
'libspinnaker_3.1.0.79_arm64.deb',
'libspinnaker-c_3.1.0.79_arm64.deb',
'libspinnaker-c-dev_3.1.0.79_arm64.deb',
'libspinnaker-dev_3.1.0.79_arm64.deb',
'libspinvideo_3.1.0.79_arm64.deb',
'libspinvideo-c_3.1.0.79_arm64.deb',
'libspinvideo-c-dev_3.1.0.79_arm64.deb',
'libspinvideo-dev_3.1.0.79_arm64.deb',
'spinnaker_3.1.0.79_arm64.deb',
'spinnaker-doc_3.1.0.79_arm64.deb',
'spinupdate_3.1.0.79_arm64.deb',
'spinupdate-dev_3.1.0.79_arm64.deb',
'spinview-qt_3.1.0.79_arm64.deb',
'spinview-qt-dev_3.1.0.79_arm64.deb'
]
}
}
}


OS_LIBRARY_VERSION = {
'jammy': 'current'
'focal': '20.04',
'jammy': '22.04',
'noble': '24.04'
}

arch = sys.argv[1]
destination_folder = sys.argv[2]
os_code_name = sys.argv[3]


os_version = OS_LIBRARY_VERSION[os_code_name]
archive_url = URL_TEMPLATES[ARCHS[arch]['type']].format(
arch=ARCHS[arch]['linux_arch'],
version=ARCHS[arch][os_version])
folder_name = ARCHS[arch]['folder_name']
shared_library = ARCHS[arch]['shared_library']
my_arch = ARCHS[os_code_name][arch]
archive_url = URL_TEMPLATES[os_code_name][my_arch['type']].format(
arch=my_arch['linux_arch'],
version=os_version)
folder_name = my_arch['folder_name']
shared_library = my_arch['shared_library']


print("CPU architecture is %s", arch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ class Camera
try {
return (node_->declare_parameter<T>(name, def));
} catch (const rclcpp::exceptions::ParameterAlreadyDeclaredException & e) {
return (node_->get_parameter_or<T>(name, def));
T value;
(void)node_->get_parameter_or<T>(name, value, def);
return (value);
}
}

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 @@ -15,6 +15,7 @@


<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>

<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
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,6 @@ void IndividualExposureController::addCamera(
const std::shared_ptr<spinnaker_camera_driver::Camera> & cam)
{
cameraName_ = cam->getName();
};
}

} // namespace spinnaker_synchronized_camera_driver

0 comments on commit 8793d38

Please sign in to comment.