diff --git a/modules/ar/src/coin-simulator/vpAR.cpp b/modules/ar/src/coin-simulator/vpAR.cpp index a2dbafdb69..ea715197a5 100644 --- a/modules/ar/src/coin-simulator/vpAR.cpp +++ b/modules/ar/src/coin-simulator/vpAR.cpp @@ -43,6 +43,7 @@ #ifdef VISP_HAVE_COIN3D_AND_GUI #include +#include #include /* Objets OIV. */ diff --git a/modules/ar/src/coin-simulator/vpSimulator.cpp b/modules/ar/src/coin-simulator/vpSimulator.cpp index 157b736d4b..38909c0541 100644 --- a/modules/ar/src/coin-simulator/vpSimulator.cpp +++ b/modules/ar/src/coin-simulator/vpSimulator.cpp @@ -41,6 +41,7 @@ #ifdef VISP_HAVE_COIN3D_AND_GUI #include +#include #include #include diff --git a/modules/core/include/visp3/core/vpNetwork.h b/modules/core/include/visp3/core/vpNetwork.h index 26ef8e8936..645e00d198 100644 --- a/modules/core/include/visp3/core/vpNetwork.h +++ b/modules/core/include/visp3/core/vpNetwork.h @@ -31,10 +31,11 @@ * TCP Network */ -#ifndef vpNetwork_H -#define vpNetwork_H +#ifndef VP_NETWORK_H +#define VP_NETWORK_H #include +#include #include #include diff --git a/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp index e78d58ccf8..9263e95b17 100644 --- a/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp +++ b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp @@ -55,7 +55,7 @@ BEGIN_VISP_NAMESPACE initStateConstVelWithColoredNoise_MeasureVel(), initStateConstAccWithColoredNoise_MeasureVel(). - \warning It is requiered to set the state model before using this method. + \warning It is required to set the state model before using this method. \param n_signal : Number of signal to filter. @@ -78,7 +78,7 @@ BEGIN_VISP_NAMESPACE second. Depending on the filter modelization, this value may not be used. This is for example the case for the vpLinearKalmanFilterInstantiation::stateConstVelWithColoredNoise_MeasureVel -model implemented in initStateConstVelWithColoredNoise_MeasureVel(). + model implemented in initStateConstVelWithColoredNoise_MeasureVel(). \exception vpException::badValue : Bad rho value wich is not in [0:1[. @@ -89,24 +89,24 @@ model implemented in initStateConstVelWithColoredNoise_MeasureVel(). dimensional signal. \code -#include - -int main() -{ - vpLinearKalmanFilterInstantiation kalman; - // Select a constant velocity state model with colored noise - // Measures are velocities - kalman.setStateModel(vpLinearKalmanFilterInstantiation::stateConstVelWithColoredNoise_MeasureVel); - - // Initialise the filter for a one dimension signal - int signal = 1; - vpColVector sigma_state(2); // State vector size is 2 - vpColVector sigma_measure(1); // Measure vector size is 1 - double rho = 0.9; - double dummy = 0; // non used parameter for the selected state model - - kalman.initFilter(signal, sigma_state, sigma_measure, rho, dummy); -} + #include + + int main() + { + vpLinearKalmanFilterInstantiation kalman; + // Select a constant velocity state model with colored noise + // Measures are velocities + kalman.setStateModel(vpLinearKalmanFilterInstantiation::stateConstVelWithColoredNoise_MeasureVel); + + // Initialise the filter for a one dimension signal + int signal = 1; + vpColVector sigma_state(2); // State vector size is 2 + vpColVector sigma_measure(1); // Measure vector size is 1 + double rho = 0.9; + double dummy = 0; // non used parameter for the selected state model + + kalman.initFilter(signal, sigma_state, sigma_measure, rho, dummy); + } \endcode The example below shows a more complete example to filter a two @@ -114,62 +114,62 @@ int main() velocities from velocity measures. \code -#include - -int main() -{ - vpLinearKalmanFilterInstantiation kalman; - - // Set the constant velocity state model used for the filtering - vpLinearKalmanFilterInstantiation::vpStateModel model; - model = vpLinearKalmanFilterInstantiation::stateConstVelWithColoredNoise_MeasureVel; - kalman.setStateModel(model); - - // We are now able to retrieve the size of the state vector and measure vector - int state_size = kalman.getStateSize(); - - // Filter the x and y velocities of a target (2 signals are to consider) - int nsignal = 2; - - // Initialize the filter parameters: - // - Firstly, the state variance - int size = state_size*nsignal; - vpColVector sigma_state(size); - sigma_state[1] = 0.001; // Variance on the acceleration for the 1st signal (x) - sigma_state[3] = 0.002; // Variance on the acceleration for the 2nd signal (y) - // - Secondly, the measures variance - vpColVector sigma_measure(nsignal); // 2 velocity measures available - sigma_measure[0] = 0.03; // Variance on the x velocity measure - sigma_measure[1] = 0.06; // Variance on the y velocity measure - // - Thirdly, the correlation between successive accelerations - double rho = 0.9; - - double dummy = 0; // non used parameter for the selected state model - - // Initialize the filter - // The state model was set before - kalman.initFilter(nsignal, sigma_state, sigma_measure, rho, dummy); - - // Does the filtering - vpColVector vm(2); // Measured velocities - for ( ; ; ) { - // Get the two dimensional velocity measures - // vm[0] = ...; - // vm[1] = ...; - - // Compute the filtering and the prediction - kalman.filter(vm); - // Print the estimation of the velocities (1st value of the state vector) - std::cout << "Estimated x velocity: kalman.Xest[0]" << std::endl; - std::cout << "Estimated y velocity: kalman.Xest[kalman.getStateSize()]" - << std::endl; - // The one step prediction is available in kalman.Xpre variable + #include + + int main() + { + vpLinearKalmanFilterInstantiation kalman; + + // Set the constant velocity state model used for the filtering + vpLinearKalmanFilterInstantiation::vpStateModel model; + model = vpLinearKalmanFilterInstantiation::stateConstVelWithColoredNoise_MeasureVel; + kalman.setStateModel(model); + + // We are now able to retrieve the size of the state vector and measure vector + int state_size = kalman.getStateSize(); + + // Filter the x and y velocities of a target (2 signals are to consider) + int nsignal = 2; + + // Initialize the filter parameters: + // - Firstly, the state variance + int size = state_size*nsignal; + vpColVector sigma_state(size); + sigma_state[1] = 0.001; // Variance on the acceleration for the 1st signal (x) + sigma_state[3] = 0.002; // Variance on the acceleration for the 2nd signal (y) + // - Secondly, the measures variance + vpColVector sigma_measure(nsignal); // 2 velocity measures available + sigma_measure[0] = 0.03; // Variance on the x velocity measure + sigma_measure[1] = 0.06; // Variance on the y velocity measure + // - Thirdly, the correlation between successive accelerations + double rho = 0.9; + + double dummy = 0; // non used parameter for the selected state model + + // Initialize the filter + // The state model was set before + kalman.initFilter(nsignal, sigma_state, sigma_measure, rho, dummy); + + // Does the filtering + vpColVector vm(2); // Measured velocities + for ( ; ; ) { + // Get the two dimensional velocity measures + // vm[0] = ...; + // vm[1] = ...; + + // Compute the filtering and the prediction + kalman.filter(vm); + // Print the estimation of the velocities (1st value of the state vector) + std::cout << "Estimated x velocity: kalman.Xest[0]" << std::endl; + std::cout << "Estimated y velocity: kalman.Xest[kalman.getStateSize()]" + << std::endl; + // The one step prediction is available in kalman.Xpre variable + } } -} \endcode */ -void vpLinearKalmanFilterInstantiation::initFilter(unsigned int n_signal, vpColVector &sigma_state, - vpColVector &sigma_measure, double rho, double delta_t) + void vpLinearKalmanFilterInstantiation::initFilter(unsigned int n_signal, vpColVector &sigma_state, + vpColVector &sigma_measure, double rho, double delta_t) { switch (model) { case stateConstVelWithColoredNoise_MeasureVel: diff --git a/modules/core/src/tools/network/vpClient.cpp b/modules/core/src/tools/network/vpClient.cpp index 93fdc6f22e..c57366dd24 100644 --- a/modules/core/src/tools/network/vpClient.cpp +++ b/modules/core/src/tools/network/vpClient.cpp @@ -40,6 +40,9 @@ // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP + +#include + BEGIN_VISP_NAMESPACE vpClient::vpClient() : vpNetwork(), m_numberOfAttempts(0) { } diff --git a/modules/core/src/tools/network/vpNetwork.cpp b/modules/core/src/tools/network/vpNetwork.cpp index 8419f05e97..77feb13bd2 100644 --- a/modules/core/src/tools/network/vpNetwork.cpp +++ b/modules/core/src/tools/network/vpNetwork.cpp @@ -40,6 +40,8 @@ // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP + +#include BEGIN_VISP_NAMESPACE vpNetwork::vpNetwork() : emitter(), receptor_list(), readFileDescriptor(), socketMax(0), request_list(), max_size_message(999999), diff --git a/modules/core/src/tools/network/vpServer.cpp b/modules/core/src/tools/network/vpServer.cpp index c1e62cfab1..b8f23c8663 100644 --- a/modules/core/src/tools/network/vpServer.cpp +++ b/modules/core/src/tools/network/vpServer.cpp @@ -40,6 +40,8 @@ // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP +#include + #if defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin) #include // To detect OSX or IOS using TARGET_OS_IPHONE or TARGET_OS_IOS macro #endif diff --git a/modules/gui/test/display/testVideoDeviceDual.cpp b/modules/gui/test/display/testVideoDeviceDual.cpp index 5fa5dd5a6c..faab10944f 100644 --- a/modules/gui/test/display/testVideoDeviceDual.cpp +++ b/modules/gui/test/display/testVideoDeviceDual.cpp @@ -1,7 +1,6 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2023 by Inria. All rights reserved. + * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,12 +29,12 @@ * * Description: * Test for image display. - * -*****************************************************************************/ + */ #include #include #include +#include #include #include #include @@ -261,9 +260,9 @@ int main(int argc, const char **argv) std::cout << " No display is available\n"; } return EXIT_FAILURE; - } + } - // Create 2 images + // Create 2 images vpImage I1(240, 320), I2(240, 320); I1 = 128; I2 = 255; @@ -352,12 +351,12 @@ int main(int argc, const char **argv) delete d1; delete d2; return EXIT_SUCCESS; -} + } catch (const vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return EXIT_FAILURE; } - } +} #else int main() { vpERROR_TRACE("You do not have display functionalities..."); } diff --git a/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp b/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp index 1d021e3a37..f98200b396 100644 --- a/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp +++ b/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp @@ -42,6 +42,7 @@ // This error is due to cmath header included from vpMath.h that makes // isfinite() ambiguous between ::isfinite() and std::isfinite() #include +#include #ifdef VISP_HAVE_PIONEER @@ -49,7 +50,7 @@ BEGIN_VISP_NAMESPACE /*! Default constructor that initializes Aria. */ -vpRobotPioneer::vpRobotPioneer() : vpPioneer(), ArRobot() + vpRobotPioneer::vpRobotPioneer() : vpPioneer(), ArRobot() { isInitialized = false; diff --git a/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp b/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp index b0172373dd..3dddc7c3e7 100644 --- a/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp @@ -38,6 +38,7 @@ #include // std::fabs #include // numeric_limits #include +#include #include #include #include diff --git a/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp b/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp index f97607b3a3..86ebb52249 100644 --- a/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp @@ -40,6 +40,7 @@ #include // std::fabs #include // numeric_limits #include +#include #include #include #include diff --git a/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp b/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp index dacb00a618..dca6da6b38 100644 --- a/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp +++ b/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp @@ -60,6 +60,7 @@ #include "vpView.h" #include "vpVwstack.h" +#include #include #include #include diff --git a/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp b/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp index 255db1e089..25e3c83554 100644 --- a/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp +++ b/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp @@ -39,6 +39,7 @@ #include +#include #include #include @@ -46,7 +47,7 @@ BEGIN_VISP_NAMESPACE /*! Basic constructor. */ -vp1394CMUGrabber::vp1394CMUGrabber() + vp1394CMUGrabber::vp1394CMUGrabber() : index(0), // If a camera was not selected the first one (index = 0) will // be used _format(-1), _mode(-1), _fps(-1), _modeauto(true), _gain(0), _shutter(0), _color(vp1394CMUGrabber::UNKNOWN) diff --git a/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp b/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp index b761eb2322..b7ab43fbb5 100644 --- a/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp +++ b/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp @@ -1,7 +1,6 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. - * Copyright (C) 2005 - 2023 by Inria. All rights reserved. + * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +29,7 @@ * * Description: * Framegrabber based on Video4Linux2 driver. - * -*****************************************************************************/ + */ /*! \file vpV4l2Grabber.cpp @@ -54,6 +52,7 @@ #include #include +#include #include #include //#include @@ -89,10 +88,10 @@ const unsigned int vpV4l2Grabber::FRAME_SIZE = 288; fps. These framerates are reachable only if enought buffers are set. - Input board: vpV4l2Grabber::DEFAULT_INPUT. Video input port. Use -setInput() to change it. + setInput() to change it. - Image size acquisition: vpV4l2Grabber::DEFAULT_SCALE. Use either -setScale() or setWidth() and setHeight() to change it. + setScale() or setWidth() and setHeight() to change it. \code vpImage I; // Grey level image @@ -108,40 +107,39 @@ setScale() or setWidth() and setHeight() to change it. \endcode The grabber allows also to grab a portion of an image using a region of -interest. The following example shows how to grab a 320x240 region located on -the top/left corner of the image that has a higher resolution (ie 640x480). + interest. The following example shows how to grab a 320x240 region located on + the top/left corner of the image that has a higher resolution (ie 640x480). \code -#include -#include -#include + #include + #include + #include -int main() -{ -#if defined(VISP_HAVE_V4L2) && defined(VISP_HAVE_X11) - vpDisplayX *d; - vpImage I; - vpRect roi(0, 0, 320, 240); // specify the region to crop + int main() + { + #if defined(VISP_HAVE_V4L2) && defined(VISP_HAVE_X11) + vpDisplayX *d; + vpImage I; + vpRect roi(0, 0, 320, 240); // specify the region to crop - vpV4l2Grabber g; + vpV4l2Grabber g; - bool first = true; - while (1) { - g.acquire(I, roi); - if(first) { - d = new vpDisplayX(I); - first = false; + bool first = true; + while (1) { + g.acquire(I, roi); + if(first) { + d = new vpDisplayX(I); + first = false; + } + vpDisplay::display(I); + vpDisplay::flush(I); + if (vpDisplay::getClick(I, false)) + break; } - vpDisplay::display(I); - vpDisplay::flush(I); - if (vpDisplay::getClick(I, false)) - break; - } - vpImageIo::write(I, "image.pgm"); // Save the last image - delete d; -#endif + vpImageIo::write(I, "image.pgm"); // Save the last image + delete d; + #endif \endcode - */ vpV4l2Grabber::vpV4l2Grabber() : fd(-1), device(), cap(), streamparm(), inp(nullptr), std(nullptr), fmt(nullptr), ctl(nullptr), fmt_v4l2(), fmt_me(), reqbufs(), @@ -179,10 +177,10 @@ vpV4l2Grabber::vpV4l2Grabber() fps. These framerates are reachable only if enought buffers are set. - Input board: vpV4l2Grabber::DEFAULT_INPUT. Video input port. Use - setInput() to change it. + setInput() to change it. - Image size acquisition: vpV4l2Grabber::DEFAULT_SCALE. Use either - setScale() or setWidth() and setHeight to change it. + setScale() or setWidth() and setHeight to change it. \code vpImage I; // Grey level image @@ -195,7 +193,6 @@ vpV4l2Grabber::vpV4l2Grabber() g.open(I); // Open the grabber g.acquire(I); // Acquire a 768x576 grey image - \endcode */ @@ -242,7 +239,6 @@ vpV4l2Grabber::vpV4l2Grabber(bool verbose) g.open(I); // Open the grabber g.acquire(I); // Acquire a 384x288 grey image - \endcode */ vpV4l2Grabber::vpV4l2Grabber(unsigned input, unsigned scale) @@ -279,7 +275,7 @@ vpV4l2Grabber::vpV4l2Grabber(unsigned input, unsigned scale) set the number of buffers to 3. - Framerate acquisition: 25 fps. Use setFramerate() to set 25 fps or 50 - fps. These framerates are reachable only if enought buffers are set. + fps. These framerates are reachable only if enough buffers are set. \code vpImage I; // Grey level image @@ -336,9 +332,7 @@ vpV4l2Grabber::vpV4l2Grabber(vpImage &I, unsigned input, unsigned // images and open the grabber g.acquire(I); // Acquire a 384x288 color image - \endcode - */ vpV4l2Grabber::vpV4l2Grabber(vpImage &I, unsigned input, unsigned scale) : fd(-1), device(), cap(), streamparm(), inp(nullptr), std(nullptr), fmt(nullptr), ctl(nullptr), fmt_v4l2(), fmt_me(), reqbufs(), diff --git a/modules/sensor/src/rgb-depth/kinect/vpKinect.cpp b/modules/sensor/src/rgb-depth/kinect/vpKinect.cpp index fd48e8a8b9..225aba1364 100644 --- a/modules/sensor/src/rgb-depth/kinect/vpKinect.cpp +++ b/modules/sensor/src/rgb-depth/kinect/vpKinect.cpp @@ -44,6 +44,7 @@ #include // numeric_limits +#include #include #include diff --git a/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp index 7f7ba01789..1f06395fb2 100644 --- a/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp +++ b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp @@ -34,6 +34,7 @@ *****************************************************************************/ #include +#include #include #include #include diff --git a/modules/tracker/mbt/src/vpMbTracker.cpp b/modules/tracker/mbt/src/vpMbTracker.cpp index 60218a3177..715cc3f17c 100644 --- a/modules/tracker/mbt/src/vpMbTracker.cpp +++ b/modules/tracker/mbt/src/vpMbTracker.cpp @@ -49,6 +49,7 @@ #endif #include +#include #include #include #include diff --git a/modules/tracker/me/src/moving-edges/vpNurbs.cpp b/modules/tracker/me/src/moving-edges/vpNurbs.cpp index ffd7d2664d..9ec3a1cb6e 100644 --- a/modules/tracker/me/src/moving-edges/vpNurbs.cpp +++ b/modules/tracker/me/src/moving-edges/vpNurbs.cpp @@ -34,6 +34,7 @@ #include // std::fabs #include // numeric_limits #include +#include #include BEGIN_VISP_NAMESPACE diff --git a/modules/vision/src/pose-estimation/vpPoseFeatures.cpp b/modules/vision/src/pose-estimation/vpPoseFeatures.cpp index 1033a7fd5b..f52086f3c7 100644 --- a/modules/vision/src/pose-estimation/vpPoseFeatures.cpp +++ b/modules/vision/src/pose-estimation/vpPoseFeatures.cpp @@ -30,6 +30,8 @@ * Description: * Pose computation from any features. */ + +#include #include #if defined(VISP_HAVE_MODULE_VISUAL_FEATURES) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) diff --git a/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp index 129d8743fe..7000547b95 100644 --- a/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp @@ -39,6 +39,7 @@ and visual feature Line */ +#include #include #include diff --git a/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp index ea62ffce75..049b8b1f91 100644 --- a/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp @@ -38,6 +38,8 @@ \brief conversion between tracker and visual feature 3D Point */ + +#include #include #include #include @@ -72,8 +74,3 @@ void vpFeatureBuilder::create(vpFeaturePoint3D &s, const vpPoint &t) } } END_VISP_NAMESPACE -/* - * Local variables: - * c-basic-offset: 2 - * End: - */