Skip to content

Commit

Permalink
Merge pull request #1318 from s-trinh/fix_MR_1263_ROS2_build_errors
Browse files Browse the repository at this point in the history
Fix ROS2 build error
  • Loading branch information
fspindle authored Jan 30, 2024
2 parents 1d7a809 + 724b719 commit 5409cb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ static double computePSNR(const vpImage<vpRGBa> &I_RGBA_8U, const vpImage<vpRGBa
return 10 * std::log10(255 * 255 / mse);
}

#if (VISP_HAVE_DATASET_VERSION >= 0x030500)
static bool readBinaryFile(const std::string &filename, std::vector<uint16_t> &buffer)
{
std::FILE *f = std::fopen(filename.c_str(), "rb");
Expand Down Expand Up @@ -967,7 +968,6 @@ static bool readBinaryFile(const std::string &filename, std::vector<uint8_t> &bu
return true;
}

#if (VISP_HAVE_DATASET_VERSION >= 0x030500)
TEST_CASE("Bayer conversion", "[image_conversion]")
{
// Load original Klimt image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <visp3/io/vpVideoReader.h>
#include <visp3/io/vpVideoWriter.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_VIDEOIO) && defined(HAVE_OPENCV_HIGHGUI)
namespace
{
std::vector<double> poseToVec(const vpHomogeneousMatrix &cMo)
Expand All @@ -21,6 +22,7 @@ std::vector<double> poseToVec(const vpHomogeneousMatrix &cMo)
return vec;
}
}
#endif

int main(int argc, char **argv)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <visp3/io/vpImageIo.h>
#include <visp3/core/vpImageDraw.h>

#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(HAVE_OPENCV_HIGHGUI)
namespace
{
// https://en.cppreference.com/w/cpp/io/c/fprintf
Expand All @@ -30,6 +31,7 @@ std::unique_ptr<T> make_unique_compat(Args&&... args)
#endif
}
}
#endif

int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -190,8 +192,10 @@ int main(int argc, char *argv[])
vpDisplay::getClick(I_display, true);

#else
std::cerr << "Error, a missing display library is needed (X11, GDI or OpenCV built with HighGUI module)."
(void)argc;
(void)argv;
std::cerr << "Error, a missing display library is needed (X11, GDI or OpenCV built with HighGUI module)." << std::endl;
#endif

return EXIT_SUCCESS;
return EXIT_SUCCESS;
}

0 comments on commit 5409cb3

Please sign in to comment.