Skip to content

Commit

Permalink
Merge pull request #1478 from fspindle/various_fixes
Browse files Browse the repository at this point in the history
Various fixes detected with CDash ci and reverting changes around buildFrom() functions to make them no more deprecated
  • Loading branch information
fspindle authored Oct 8, 2024
2 parents 70ddb40 + e320816 commit f83e271
Show file tree
Hide file tree
Showing 220 changed files with 814 additions and 2,351 deletions.
4 changes: 2 additions & 2 deletions 3rdparty/apriltag/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ endif()

if(MSVC)
if(BUILD_SHARED_LIBS)
vp_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4098 /wd4244 /wd4267 /wd4305 /wd4334 /wd4244 /wd4838 /wd4996 /wd6011 /wd6385 /wd6386 /wd6387 /wd6011 /wd26451)
vp_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4098 /wd4200 /wd4244 /wd4267 /wd4305 /wd4334 /wd4244 /wd4838 /wd4996 /wd6011 /wd6385 /wd6386 /wd6387 /wd6011 /wd26451)
vp_set_source_file_compile_flag(common/matd.c /wd4244)
vp_set_source_file_compile_flag(common/g2d.c /wd4244)
vp_set_source_file_compile_flag(common/homography.c /wd4244)
Expand All @@ -82,7 +82,7 @@ if(MSVC)
vp_set_source_file_compile_flag(tag16h5.c /wd4996 /wd4244)
vp_set_source_file_compile_flag(tag25h7.c /wd4996 /wd4244)
vp_set_source_file_compile_flag(tag25h9.c /wd4996 /wd4244)
vp_set_source_file_compile_flag(tag36h10.c /wd4996 /wd42446)
vp_set_source_file_compile_flag(tag36h10.c /wd4996 /wd4244)
vp_set_source_file_compile_flag(tag36h11.c /wd4996 /wd4244)
vp_set_source_file_compile_flag(tagCircle21h7.c /wd4996 /wd4244)
# disable optimization
Expand Down
2 changes: 1 addition & 1 deletion demo/wireframe-simulator/servoSimu4Points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ int main(int argc, const char **argv)

// Compute the position of the external view which is fixed in the
// object frame
camoMf.build(0, 0.0, 1.5, 0, vpMath::rad(150), 0);
camoMf.buildFrom(0, 0.0, 1.5, 0, vpMath::rad(150), 0);
camoMf = camoMf * (sim.get_fMo().inverse());

if (opt_plot) {
Expand Down
5 changes: 2 additions & 3 deletions demo/wireframe-simulator/servoSimuSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,8 @@ int main(int argc, const char **argv)
robot.setVelocity(vpRobot::CAMERA_FRAME, v);
sim.setCameraPositionRelObj(cMo);

// Compute the position of the external view which is fixed in the
// object frame
camoMf.build(0, 0.0, 2.5, 0, vpMath::rad(150), 0);
// Compute the position of the external view which is fixed in the object frame
camoMf.buildFrom(0, 0.0, 2.5, 0, vpMath::rad(150), 0);
camoMf = camoMf * (sim.get_fMo().inverse());

if (opt_plot) {
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/rendering/tutorial-panda3d.dox
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ vpPanda3DBaseRenderer, which implements basic functions for a panda renderer.
$ cd $VISP_WS/3rdparty/panda3d
$ git clone https://github.com/panda3d/panda3d
$ cd panda3d
$ python3 makepanda/makepanda.py --everything --installer --no-egl --no-gles --no-gles2 --no-opencv
$ python3 makepanda/makepanda.py --everything --installer --no-egl --no-gles --no-gles2 --no-opencv --threads $(nproc)
\endcode
At this point you can either:
1. install the produced Debian package (recommended) with
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/tracking/tutorial-tracking-tt.dox
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ vpTemplateTracker::setIterationMax() function.
In tutorial-template-tracker.cpp we use vpTemplateTrackerSSDInverseCompositional class that implements the
"Sum of Square Differences" as similarity function. To use Mutual Information that is more robust to occlusion and
lighting changes, the code needs to be modified, first introducing vpTemplateTrackerMIInverseCompositional header,
then instanciating the tracker, and finally setting the paramaters to speed up the MI tracker that is slower than
then instantiating the tracker, and finally setting the paramaters to speed up the MI tracker that is slower than
the SSD one:

- **Adding vpTemplateTrackerMIInverseCompositional header** consists in adding the following line at the beginning
Expand Down
8 changes: 4 additions & 4 deletions doc/tutorial/visual-servo/tutorial-simu-robot-pioneer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ frame.
The desired position of the feature is set to (0,0). The depth of the point \c cdMo[2][3] is required to compute the
feature position.
\code
s_xd.build(0, 0, cdMo[2][3]);
s_xd.buildFrom(0, 0, cdMo[2][3]);
\endcode

Finally only the position of the feature along x is added to the task.
Expand All @@ -167,12 +167,12 @@ Then, we get the current \c Z and desired \c Zd depth of the target.
From these values, we are able to initialize the current depth feature:

\code
s_Z.build(s_x.get_x(), s_x.get_y(), Z, log(Z/Zd));
s_Z.buildFrom(s_x.get_x(), s_x.get_y(), Z, log(Z/Zd));
\endcode

and also the desired one:
\code
s_Zd.build(0, 0, Zd, 0);
s_Zd.buildFrom(0, 0, Zd, 0);
\endcode

Finally, we add the feature to the task:
Expand Down Expand Up @@ -204,7 +204,7 @@ Based on these new coordinates, we update the point visual feature \c s_x:
and also the depth visual feature:
\code
Z = point.get_Z() ;
s_Z.build(s_x.get_x(), s_x.get_y(), Z, log(Z/Zd)) ;
s_Z.buildFrom(s_x.get_x(), s_x.get_y(), Z, log(Z/Zd)) ;
\endcode

We also update the task with the values of the velocity twist matrix \c cVe and the robot jacobian \c eJe:
Expand Down
8 changes: 4 additions & 4 deletions example/calibration/calibrate-hand-eye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main()
erc[1] = vpMath::rad(-10); // -10 deg
erc[2] = vpMath::rad(25); // 25 deg

eMc.build(etc, erc);
eMc.buildFrom(etc, erc);
std::cout << "Simulated hand-eye transformation: eMc " << std::endl;
std::cout << eMc << std::endl;
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " " << vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
Expand All @@ -90,8 +90,8 @@ int main()
v_c = 0;
if (i == 0) {
// Initialize first poses
cMo[0].build(0, 0, 0.5, 0, 0, 0); // z=0.5 m
wMe[0].build(0, 0, 0, 0, 0, 0); // Id
cMo[0].buildFrom(0, 0, 0.5, 0, 0, 0); // z=0.5 m
wMe[0].buildFrom(0, 0, 0, 0, 0, 0); // Id
}
else if (i == 1)
v_c[3] = M_PI / 8;
Expand Down Expand Up @@ -171,4 +171,4 @@ int main()
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ static void *mainLoop(void *_simu)
// Sets the desired position of the point
vpFeaturePoint pd[4];

pd[0].build(-0.1, -0.1, 1);
pd[1].build(0.1, -0.1, 1);
pd[2].build(0.1, 0.1, 1);
pd[3].build(-0.1, 0.1, 1);
pd[0].buildFrom(-0.1, -0.1, 1);
pd[1].buildFrom(0.1, -0.1, 1);
pd[2].buildFrom(0.1, 0.1, 1);
pd[3].buildFrom(-0.1, 0.1, 1);

// Define the task
// We want an eye-in-hand control law
Expand Down
2 changes: 0 additions & 2 deletions example/device/framegrabber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ if(VISP_HAVE_REALSENSE OR VISP_HAVE_REALSENSE2)
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-inconsistent-missing-override")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder")
Expand All @@ -79,7 +78,6 @@ if(VISP_HAVE_REALSENSE OR VISP_HAVE_REALSENSE2)
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-conversion")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call")
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers")

visp_set_source_file_compile_flag(getRealSense2Info.cpp ${CXX_FLAGS_MUTE_WARNINGS})
Expand Down
2 changes: 2 additions & 0 deletions example/device/framegrabber/readRealSenseData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ bool getOptions(int argc, const char *argv[], std::string &input_directory, std:
case 'z':
read_npz = true;
break;
#else
(void)read_npz;
#endif
case 'o':
save_video = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int main(int argc, const char **argv)

// camera desired position
vpHomogeneousMatrix cMo;
cMo.build(0.0, 0, Z + 0.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(5));
cMo.buildFrom(0.0, 0, Z + 0.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(5));
vpHomogeneousMatrix wMo; // Set to identity
vpHomogeneousMatrix wMc; // Camera position in the world frame

Expand Down Expand Up @@ -460,15 +460,15 @@ int main(int argc, const char **argv)
luminanceI.init(I.getHeight(), I.getWidth(), Z);
luminanceI.setCameraParameters(cam);
vpFeatureLuminanceMapping sI(luminanceI, sMapping);
sI.build(I);
sI.buildFrom(I);
sI.getMapping()->inverse(sI.get_s(), Irec);

// desired visual feature built from the image
vpFeatureLuminance luminanceId;
luminanceId.init(I.getHeight(), I.getWidth(), Z);
luminanceId.setCameraParameters(cam);
vpFeatureLuminanceMapping sId(luminanceId, sdMapping);
sId.build(Id);
sId.buildFrom(Id);

// set a velocity control mode
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
Expand Down Expand Up @@ -497,7 +497,7 @@ int main(int argc, const char **argv)
vpImageTools::imageDifference(I, Id, Idiff);

// Compute current visual features
sI.build(I);
sI.buildFrom(I);
sI.getMapping()->inverse(sI.get_s(), Irec);

if (iter > iterGN) {
Expand Down
8 changes: 4 additions & 4 deletions example/direct-visual-servoing/photometricVisualServoing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ int main(int argc, const char **argv)

// camera desired position
vpHomogeneousMatrix cMo;
cMo.build(0, 0, 1.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(20));
cMo.buildFrom(0, 0, 1.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(20));
vpHomogeneousMatrix wMo; // Set to identity
vpHomogeneousMatrix wMc; // Camera position in the world frame

Expand Down Expand Up @@ -356,13 +356,13 @@ int main(int argc, const char **argv)
vpFeatureLuminance sI;
sI.init(I.getHeight(), I.getWidth(), Z);
sI.setCameraParameters(cam);
sI.build(I);
sI.buildFrom(I);

// desired visual feature built from the image
vpFeatureLuminance sId;
sId.init(I.getHeight(), I.getWidth(), Z);
sId.setCameraParameters(cam);
sId.build(Id);
sId.buildFrom(Id);

// Create visual-servoing task
vpServo servo;
Expand Down Expand Up @@ -406,7 +406,7 @@ int main(int argc, const char **argv)
}
#endif
// Compute current visual feature
sI.build(I);
sI.buildFrom(I);

v = servo.computeControlLaw(); // camera velocity send to the robot

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ int main(int argc, const char **argv)

// camera desired position
vpHomogeneousMatrix cMo;
cMo.build(0, 0, 1.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(20));
cMo.buildFrom(0, 0, 1.2, vpMath::rad(15), vpMath::rad(-5), vpMath::rad(20));
vpHomogeneousMatrix wMo; // Set to identity
vpHomogeneousMatrix wMc; // Camera position in the world frame

Expand Down Expand Up @@ -357,13 +357,13 @@ int main(int argc, const char **argv)
vpFeatureLuminance sI;
sI.init(I.getHeight(), I.getWidth(), Z);
sI.setCameraParameters(cam);
sI.build(I);
sI.buildFrom(I);

// desired visual feature built from the image
vpFeatureLuminance sId;
sId.init(I.getHeight(), I.getWidth(), Z);
sId.setCameraParameters(cam);
sId.build(Id);
sId.buildFrom(Id);

// Matrice d'interaction, Hessien, erreur,...
vpMatrix Lsd; // matrice d'interaction a la position desiree
Expand Down Expand Up @@ -435,7 +435,7 @@ int main(int argc, const char **argv)
}
#endif
// Compute current visual feature
sI.build(I);
sI.buildFrom(I);

// compute current error
sI.error(sId, error);
Expand Down
2 changes: 2 additions & 0 deletions example/kalman/ukf-nonlinear-complex-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
* the interval \f$[- \pi ; \pi ]\f$ .
*/

#include <iostream>

// UKF includes
#include <visp3/core/vpUKSigmaDrawerMerwe.h>
#include <visp3/core/vpUnscentedKalman.h>
Expand Down
2 changes: 1 addition & 1 deletion example/manual/hello-world/CMake/HelloWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main()
vpRotationMatrix R(vpMath::rad(0.), vpMath::rad(180) + 100 * std::numeric_limits<double>::epsilon(), 0.);

// Extract the theta U angles from a rotation matrix
tu.build(R);
tu.buildFrom(R);

// Since the rotation vector is 3 values column vector, the
// transpose operation produce a row vector.
Expand Down
2 changes: 1 addition & 1 deletion example/math/exponentialMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main()

// Build a ThetaU rotation vector from a Rxyz vector
vpThetaUVector tu;
tu.build(rxyz);
tu.buildFrom(rxyz);

vpColVector v(6); // Velocity vector [t, thetaU]^t

Expand Down
2 changes: 1 addition & 1 deletion example/particle-filter/pf-nonlinear-complex-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class vpLandmarksGrid
*/
vpLandmarksGrid(const std::vector<vpLandmarkMeasurements> &landmarks, const double &distMaxAllowed)
: m_landmarks(landmarks)
, m_nbLandmarks(landmarks.size())
, m_nbLandmarks(static_cast<unsigned int>(landmarks.size()))
{
double sigmaDistance = distMaxAllowed / 3.;
double sigmaDistanceSquared = sigmaDistance * sigmaDistance;
Expand Down
10 changes: 5 additions & 5 deletions example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ int main(int argc, const char **argv)

// Build the 3D translation feature: ctc*
vpFeatureTranslation t(vpFeatureTranslation::cMcd);
t.build(cMcd);
t.buildFrom(cMcd);

// Build the 3D rotation feature: thetaU_cRc*
vpFeatureThetaU tu(vpFeatureThetaU::cRcd); // current feature
tu.build(cMcd);
tu.buildFrom(cMcd);

// Sets the desired rotation (always zero !) since s is the
// rotation that the camera has to achieve. Here s* = (0, 0)^T
Expand Down Expand Up @@ -269,8 +269,8 @@ int main(int argc, const char **argv)
cMcd = cMo * cdMo.inverse();

// Update the current visual features
t.build(cMcd);
tu.build(cMcd);
t.buildFrom(cMcd);
tu.buildFrom(cMcd);

// Compute the control law
v = task.computeControlLaw();
Expand Down Expand Up @@ -307,4 +307,4 @@ int main(int argc, const char **argv)
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
10 changes: 5 additions & 5 deletions example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ int main(int argc, const char **argv)
// Build the current visual features s = (c*tc, thetaU_c*Rc)^T
vpFeatureTranslation t(vpFeatureTranslation::cdMc);
vpFeatureThetaU tu(vpFeatureThetaU::cdRc); // current feature
t.build(cdMc);
tu.build(cdMc);
t.buildFrom(cdMc);
tu.buildFrom(cdMc);

// Sets the desired rotation (always zero !) since s is the
// rotation that the camera has to achieve. Here s* = (0, 0)^T
Expand Down Expand Up @@ -267,8 +267,8 @@ int main(int argc, const char **argv)
cdMc = cdMo * cMo.inverse();

// Update the current visual features
t.build(cdMc);
tu.build(cdMc);
t.buildFrom(cdMc);
tu.buildFrom(cdMc);

// Compute the control law
v = task.computeControlLaw();
Expand Down Expand Up @@ -303,4 +303,4 @@ int main(int argc, const char **argv)
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ int main(int argc, const char **argv)
// sets the desired position of the point
vpFeaturePoint pd[4];

pd[0].build(-0.1, -0.1, 1);
pd[1].build(0.1, -0.1, 1);
pd[2].build(0.1, 0.1, 1);
pd[3].build(-0.1, 0.1, 1);
pd[0].buildFrom(-0.1, -0.1, 1);
pd[1].buildFrom(0.1, -0.1, 1);
pd[2].buildFrom(0.1, 0.1, 1);
pd[3].buildFrom(-0.1, 0.1, 1);

// define the task
// - we want an eye-in-hand control law
Expand Down Expand Up @@ -247,10 +247,10 @@ int main(int argc, const char **argv)
}
// since vpServo::MEAN interaction matrix is used, we need also to
// update the desired features at each iteration
pd[0].build(-0.1, -0.1, 1);
pd[1].build(0.1, -0.1, 1);
pd[2].build(0.1, 0.1, 1);
pd[3].build(-0.1, 0.1, 1);
pd[0].buildFrom(-0.1, -0.1, 1);
pd[1].buildFrom(0.1, -0.1, 1);
pd[2].buildFrom(0.1, 0.1, 1);
pd[3].buildFrom(-0.1, 0.1, 1);

// compute the control law ") ;
v = task.computeControlLaw();
Expand All @@ -275,4 +275,4 @@ int main(int argc, const char **argv)
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Loading

0 comments on commit f83e271

Please sign in to comment.