Skip to content

Commit 1575d03

Browse files
committed
Revert clang-format modifications introduced with column width at 80 in sample code between doxygen \code and \endcode tags)
1 parent 2fb9ba6 commit 1575d03

File tree

919 files changed

+23354
-44450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

919 files changed

+23354
-44450
lines changed

demo/wireframe-simulator/servoSimu4Points.cpp

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
#ifdef VISP_HAVE_DISPLAY
7070

7171
void usage(const char *name, std::string ipath, const char *badparam);
72-
bool getOptions(int argc, const char **argv, std::string &ipath,
73-
bool &display);
72+
bool getOptions(int argc, const char **argv, std::string &ipath, bool &display);
7473

7574
/*!
7675
@@ -130,8 +129,7 @@ OPTIONS: Default\n\
130129
\return false if the program has to be stopped, true otherwise.
131130
132131
*/
133-
bool getOptions(int argc, const char **argv, std::string &ipath,
134-
bool &display)
132+
bool getOptions(int argc, const char **argv, std::string &ipath, bool &display)
135133
{
136134
const char *optarg_;
137135
int c;
@@ -226,8 +224,7 @@ int main(int argc, const char **argv)
226224
// Set initial position of the object in the camera frame
227225
vpHomogeneousMatrix cMo(0, 0.1, 2.0, vpMath::rad(35), vpMath::rad(25), 0);
228226
// Set desired position of the object in the camera frame
229-
vpHomogeneousMatrix cdMo(0.0, 0.0, 1.0, vpMath::rad(0), vpMath::rad(0),
230-
vpMath::rad(0));
227+
vpHomogeneousMatrix cdMo(0.0, 0.0, 1.0, vpMath::rad(0), vpMath::rad(0), vpMath::rad(0));
231228
// Set initial position of the object in the world frame
232229
vpHomogeneousMatrix wMo(0.0, 0.0, 0.2, 0, 0, 0);
233230
// Position of the camera in the world frame
@@ -315,17 +312,15 @@ int main(int argc, const char **argv)
315312
vpWireFrameSimulator sim;
316313

317314
// Set the scene
318-
sim.initScene(vpWireFrameSimulator::PLATE,
319-
vpWireFrameSimulator::D_STANDARD, list);
315+
sim.initScene(vpWireFrameSimulator::PLATE, vpWireFrameSimulator::D_STANDARD, list);
320316

321317
// Initialize simulator frames
322-
sim.set_fMo(wMo); // Position of the object in the world reference frame
318+
sim.set_fMo(wMo); // Position of the object in the world reference frame
323319
sim.setCameraPositionRelObj(cMo); // initial position of the camera
324320
sim.setDesiredCameraPosition(cdMo); // desired position of the camera
325321

326322
// Set the External camera position
327-
vpHomogeneousMatrix camMf(
328-
vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
323+
vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
329324
sim.setExternalCameraPosition(camMf);
330325

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

354349
// Display the object frame the world reference frame and the camera
355350
// frame
356-
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(),
357-
camera, 0.2, vpColor::none);
358-
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2,
359-
vpColor::none);
351+
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
352+
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
360353
vpDisplay::displayFrame(Iext1, camMf, camera, 0.2, vpColor::none);
361354

362355
// Display the world reference frame and the object frame
363356
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
364-
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
365-
vpColor::none);
357+
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
366358

367359
vpDisplay::flush(Iint);
368360
vpDisplay::flush(Iext1);
369361
vpDisplay::flush(Iext2);
370362

371363
std::cout << "Click on a display" << std::endl;
372-
while (!vpDisplay::getClick(Iint, false) &&
373-
!vpDisplay::getClick(Iext1, false) &&
364+
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext1, false) &&
374365
!vpDisplay::getClick(Iext2, false)) {
375366
};
376367
}
@@ -432,20 +423,14 @@ int main(int argc, const char **argv)
432423

433424
// Display the camera frame, the object frame the world reference
434425
// frame
435-
vpDisplay::displayFrame(Iext1,
436-
sim.getExternalCameraPosition() *
437-
sim.get_fMo() * cMo.inverse(),
438-
camera, 0.2, vpColor::none);
439-
vpDisplay::displayFrame(
440-
Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
441-
0.2, vpColor::none);
442-
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(),
443-
camera, 0.2, vpColor::none);
426+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
427+
vpColor::none);
428+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
429+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);
444430

445431
// Display the world reference frame and the object frame
446432
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
447-
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
448-
vpColor::none);
433+
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
449434

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

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

457-
std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
458-
<< std::endl;
442+
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
459443
}
460444

461445
task.print();

demo/wireframe-simulator/servoSimuCylinder.cpp

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,9 @@ int main(int argc, const char **argv)
197197
robot.setSamplingTime(sampling_time);
198198

199199
// Set initial position of the object in the camera frame
200-
vpHomogeneousMatrix cMo(0, 0.1, 0.3, vpMath::rad(35), vpMath::rad(25),
201-
vpMath::rad(75));
200+
vpHomogeneousMatrix cMo(0, 0.1, 0.3, vpMath::rad(35), vpMath::rad(25), vpMath::rad(75));
202201
// Set desired position of the object in the camera frame
203-
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.5, vpMath::rad(90), vpMath::rad(0),
204-
vpMath::rad(0));
202+
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.5, vpMath::rad(90), vpMath::rad(0), vpMath::rad(0));
205203
// Set initial position of the object in the world frame
206204
vpHomogeneousMatrix wMo(0.0, 0.0, 0, 0, 0, 0);
207205
// Position of the camera in the world frame
@@ -245,17 +243,15 @@ int main(int argc, const char **argv)
245243
vpWireFrameSimulator sim;
246244

247245
// Set the scene
248-
sim.initScene(vpWireFrameSimulator::CYLINDER,
249-
vpWireFrameSimulator::D_STANDARD);
246+
sim.initScene(vpWireFrameSimulator::CYLINDER, vpWireFrameSimulator::D_STANDARD);
250247

251248
// Initialize simulator frames
252-
sim.set_fMo(wMo); // Position of the object in the world reference frame
249+
sim.set_fMo(wMo); // Position of the object in the world reference frame
253250
sim.setCameraPositionRelObj(cMo); // initial position of the camera
254251
sim.setDesiredCameraPosition(cdMo); // desired position of the camera
255252

256253
// Set the External camera position
257-
vpHomogeneousMatrix camMf(
258-
vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
254+
vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0));
259255
sim.setExternalCameraPosition(camMf);
260256

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

279275
// Display the object frame the world reference frame and the camera
280276
// frame
281-
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo() * cMo.inverse(),
282-
camera, 0.2, vpColor::none);
283-
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo(), camera, 0.2,
284-
vpColor::none);
277+
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
278+
vpDisplay::displayFrame(Iext, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
285279
vpDisplay::displayFrame(Iext, camMf, camera, 0.2, vpColor::none);
286280

287281
vpDisplay::flush(Iint);
288282
vpDisplay::flush(Iext);
289283

290284
std::cout << "Click on a display" << std::endl;
291-
while (!vpDisplay::getClick(Iint, false) &&
292-
!vpDisplay::getClick(Iext, false)) {
285+
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext, false)) {
293286
};
294287
}
295288

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

389382
// Display the object frame the world reference frame and the camera
390383
// frame
391-
vpDisplay::displayFrame(Iext,
392-
sim.getExternalCameraPosition() *
393-
sim.get_fMo() * cMo.inverse(),
394-
camera, 0.2, vpColor::none);
395-
vpDisplay::displayFrame(
396-
Iext, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
397-
0.2, vpColor::none);
398-
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition(), camera,
399-
0.2, vpColor::none);
384+
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
385+
vpColor::none);
386+
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
387+
vpDisplay::displayFrame(Iext, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);
400388
;
401389

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

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

408-
std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
409-
<< std::endl;
396+
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
410397
}
411398

412399
task.print();

demo/wireframe-simulator/servoSimuSphere.cpp

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@
7474
void usage(const char *name, const char *badparam);
7575
bool getOptions(int argc, const char **argv, bool &display);
7676
void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s);
77-
void computeInteractionMatrix(const vpGenericFeature &s,
78-
const vpSphere &sphere, vpMatrix &L);
77+
void computeInteractionMatrix(const vpGenericFeature &s, const vpSphere &sphere, vpMatrix &L);
7978

8079
/*!
8180
@@ -173,18 +172,15 @@ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s)
173172
double m11 = sphere.get_mu11();
174173
double h2;
175174
// if (gx != 0 || gy != 0)
176-
if (std::fabs(gx) > std::numeric_limits<double>::epsilon() ||
177-
std::fabs(gy) > std::numeric_limits<double>::epsilon())
175+
if (std::fabs(gx) > std::numeric_limits<double>::epsilon() || std::fabs(gy) > std::numeric_limits<double>::epsilon())
178176
h2 = (vpMath::sqr(gx) + vpMath::sqr(gy)) /
179-
(4 * m20 * vpMath::sqr(gy) + 4 * m02 * vpMath::sqr(gx) -
180-
8 * m11 * gx * gy);
177+
(4 * m20 * vpMath::sqr(gy) + 4 * m02 * vpMath::sqr(gx) - 8 * m11 * gx * gy);
181178
else
182179
h2 = 1 / (4 * m20);
183180

184181
double sx = gx * h2 / (sqrt(h2 + 1));
185182
double sy = gy * h2 / (sqrt(h2 + 1));
186-
double sz =
187-
sqrt(h2 + 1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2));
183+
double sz = sqrt(h2 + 1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2));
188184

189185
s.set_s(sx, sy, sz);
190186
}
@@ -196,8 +192,7 @@ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s)
196192
with I3 the 3x3 identity matrix
197193
with [s]x the skew matrix related to s
198194
*/
199-
void computeInteractionMatrix(const vpGenericFeature &s,
200-
const vpSphere &sphere, vpMatrix &L)
195+
void computeInteractionMatrix(const vpGenericFeature &s, const vpSphere &sphere, vpMatrix &L)
201196
{
202197
L = 0;
203198
L[0][0] = -1 / sphere.getR();
@@ -271,8 +266,7 @@ int main(int argc, const char **argv)
271266
// Set initial position of the object in the camera frame
272267
vpHomogeneousMatrix cMo(0, 0.1, 2.0, vpMath::rad(35), vpMath::rad(25), 0);
273268
// Set desired position of the object in the camera frame
274-
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.8, vpMath::rad(0), vpMath::rad(0),
275-
vpMath::rad(0));
269+
vpHomogeneousMatrix cdMo(0.0, 0.0, 0.8, vpMath::rad(0), vpMath::rad(0), vpMath::rad(0));
276270
// Set initial position of the object in the world frame
277271
vpHomogeneousMatrix wMo(0.0, 0.0, 0, 0, 0, 0);
278272
// Position of the camera in the world frame
@@ -319,17 +313,15 @@ int main(int argc, const char **argv)
319313
vpWireFrameSimulator sim;
320314

321315
// Set the scene
322-
sim.initScene(vpWireFrameSimulator::SPHERE,
323-
vpWireFrameSimulator::D_STANDARD);
316+
sim.initScene(vpWireFrameSimulator::SPHERE, vpWireFrameSimulator::D_STANDARD);
324317

325318
// Initialize simulator frames
326-
sim.set_fMo(wMo); // Position of the object in the world reference frame
319+
sim.set_fMo(wMo); // Position of the object in the world reference frame
327320
sim.setCameraPositionRelObj(cMo); // initial position of the camera
328321
sim.setDesiredCameraPosition(cdMo); // desired position of the camera
329322

330323
// Set the External camera position
331-
vpHomogeneousMatrix camMf(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30),
332-
0);
324+
vpHomogeneousMatrix camMf(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0);
333325
sim.setExternalCameraPosition(camMf);
334326

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

357349
// Display the object frame the world reference frame and the camera
358350
// frame
359-
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(),
360-
camera, 0.2, vpColor::none);
361-
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2,
362-
vpColor::none);
351+
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
352+
vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
363353
vpDisplay::displayFrame(Iext1, camMf, camera, 0.2, vpColor::none);
364354

365355
// Display the world reference frame and the object frame
366356
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
367-
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
368-
vpColor::none);
357+
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
369358

370359
vpDisplay::flush(Iint);
371360
vpDisplay::flush(Iext1);
372361
vpDisplay::flush(Iext2);
373362

374363
std::cout << "Click on a display" << std::endl;
375-
while (!vpDisplay::getClick(Iint, false) &&
376-
!vpDisplay::getClick(Iext1, false) &&
364+
while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext1, false) &&
377365
!vpDisplay::getClick(Iext2, false)) {
378366
};
379367
}
@@ -425,20 +413,14 @@ int main(int argc, const char **argv)
425413

426414
// Display the camera frame, the object frame the world reference
427415
// frame
428-
vpDisplay::displayFrame(Iext1,
429-
sim.getExternalCameraPosition() *
430-
sim.get_fMo() * cMo.inverse(),
431-
camera, 0.2, vpColor::none);
432-
vpDisplay::displayFrame(
433-
Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera,
434-
0.2, vpColor::none);
435-
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(),
436-
camera, 0.2, vpColor::none);
416+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
417+
vpColor::none);
418+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
419+
vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition(), camera, 0.2, vpColor::none);
437420

438421
// Display the world reference frame and the object frame
439422
vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
440-
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05,
441-
vpColor::none);
423+
vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
442424

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

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

450-
std::cout << "|| s - s* || = " << (task.getError()).sumSquare()
451-
<< std::endl;
432+
std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
452433
}
453434

454435
task.print();

example/calibration/calibrateTsai.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ int main()
6464
// transformation. The object
6565
// frame is attached to the
6666
// calibrartion grid
67-
std::vector<vpHomogeneousMatrix> wMe(
68-
N); // world to hand (end-effector) transformation
67+
std::vector<vpHomogeneousMatrix> wMe(N); // world to hand (end-effector) transformation
6968
// Output: Result of the calibration
70-
vpHomogeneousMatrix
71-
eMc; // hand (end-effector) to eye (camera) transformation
69+
vpHomogeneousMatrix eMc; // hand (end-effector) to eye (camera) transformation
7270

7371
// Initialize an eMc transformation used to produce the simulated input
7472
// transformations cMo and wMe
@@ -81,8 +79,7 @@ int main()
8179
eMc.buildFrom(etc, erc);
8280
std::cout << "Simulated hand to eye transformation: eMc " << std::endl;
8381
std::cout << eMc << std::endl;
84-
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " "
85-
<< vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
82+
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " " << vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
8683
<< std::endl;
8784

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

139-
std::cout << std::endl
140-
<< "Output: hand to eye calibration result: eMc estimated "
141-
<< std::endl;
136+
std::cout << std::endl << "Output: hand to eye calibration result: eMc estimated " << std::endl;
142137
std::cout << eMc << std::endl;
143138
eMc.extract(erc);
144-
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " "
145-
<< vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
139+
std::cout << "Theta U rotation: " << vpMath::deg(erc[0]) << " " << vpMath::deg(erc[1]) << " " << vpMath::deg(erc[2])
146140
<< std::endl;
147141
return 0;
148142
} catch (vpException &e) {

0 commit comments

Comments
 (0)