Skip to content

Commit

Permalink
Add missing vpDebug.h header
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jun 18, 2024
1 parent 14cbdd6 commit abdb128
Show file tree
Hide file tree
Showing 21 changed files with 144 additions and 132 deletions.
1 change: 1 addition & 0 deletions modules/ar/src/coin-simulator/vpAR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#ifdef VISP_HAVE_COIN3D_AND_GUI

#include <visp3/ar/vpAR.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpTime.h>

/* Objets OIV. */
Expand Down
1 change: 1 addition & 0 deletions modules/ar/src/coin-simulator/vpSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#ifdef VISP_HAVE_COIN3D_AND_GUI

#include <visp3/ar/vpSimulator.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpTime.h>

#include <visp3/core/vpImage.h>
Expand Down
5 changes: 3 additions & 2 deletions modules/core/include/visp3/core/vpNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
* TCP Network
*/

#ifndef vpNetwork_H
#define vpNetwork_H
#ifndef VP_NETWORK_H
#define VP_NETWORK_H

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpRequest.h>

#include <iostream>
Expand Down
146 changes: 73 additions & 73 deletions modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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[.
Expand All @@ -89,87 +89,87 @@ model implemented in initStateConstVelWithColoredNoise_MeasureVel().
dimensional signal.
\code
#include <visp3/core/vpLinearKalmanFilterInstantiation.h>
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 <visp3/core/vpLinearKalmanFilterInstantiation.h>
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
dimensional target trajectory with an estimation of the target
velocities from velocity measures.
\code
#include <visp3/core/vpLinearKalmanFilterInstantiation.h>
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 <visp3/core/vpLinearKalmanFilterInstantiation.h>
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:
Expand Down
3 changes: 3 additions & 0 deletions modules/core/src/tools/network/vpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

// inet_ntop() not supported on win XP
#ifdef VISP_HAVE_FUNC_INET_NTOP

#include <visp3/core/vpDebug.h>

BEGIN_VISP_NAMESPACE
vpClient::vpClient() : vpNetwork(), m_numberOfAttempts(0) { }

Expand Down
2 changes: 2 additions & 0 deletions modules/core/src/tools/network/vpNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

// inet_ntop() not supported on win XP
#ifdef VISP_HAVE_FUNC_INET_NTOP

#include <visp3/core/vpDebug.h>
BEGIN_VISP_NAMESPACE
vpNetwork::vpNetwork()
: emitter(), receptor_list(), readFileDescriptor(), socketMax(0), request_list(), max_size_message(999999),
Expand Down
2 changes: 2 additions & 0 deletions modules/core/src/tools/network/vpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
// inet_ntop() not supported on win XP
#ifdef VISP_HAVE_FUNC_INET_NTOP

#include <visp3/core/vpDebug.h>

#if defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
#include <TargetConditionals.h> // To detect OSX or IOS using TARGET_OS_IPHONE or TARGET_OS_IOS macro
#endif
Expand Down
17 changes: 8 additions & 9 deletions modules/gui/test/display/testVideoDeviceDual.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -30,12 +29,12 @@
*
* Description:
* Test for image display.
*
*****************************************************************************/
*/

#include <iostream>
#include <stdlib.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpDisplay.h>
#include <visp3/core/vpImage.h>
#include <visp3/gui/vpDisplayD3D.h>
Expand Down Expand Up @@ -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<unsigned char> I1(240, 320), I2(240, 320);
I1 = 128;
I2 = 255;
Expand Down Expand Up @@ -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..."); }
Expand Down
3 changes: 2 additions & 1 deletion modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
// This error is due to cmath header included from vpMath.h that makes
// isfinite() ambiguous between ::isfinite() and std::isfinite()
#include <visp3/core/vpMath.h>
#include <visp3/core/vpDebug.h>

#ifdef VISP_HAVE_PIONEER

BEGIN_VISP_NAMESPACE
/*!
Default constructor that initializes Aria.
*/
vpRobotPioneer::vpRobotPioneer() : vpPioneer(), ArRobot()
vpRobotPioneer::vpRobotPioneer() : vpPioneer(), ArRobot()
{
isInitialized = false;

Expand Down
1 change: 1 addition & 0 deletions modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <cmath> // std::fabs
#include <limits> // numeric_limits
#include <string>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpImagePoint.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpMeterPixelConversion.h>
Expand Down
1 change: 1 addition & 0 deletions modules/robot/src/robot-simulator/vpSimulatorViper850.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <cmath> // std::fabs
#include <limits> // numeric_limits
#include <string>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpImagePoint.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpMeterPixelConversion.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "vpView.h"
#include "vpVwstack.h"

#include <visp3/core/vpDebug.h>
#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpException.h>
#include <visp3/core/vpIoTools.h>
Expand Down
3 changes: 2 additions & 1 deletion modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@

#include <iostream>

#include <visp3/core/vpDebug.h>
#include <visp3/core/vpImageConvert.h>
#include <visp3/sensor/vp1394CMUGrabber.h>

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)
Expand Down
Loading

0 comments on commit abdb128

Please sign in to comment.