Skip to content

Commit

Permalink
Fix ROS2 build error: "/tmp/ws/src/visp/tutorial/tracking/model-based…
Browse files Browse the repository at this point in the history
…/generic/tutorial-mb-generic-tracker-read.cpp:193:108: error: expected ‘;’ before ‘return’"

Fix ROS2 build warnings:
"/tmp/ws/src/visp/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-full.cpp:15:21: warning: ‘std::vector<double> {anonymous}::poseToVec(const vpHomogeneousMatrix&)’ defined but not used [-Wunused-function]"
"/tmp/ws/src/visp/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-read.cpp:34:14: warning: unused parameter ‘argc’"
"/tmp/ws/src/visp/modules/core/test/image-with-dataset/testColorConversion.cpp:955:13: warning: ‘bool readBinaryFile(const string&, std::vector<unsigned char>&)’ defined but not used [-Wunused-function]"
  • Loading branch information
s-trinh committed Jan 29, 2024
1 parent 1d7a809 commit 724b719
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 724b719

Please sign in to comment.