Skip to content

Commit

Permalink
Revert clang-format modifications introduced with column width at 80 …
Browse files Browse the repository at this point in the history
…in sample code between doxygen \code and \endcode tags)
  • Loading branch information
fspindle committed Dec 22, 2017
1 parent 2fb9ba6 commit 1575d03
Show file tree
Hide file tree
Showing 919 changed files with 23,354 additions and 44,450 deletions.
48 changes: 16 additions & 32 deletions demo/wireframe-simulator/servoSimu4Points.cpp
Expand Up @@ -69,8 +69,7 @@
#ifdef VISP_HAVE_DISPLAY

void usage(const char *name, std::string ipath, const char *badparam);
bool getOptions(int argc, const char **argv, std::string &ipath,
bool &display);
bool getOptions(int argc, const char **argv, std::string &ipath, bool &display);

/*!
Expand Down Expand Up @@ -130,8 +129,7 @@ OPTIONS: Default\n\
\return false if the program has to be stopped, true otherwise.
*/
bool getOptions(int argc, const char **argv, std::string &ipath,
bool &display)
bool getOptions(int argc, const char **argv, std::string &ipath, bool &display)
{
const char *optarg_;
int c;
Expand Down Expand Up @@ -226,8 +224,7 @@ int main(int argc, const char **argv)
// Set initial position of the object in the camera frame
vpHomogeneousMatrix cMo(0, 0.1, 2.0, vpMath::rad(35), vpMath::rad(25), 0);
// Set desired position of the object in the camera frame
vpHomogeneousMatrix cdMo(0.0, 0.0, 1.0, vpMath::rad(0), vpMath::rad(0),
vpMath::rad(0));
vpHomogeneousMatrix cdMo(0.0, 0.0, 1.0, vpMath::rad(0), vpMath::rad(0), vpMath::rad(0));
// Set initial position of the object in the world frame
vpHomogeneousMatrix wMo(0.0, 0.0, 0.2, 0, 0, 0);
// Position of the camera in the world frame
Expand Down Expand Up @@ -315,17 +312,15 @@ int main(int argc, const char **argv)
vpWireFrameSimulator sim;

// Set the scene
sim.initScene(vpWireFrameSimulator::PLATE,
vpWireFrameSimulator::D_STANDARD, list);
sim.initScene(vpWireFrameSimulator::PLATE, vpWireFrameSimulator::D_STANDARD, list);

// Initialize simulator frames
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.setCameraPositionRelObj(cMo); // initial position of the camera
sim.setDesiredCameraPosition(cdMo); // desired position of the camera

// Set the External camera position
vpHomogeneousMatrix camMf(
vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
sim.setExternalCameraPosition(camMf);

// Computes the position of a camera which is fixed in the object frame
Expand Down Expand Up @@ -353,24 +348,20 @@ int main(int argc, const char **argv)

// Display the object frame the world reference frame and the camera
// frame
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf, camera, 0.2, vpColor::none);

// Display the world reference frame and the object frame
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);

vpDisplay::flush(Iint);
vpDisplay::flush(Iext1);
vpDisplay::flush(Iext2);

std::cout << "Click on a display" << std::endl;
while (!vpDisplay::getClick(Iint, false) &&
!vpDisplay::getClick(Iext1, false) &&
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext1, false) &&
!vpDisplay::getClick(Iext2, false)) {
};
}
Expand Down Expand Up @@ -432,20 +423,14 @@ int main(int argc, const char **argv)

// Display the camera frame, the object frame the world reference
// frame
vpDisplay::displayFrame(Iext1,
sim.getExternalCameraPosition() *
sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(
Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);

// Display the world reference frame and the object frame
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);

vpDisplay::flush(Iint);
vpDisplay::flush(Iext1);
Expand All @@ -454,8 +439,7 @@ int main(int argc, const char **argv)

vpTime::wait(t, sampling_time * 1000); // Wait 40 ms

std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
<< std::endl;
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
}

task.print();
Expand Down
39 changes: 13 additions & 26 deletions demo/wireframe-simulator/servoSimuCylinder.cpp
Expand Up @@ -197,11 +197,9 @@ int main(int argc, const char **argv)
robot.setSamplingTime(sampling_time);

// Set initial position of the object in the camera frame
vpHomogeneousMatrix cMo(0, 0.1, 0.3, vpMath::rad(35), vpMath::rad(25),
vpMath::rad(75));
vpHomogeneousMatrix cMo(0, 0.1, 0.3, vpMath::rad(35), vpMath::rad(25), vpMath::rad(75));
// Set desired position of the object in the camera frame
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.5, vpMath::rad(90), vpMath::rad(0),
vpMath::rad(0));
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.5, vpMath::rad(90), vpMath::rad(0), vpMath::rad(0));
// Set initial position of the object in the world frame
vpHomogeneousMatrix wMo(0.0, 0.0, 0, 0, 0, 0);
// Position of the camera in the world frame
Expand Down Expand Up @@ -245,17 +243,15 @@ int main(int argc, const char **argv)
vpWireFrameSimulator sim;

// Set the scene
sim.initScene(vpWireFrameSimulator::CYLINDER,
vpWireFrameSimulator::D_STANDARD);
sim.initScene(vpWireFrameSimulator::CYLINDER, vpWireFrameSimulator::D_STANDARD);

// Initialize simulator frames
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.setCameraPositionRelObj(cMo); // initial position of the camera
sim.setDesiredCameraPosition(cdMo); // desired position of the camera

// Set the External camera position
vpHomogeneousMatrix camMf(
vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
sim.setExternalCameraPosition(camMf);

// Set the parameters of the cameras (internal and external)
Expand All @@ -278,18 +274,15 @@ int main(int argc, const char **argv)

// Display the object frame the world reference frame and the camera
// frame
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext, camMf, camera, 0.2, vpColor::none);

vpDisplay::flush(Iint);
vpDisplay::flush(Iext);

std::cout << "Click on a display" << std::endl;
while (!vpDisplay::getClick(Iint, false) &&
!vpDisplay::getClick(Iext, false)) {
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext, false)) {
};
}

Expand Down Expand Up @@ -388,15 +381,10 @@ int main(int argc, const char **argv)

// Display the object frame the world reference frame and the camera
// frame
vpDisplay::displayFrame(Iext,
sim.getExternalCameraPosition() *
sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(
Iext, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
0.2, vpColor::none);
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition(), camera,
0.2, vpColor::none);
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);
;

vpDisplay::flush(Iint);
Expand All @@ -405,8 +393,7 @@ int main(int argc, const char **argv)

vpTime::wait(t, sampling_time * 1000); // Wait 40 ms

std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
<< std::endl;
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
}

task.print();
Expand Down
57 changes: 19 additions & 38 deletions demo/wireframe-simulator/servoSimuSphere.cpp
Expand Up @@ -74,8 +74,7 @@
void usage(const char *name, const char *badparam);
bool getOptions(int argc, const char **argv, bool &display);
void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s);
void computeInteractionMatrix(const vpGenericFeature &s,
const vpSphere &sphere, vpMatrix &L);
void computeInteractionMatrix(const vpGenericFeature &s, const vpSphere &sphere, vpMatrix &L);

/*!
Expand Down Expand Up @@ -173,18 +172,15 @@ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s)
double m11 = sphere.get_mu11();
double h2;
// if (gx != 0 || gy != 0)
if (std::fabs(gx) > std::numeric_limits<double>::epsilon() ||
std::fabs(gy) > std::numeric_limits<double>::epsilon())
if (std::fabs(gx) > std::numeric_limits<double>::epsilon() || std::fabs(gy) > std::numeric_limits<double>::epsilon())
h2 = (vpMath::sqr(gx) + vpMath::sqr(gy)) /
(4 * m20 * vpMath::sqr(gy) + 4 * m02 * vpMath::sqr(gx) -
8 * m11 * gx * gy);
(4 * m20 * vpMath::sqr(gy) + 4 * m02 * vpMath::sqr(gx) - 8 * m11 * gx * gy);
else
h2 = 1 / (4 * m20);

double sx = gx * h2 / (sqrt(h2 + 1));
double sy = gy * h2 / (sqrt(h2 + 1));
double sz =
sqrt(h2 + 1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2));
double sz = sqrt(h2 + 1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2));

s.set_s(sx, sy, sz);
}
Expand All @@ -196,8 +192,7 @@ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s)
with I3 the 3x3 identity matrix
with [s]x the skew matrix related to s
*/
void computeInteractionMatrix(const vpGenericFeature &s,
const vpSphere &sphere, vpMatrix &L)
void computeInteractionMatrix(const vpGenericFeature &s, const vpSphere &sphere, vpMatrix &L)
{
L = 0;
L[0][0] = -1 / sphere.getR();
Expand Down Expand Up @@ -271,8 +266,7 @@ int main(int argc, const char **argv)
// Set initial position of the object in the camera frame
vpHomogeneousMatrix cMo(0, 0.1, 2.0, vpMath::rad(35), vpMath::rad(25), 0);
// Set desired position of the object in the camera frame
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.8, vpMath::rad(0), vpMath::rad(0),
vpMath::rad(0));
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.8, vpMath::rad(0), vpMath::rad(0), vpMath::rad(0));
// Set initial position of the object in the world frame
vpHomogeneousMatrix wMo(0.0, 0.0, 0, 0, 0, 0);
// Position of the camera in the world frame
Expand Down Expand Up @@ -319,17 +313,15 @@ int main(int argc, const char **argv)
vpWireFrameSimulator sim;

// Set the scene
sim.initScene(vpWireFrameSimulator::SPHERE,
vpWireFrameSimulator::D_STANDARD);
sim.initScene(vpWireFrameSimulator::SPHERE, vpWireFrameSimulator::D_STANDARD);

// Initialize simulator frames
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.set_fMo(wMo); // Position of the object in the world reference frame
sim.setCameraPositionRelObj(cMo); // initial position of the camera
sim.setDesiredCameraPosition(cdMo); // desired position of the camera

// Set the External camera position
vpHomogeneousMatrix camMf(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30),
0);
vpHomogeneousMatrix camMf(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0);
sim.setExternalCameraPosition(camMf);

// Computes the position of a camera which is fixed in the object frame
Expand All @@ -356,24 +348,20 @@ int main(int argc, const char **argv)

// Display the object frame the world reference frame and the camera
// frame
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, camMf, camera, 0.2, vpColor::none);

// Display the world reference frame and the object frame
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);

vpDisplay::flush(Iint);
vpDisplay::flush(Iext1);
vpDisplay::flush(Iext2);

std::cout << "Click on a display" << std::endl;
while (!vpDisplay::getClick(Iint, false) &&
!vpDisplay::getClick(Iext1, false) &&
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext1, false) &&
!vpDisplay::getClick(Iext2, false)) {
};
}
Expand Down Expand Up @@ -425,20 +413,14 @@ int main(int argc, const char **argv)

// Display the camera frame, the object frame the world reference
// frame
vpDisplay::displayFrame(Iext1,
sim.getExternalCameraPosition() *
sim.get_fMo() * cMo.inverse(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(
Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(),
camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);

// Display the world reference frame and the object frame
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
vpColor::none);
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);

vpDisplay::flush(Iint);
vpDisplay::flush(Iext1);
Expand All @@ -447,8 +429,7 @@ int main(int argc, const char **argv)

vpTime::wait(t, sampling_time * 1000); // Wait 40 ms

std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
<< std::endl;
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
}

task.print();
Expand Down
16 changes: 5 additions & 11 deletions example/calibration/calibrateTsai.cpp
Expand Up @@ -64,11 +64,9 @@ int main()
// transformation. The object
// frame is attached to the
// calibrartion grid
std::vector<vpHomogeneousMatrix> wMe(
N); // world to hand (end-effector) transformation
std::vector<vpHomogeneousMatrix> wMe(N); // world to hand (end-effector) transformation
// Output: Result of the calibration
vpHomogeneousMatrix
eMc; // hand (end-effector) to eye (camera) transformation
vpHomogeneousMatrix eMc; // hand (end-effector) to eye (camera) transformation

// Initialize an eMc transformation used to produce the simulated input
// transformations cMo and wMe
Expand All @@ -81,8 +79,7 @@ int main()
eMc.buildFrom(etc, erc);
std::cout << "Simulated hand to 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])
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " " << vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
<< std::endl;

vpColVector v_c(6); // camera velocity used to produce 6 simulated poses
Expand Down Expand Up @@ -136,13 +133,10 @@ int main()
// transformations
vpCalibration::calibrationTsai(cMo, wMe, eMc);

std::cout << std::endl
<< "Output: hand to eye calibration result: eMc estimated "
<< std::endl;
std::cout << std::endl << "Output: hand to eye calibration result: eMc estimated " << std::endl;
std::cout << eMc << std::endl;
eMc.extract(erc);
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " "
<< vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " " << vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
<< std::endl;
return 0;
} catch (vpException &e) {
Expand Down

0 comments on commit 1575d03

Please sign in to comment.