From 35a9d99bf0533aadaa3e2a39ba412a3259fd9ec1 Mon Sep 17 00:00:00 2001 From: Vladyslav Usenko Date: Tue, 28 Apr 2020 15:14:22 +0200 Subject: [PATCH] fix for CI --- CMakeLists.txt | 15 +++++++++- include/basalt/io/dataset_io_rosbag.h | 2 +- .../include/apriltags/FloatImage.h | 29 ++++++++++--------- thirdparty/basalt-headers | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69cecec..e3087a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,10 @@ if(LSB_RELEASE_PROGRAM) OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE) - if(${LSB_RELEASE_ID_SHORT} EQUAL "18.04") + if(${LSB_RELEASE_ID_SHORT} EQUAL "20.04") + set(DEBIAN_DEPENDS "libtbb2, liblz4-1, libbz2-1.0, libboost-filesystem1.67.1, libboost-date-time1.67.1, libboost-program-options1.67.1, libboost-regex1.67.1, libopencv-dev, libglew2.1, libjpeg8, libpng16-16, librealsense2, librealsense2-dkms, librealsense2-gl, librealsense2-utils") + + elseif(${LSB_RELEASE_ID_SHORT} EQUAL "18.04") set(DEBIAN_DEPENDS "libtbb2, liblz4-1, libbz2-1.0, libboost-filesystem1.65.1, libboost-date-time1.65.1, libboost-program-options1.65.1, libboost-regex1.65.1, libopencv-dev, libglew2.0, libjpeg8, libpng16-16, librealsense2, librealsense2-dkms, librealsense2-gl, librealsense2-utils") elseif(${LSB_RELEASE_ID_SHORT} EQUAL "16.04") @@ -99,6 +102,11 @@ set(BASALT_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-parameter -ftempla if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-exceptions -fcolor-diagnostics -frelaxed-template-template-args -Wno-error=deprecated-declarations") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) + # These are disabled to avoid lot's of warnings in Eigen code with clang 10 + set(BASALT_CXX_FLAGS "${BASALT_HEADERS_CXX_FLAGS} -Wno-error=misleading-indentation -Wno-error=deprecated-copy") + endif() + # - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU # libstdc++ when it cannot be properly recognized, e.g. when used # with Clang on Linux* OS. Adopted from https://github.com/wjakob/tbb @@ -110,6 +118,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App endif() else() set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-error=maybe-uninitialized -Wno-error=implicit-fallthrough") + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9) + # These are disabled to avoid lot's of warnings in Eigen code with gcc-9 + set(BASALT_CXX_FLAGS "${BASALT_HEADERS_CXX_FLAGS} -Wno-error=deprecated-copy") + endif() endif() diff --git a/include/basalt/io/dataset_io_rosbag.h b/include/basalt/io/dataset_io_rosbag.h index 83a139d..d6d7208 100644 --- a/include/basalt/io/dataset_io_rosbag.h +++ b/include/basalt/io/dataset_io_rosbag.h @@ -235,7 +235,7 @@ class RosbagIO : public DatasetIoInterface { std::set image_timestamps; - for (rosbag::MessageInstance const m : view) { + for (const rosbag::MessageInstance &m : view) { const std::string &topic = m.getTopic(); if (cam_topics.find(topic) != cam_topics.end()) { diff --git a/thirdparty/apriltag/ethz_apriltag2/include/apriltags/FloatImage.h b/thirdparty/apriltag/ethz_apriltag2/include/apriltags/FloatImage.h index e630ff5..2f78602 100644 --- a/thirdparty/apriltag/ethz_apriltag2/include/apriltags/FloatImage.h +++ b/thirdparty/apriltag/ethz_apriltag2/include/apriltags/FloatImage.h @@ -5,21 +5,21 @@ #include namespace DualCoding { - typedef unsigned char uchar; - template class Sketch; -} +typedef unsigned char uchar; +template +class Sketch; +} // namespace DualCoding namespace AprilTags { //! Represent an image as a vector of floats in [0,1] class FloatImage { -private: + private: int width; int height; std::vector pixels; -public: - + public: //! Default constructor FloatImage(); @@ -29,14 +29,16 @@ public: //! Constructor that copies pixels from an array FloatImage(int widthArg, int heightArg, const std::vector& pArg); + FloatImage(const FloatImage& other) = default; + FloatImage& operator=(const FloatImage& other); - float get(int x, int y) const { return pixels[y*width + x]; } - void set(int x, int y, float v) { pixels[y*width + x] = v; } - + float get(int x, int y) const { return pixels[y * width + x]; } + void set(int x, int y, float v) { pixels[y * width + x] = v; } + int getWidth() const { return width; } int getHeight() const { return height; } - int getNumFloatImagePixels() const { return width*height; } + int getNumFloatImagePixels() const { return width * height; } const std::vector& getFloatImagePixels() const { return pixels; } //! TODO: Fix decimateAvg function. DO NOT USE! @@ -45,9 +47,10 @@ public: //! Rescale all values so that they are between [0,1] void normalize(); - void filterFactoredCentered(const std::vector& fhoriz, const std::vector& fvert); + void filterFactoredCentered(const std::vector& fhoriz, + const std::vector& fvert); - template + template void copyToSketch(DualCoding::Sketch& sketch) { for (int i = 0; i < getNumFloatImagePixels(); i++) sketch[i] = (T)(255.0f * getFloatImagePixels()[i]); @@ -56,6 +59,6 @@ public: void printMinMax() const; }; -} // namespace +} // namespace AprilTags #endif diff --git a/thirdparty/basalt-headers b/thirdparty/basalt-headers index 1395990..b068d7a 160000 --- a/thirdparty/basalt-headers +++ b/thirdparty/basalt-headers @@ -1 +1 @@ -Subproject commit 1395990144121427d6236444b1643b6fe068f736 +Subproject commit b068d7a967af52fb3c8e261829b16a2403845ef8