File: tutorial-install-ubuntu.dox

package info (click to toggle)
visp 3.7.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 166,332 kB
  • sloc: cpp: 392,705; ansic: 224,448; xml: 23,444; python: 13,701; java: 4,792; sh: 206; objc: 145; makefile: 60
file content (939 lines) | stat: -rw-r--r-- 35,494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
/**

\page tutorial-install-ubuntu Tutorial: Installation from source for Linux Ubuntu or Debian
\tableofcontents

In this tutorial you will learn how to install ViSP from source on Linux Ubuntu. These steps have been tested with
Ubuntu 16.04 64bits LTS, 17.04 64bits, 18.04 64bits LTS, 18.10 64bits 20.04 64bits LTS and Debian 9.6.0 64bits
distributions, but should work with any other distribution as well.

\note Concerning ViSP installation, we provide also other \ref tutorial.

\section install_ubuntu_required 1. Install prerequisites

Prior to build and install ViSP from source, you may install GNU g++ compiler, CMake and git.
This can be achieved running:
\code{.sh}
$ sudo apt-get install build-essential cmake-curses-gui git wget
\endcode

\section install_ubuntu_ws 2. Create a workspace

First create a workspace that will contain all ViSP source, build, data set and optional 3rd parties.
This workspace is here set to `$HOME/visp-ws` folder, but it could be set to any other location.

In a terminal, run:
\code{.sh}
$ echo "export VISP_WS=$HOME/visp-ws" >> ~/.bashrc
$ source ~/.bashrc
$ mkdir -p ${VISP_WS}
\endcode

\section install_ubuntu_quick 3. Quick ViSP installation

In this section, we give minimal instructions to build ViSP from source just to try ViSP without entering in
\ref install_ubuntu_advanced.

- Install a small number of recommended 3rd parties

  - Since Ubuntu 20.04 or Debian 11
  \code{.sh}
  $ sudo apt-get install libopencv-dev libx11-dev liblapack-dev libeigen3-dev libv4l-dev \
    libzbar-dev libpthread-stubs0-dev libdc1394-dev nlohmann-json3-dev
  \endcode

  - On older Ubuntu or Debian distros
  \code{.sh}
  $ sudo apt-get install libopencv-dev libx11-dev liblapack-dev libeigen3-dev libv4l-dev \
    libzbar-dev libpthread-stubs0-dev libdc1394-22-dev
  \endcode

- Get ViSP source code
\code{.sh}
$ cd ${VISP_WS}
$ git clone https://github.com/lagadic/visp.git
\endcode

- Create a build folder and build ViSP
\code{.sh}
$ mkdir -p ${VISP_WS}/visp-build
$ cd ${VISP_WS}/visp-build
$ cmake ../visp
$ make -j$(nproc)
\endcode

- Set `VISP_DIR` environment variable
\code{.sh}
$ echo "export VISP_DIR=${VISP_WS}/visp-build" >> ~/.bashrc
$ source ~/.bashrc
\endcode

To have a trial, just jump to \ref install_ubuntu_dataset before running some binaries that you just build or jump to
\ref install_ubuntu_next. You can later come back to the \ref install_ubuntu_advanced.

\section install_ubuntu_advanced 4. Advanced ViSP installation

\subsection install_ubuntu_3rdparty 4.1. Install 3rd parties

ViSP is interfaced with several optional 3rd party libraries.
Follow the link to see the complete list of \ref supported-third-parties.

\note ViSP can be used without any third-party since all of them are optional. But obviously in this case, as we do
not want to reinvent the wheel, some features implemented in third-party libraries will not be exploitable through ViSP.
It is therefore possible to skip in a first time this section and start directly to \ref install_ubuntu_quick. Later,
if you realize that a third-party library is missing, you can still install it, go back to the build folder,
configure ViSP with CMake to detect the newly installed third-party library and build ViSP again as explained
in \ref install_ubuntu_tips_new_3rdparty.

\subsubsection install_ubuntu_3rdparty_recommended 4.1.1. Recommended ones

We recommend to install the following 3rd parties:

- OpenCV
- libX11 to be able to open a window to display images
- lapack and eigen to benefit from optimized mathematical capabilities
- libdc1394 to grab images from firewire cameras
- libv4l to grab images from usb or analogic cameras
- libzbar to be able to detect QR codes
- pthread library
- <a href="https://json.nlohmann.me/">JSON for modern C++</a> if you wish to save or load JSON representations of ViSP
  objects

Installation of recommended 3rd parties could be performed running:

- Since Ubuntu 20.04 or Debian 11
\code{.sh}
$ sudo apt-get install libopencv-dev libx11-dev liblapack-dev libeigen3-dev libv4l-dev libzbar-dev \
  libpthread-stubs0-dev libdc1394-dev nlohmann-json3-dev
\endcode
- On older Ubuntu or Debian distros
\code{.sh}
$ sudo apt-get install libopencv-dev libx11-dev liblapack-dev libeigen3-dev libv4l-dev libzbar-dev \
  libpthread-stubs0-dev libdc1394-22-dev
\endcode

Note that on older distributions, the apt package for the JSON library is outdated. If needed, you may install
\ref soft_tool_json from source.

\subsubsection install_ubuntu_3rdparty_realsense 4.1.2. librealsense 2.x

If you have an Intel RealSense Depth camera (SR300 or D400 series), you may install librealsense 2.x in order to use
vpRealSense2 class. Otherwise you can skip this section.

Installation instructions are given in the
<a href="https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md">tutorial</a>.

\note Since our kernel is 4.12+ streaming Depth/IR/Color is supported and is provided out of the box. This means that
the patches are not needed.

Following the <a href="https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md">tutorial</a>,
we recall the main steps here:

1. Unplug any connected Intel RealSense camera.

2. Install the packages required for `librealsense` build:
\code{.sh}
$ sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev cmake-curses-gui
$ sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
\endcode

3. Get `librealsense` from github:
\code{.sh}
$ mkdir -p ${VISP_WS}/3rdparty
$ cd ${VISP_WS}/3rdparty
$ git clone https://github.com/IntelRealSense/librealsense.git
$ cd librealsense
\endcode

4. Run Intel Realsense permissions script located in `librealsense` root directory:
\code{.sh}
$ sudo ./scripts/setup_udev_rules.sh
\endcode

5. Build and install librealsense
\code{.sh}
$ mkdir build && cd build
$ cmake .. -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release
$ make -j4
$ sudo make install
\endcode

6. Connect your Realsense camera (we are using a D435) and check if you are able to acquire images running:
\code{.sh}
$ ./examples/capture/rs-capture
\endcode

If you are able to visualize the images, it means that you succeed in `librealsense` installation.

\subsubsection install_ubuntu_3rdparty_occipital_structure 4.1.3. libStructure

If you have an Occipital Structure Core sensor (monochrome or color), you may install Occipital Structure SDK in order
to use vpOccipitalStructure class. Otherwise you can skip this section.

Occipital Structure SDK contains `libStructure` pre-built library.

<b>4.1.3.1. To install this SDK</b>
- Go to https://developer.structure.io/sdk/
- Join the Developper program to be able to download the SDK.
- Retrieve your invitation from https://developer.structure.io/sdk/retrieve
- You'll then receive an email containing the link to the download page,
- Select `"Download Structure SDK (Cross-Platform)"`. It will download `StructureSDK-CrossPlatform-0.9.zip` file
- Extract its content in `${VISP_WS}/3rdparty`.
\code{.sh}
$ unzip ~/Downloads/StructureSDK-CrossPlatform-0.9.zip -d ${VISP_WS}/3rdparty
\endcode

- The SDK contains pre-built libraries for Linux, Windows and macOS.
  In order that ViSP detects Structure SDK header files and libraries, you have to set `OCCIPITAL_STRUCTURE_DIR`
  environment variable. Proceed as follows:
\code{.sh}
$ echo "export OCCIPITAL_STRUCTURE_DIR=${VISP_WS}/3rdparty/StructureSDK-CrossPlatform-0.9" >> ~/.bashrc
$ source ~/.bashrc
\endcode

- Finally to grant non-root users access to Structure Core devices, run the included udev rule installer:
\code{.sh}
$ cd $OCCIPITAL_STRUCTURE_DIR/
$ chmod a+x DriverAndFirmware/Linux/Install-CoreDriver-Udev-Linux.sh
$ sudo ./DriverAndFirmware/Linux/Install-CoreDriver-Udev-Linux.sh
\endcode

- Complete installation by rebooting.

<b>4.1.3.2. Optionally build Occipital Structure SDK samples</b>

- As explained in `${VISP_WS}/3rdparty/StructureSDK-CrossPlatform-0.9/Documentation/linux.html` you can optionally
  follow these steps to build sample applications provided with the SDK:
\code{.sh}
$ cd $OCCIPITAL_STRUCTURE_DIR/
$ mkdir build && cd build
$ cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
$ make Samples
\endcode

- After completion, sample apps may be run from the Samples directory.

\subsubsection install_ubuntu_3rdparty_flycapture 4.1.4. FlyCapture

FlyCapture is the SDK provided by [FLIR (previously Point Grey)](https://www.ptgrey.com/) to work with
FLIR USB 2.0, USB 3.0, Gigabit Ethernet or FireWire cameras. If you have such a camera, once FlyCapture is installed
you may use vpFlyCapture class. Otherwise you can skip this section.

1. Download FlyCapture2 SDK from the
[FLIR Downloads](https://www.flir.com/support-center/iis/machine-vision/downloads/spinnaker-sdk-flycapture-and-firmware-download/)
web page. You will need a downloads account to access the Download links.

2. Unpack the software in a temporary directory.

3. Follow instructions provided in `README` file to install required dependencies (`libraw1394-11`, `libgtkmm-2.4-dev`,
`libglademm-2.4-dev`, `libgtkglextmm-x11-1.2-dev`, `libusb-1.0`). For example, for Ubuntu 18.04 run:

        $ sudo apt-get install libraw1394-11 libavcodec57 libavformat57  \
          libswscale4 libswresample2 libavutil55 libgtkmm-2.4-1v5        \
          libglademm-2.4-1v5 libgtkglextmm-x11-1.2-0v5 libgtkmm-2.4-dev  \
          libglademm-2.4-dev libgtkglextmm-x11-1.2-dev libusb-1.0-0

4. Run the install script in the same directory into which you unpacked the software.

        $ sudo sh install_flycapture.sh

5. Follow the instructions of the script. This installs all the FlyCapture2 libraries, example code, sample
applications, and documentation. The script prompts you to configure udev so that devices can be used by a particular
user. If you choose to configure devices, the script changes permissions on the nodes by overwriting the default Ubuntu
permissions and giving the user full read and write access to the device nodes.

6. Restart your computer for the user permissions to take effect.

\subsubsection install_ubuntu_3rdparty_pylon 4.1.5. Pylon

The Pylon Camera Software Suite is a collection of drivers and tools for operating any
[Basler camera](https://www.baslerweb.com/en/) (IEEE1394, Camera Link, GigE or USB3.0 interface). If you don't have a
Basler camera you can skip this section.

To install Pylon, visit [Basler Software Download](https://www.baslerweb.com/en/support/downloads/software-downloads/)
page to download and install the SDK corresponding to your platform.

Pylon Camera Software Suite installation enables vpPylonGrabber class usage.

\subsubsection install_ubuntu_3rdparty_ueye 4.1.6. IDS uEye

If you have an [IDS](https://en.ids-imaging.com/) camera you may install IDS Software Suite for uEye cameras. To this
end:
- enter the [download area](https://en.ids-imaging.com/downloads.html)
- select `"uEye industrial cameras"`
- in the `"Firmware"` tab, select `"uEye (IDS Software Suite)"` and press `"SHOW"` button
- in the `"Operating system"` tab select `"Linux"` or `"Linux ARM"` and press the search button
- in the `"Software package"` section you should see the last `"IDS Software Suite"` version you may download.
  At the time this tutorial was written, we downloaded `"IDS Software Suite 4.95 for Linux 64-bit - archive file"`
  version.

Once downloaded, you may unzip the archive
\code{.sh}
$ unzip ids-software-suite-linux-64-4.95-archive.zip
\endcode

and proceed to the installation running:
\code{.sh}
$ sudo sh ./ueye_*.run
\endcode

\note At this point if the installer detects that a version of this driver is already installed:
\code{.sh}
$ sudo sh ./ueye_*.run
4.95.0.1134
...
Error: There is an old version of this driver installed. Please uninstall first.
\endcode
you need to uninstall the old version running:
\code{.sh}
$ sudo /usr/bin/ueyesetup -r all
\endcode
Now, you should be able to proceed to the installation running:
\code{.sh}
$ sudo sh ./ueye_*.run
\endcode

Documentation is available in `/opt/ids/ueye/manual/en/index.html`.

To test the Sofware Suite installation, plug a camera and run `ueyedemo` binary.
\code{.sh}
$ ueyedemo
\endcode

\note If you get the following error that occurred in our case with IDS Software Suite 4.95 and Ubuntu 18.04:
\code{.sh}
$ ueyedemo
ueyedemo: error while loading shared libraries: libomp.so.5: cannot open shared object file: No such file or directory
\endcode
you may install libomp5 running:
\code{.sh}
$ sudo apt install libomp5
\endcode
Now you should be able to run `ueyedemo`:
\code{.sh}
$ ueyedemo
\endcode

IDS uEye Camera Software Suite installation enables vpUeyeGrabber class usage.

\subsubsection install_ubuntu_3rdparty_franka 4.1.7. libfranka

I you have a Panda robot from Franka Emika, you may install libfranka in order to use vpRobotFranka class. Otherwise
you can skip this section.

Installation instructions are provided following \ref franka_prereq_libfranka. There is also the
\ref tutorial-franka-pbvs that explains how to install a real-time Linux kernel requested to control the robot by
\ref franka_prereq_rt_linux.

\subsubsection install_ubuntu_3rdparty_jaco 4.1.8. Kinova Jaco

If you have a
[Kinova Jaco](https://www.kinovarobotics.com/en/products/assistive-technologies/kinova-jaco-assistive-robotic-arm)
assistive robotic arm, it could be useful to install the corresponding Gen2 SDK to be able to use vpRobotKinova class.
This class is an interface over Kinova Jaco Gen2 SDK and allows to control
Gen2 4, 6 and 7 DoF [arm](https://www.kinovarobotics.com/en/resources/gen2-technical-resources).

To install Kinova Jaco SDK:

- [Download](https://www.kinovarobotics.com/en/resources/gen2-technical-resources) the Gen2 SDK.
At the time this tutorial was written, we downloaded Gen2 SDK 1.5.1 that comes in `PS 0000 0009_1.5.1.zip` (254M).
- Extract the zip content in a temporary folder like `/tmp/kinova-jaco`
- Enter `Ubuntu/<version>/64 bits` folder and run the installer:
\code{.sh}
$ cd /tmp/kinova-jaco
$ cd Ubuntu/16_04/64 bits
$ sh ./installSDK64.sh
\endcode
- After installation, the Gen2 SDK is available in `/opt/JACO-SDK`

\subsubsection install_ubuntu_3rdparty_ur_rtde 4.1.9. ur_rtde

If you have an [Universal Robots](https://www.universal-robots.com/products/) collaborative robot you may install
[ur_rtde](https://sdurobotics.gitlab.io/ur_rtde/).
See how to \ref ur_prereq_ur_rtde instructions to enable vpRobotUniversalRobots class usage.

\subsubsection install_ubuntu_3rdparty_qualisys 4.1.10. Qualisys Mocap

If you have the [Qualisys](https://www.qualisys.com) Motion Capture System you can optionally install
[qualisys_cpp_sdk](https://github.com/qualisys/qualisys_cpp_sdk) from source to enable vpMocapQualisys usage.

\code{.sh}
$ mkdir -p ${VISP_WS}/3rdparty/qualisys
$ cd ${VISP_WS}/3rdparty/qualisys
$ git clone https://github.com/qualisys/qualisys_cpp_sdk.git
$ cd qualisys_cpp_sdk
$ mkdir build && cd build
$ cmake .. -Dqualisys_cpp_sdk_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-fPIC
$ make -j$(nproc)
$ sudo make install
\endcode

After installation the SDK is available in `/usr/local` and will be detected by ViSP if you run
a new CMake configuration step over ViSP source code.

\subsubsection install_ubuntu_3rdparty_vicon 4.1.11. Vicon Mocap

If you have the [Vicon](https://www.vicon.com) Motion Capture System you can optionally install
[Vicon Datastream SDK](https://www.vicon.com/software/datastream-sdk/) to enable vpMocapVicon usage.

<b>4.1.11.1. Get Vicon Datastream SDK</b>

- Download latest Vicon Datastream SDK from [here](https://www.vicon.com/software/datastream-sdk/?section=downloads).
At the time this tutorial was written, we donwloaded `ViconDataStreamSDK_1.11.0_128037.zip`.
- Unzip SDK for Linux:
\code{.sh}
$ mkdir -p ${VISP_WS}/3rdparty/vicon
$ cd ${VISP_WS}/3rdparty/vicon
$ mv ~/Downloads/ViconDataStreamSDK_1.1*.zip .
$ unzip ViconDataStreamSDK_1.*.zip
$ unzip ViconDataStreamSDK_1.*_Linux64.zip
\endcode

After installation the SDK is available in `${VISP_WS}/3rdparty/vicon/Linux64`.

<b>4.1.11.2. Setup for usage</b>

To help ViSP to detect the location of Vicon Datastream SDK you will need to setup the following environment var:

\code{.sh}
$ export VICON_DIR=${VISP_WS}/3rdparty/vicon/Linux64
\endcode
\note This can also be done during ViSP cmake configuration like:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp -DVICON_DIR=${VISP_WS}/3rdparty/vicon/Linux64
\endcode

<b>4.1.11.3. Known issue</b>

If you encounter the following warning during ViSP cmake configuration:
\code{.sh}
$ cmake ../visp
CMake Warning at cmake/VISPUtils.cmake:790 (add_library):
  Cannot generate a safe linker search path for target visp_sensor because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libboost_system.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      ${VISP_WS}/3rdparty/vicon/Linux64
\endcode
it means that boost is installed as a system library and that it has a version that differs from the one
that comes with Vicon Datastream SDK that is in `${VISP_WS}/3rdparty/vicon/Linux64`.

The best to fix this is simply force boost usage from system package by removing the version that comes with the SDK:
\code{.sh}
$ cd ${VISP_WS}/3rdparty/vicon/Linux64
$ rm libboost_*.so
\endcode
and then launch a new ViSP cmake configuration:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp -DVICON_DIR=${VISP_WS}/3rdparty/vicon/Linux64
\endcode

\subsubsection install_ubuntu_3rdparty_other 4.1.12. Other optional 3rd parties

We give also the way to install other 3rd party libraries to enable specific capabilities.

- If you have an Intel Realsense RGB-D camera (R200, F200, LR200, RZ300) you may install librealsense 1.12.1 following
  these <a href="https://github.com/IntelRealSense/librealsense/blob/v1.12.1/doc/installation.md">installation instructions</a>.
- You may also install PCL library using:
\code{.sh}
$ sudo apt-get install libpcl-dev
\endcode
- Coin, to be able to support vrml cad model used by the model-based trackers. If you are using Ubuntu 19.04 or a more
  recent version use
\code{.sh}
$ sudo apt-get install libcoin-dev
\endcode
otherwise use rather:
\code{.sh}
$ sudo apt-get install libcoin80-dev
\endcode
- libjpeg and libpng to support jpeg and png images respectively (only useful if OpenCV is not installed)
\code{.sh}
$ sudo apt-get install libjpeg-dev libpng-dev
\endcode
- Ogre 3D if you want to do augmented reality or simulation
\code{.sh}
$ sudo apt-get install libogre-1.9-dev libois-dev
\endcode
- Datamatrix code detection
\code{.sh}
$ sudo apt-get install libdmtx-dev
\endcode
- Gnu Scientific Library for addtional mathematics capabilities
\code{.sh}
$ sudo apt-get install libgsl-dev
\endcode
- JSON for modern C++
\code{.sh}
$ sudo apt-get install nlohmann-json3-dev
\endcode
- Gtk-2 for gui capabilities instead of X11
\code{.sh}
$ sudo apt-get install libgtk2.0-dev libglib2.0-dev libpango1.0-dev libatk1.0-dev libcairo2-dev
\endcode
After installing the gtk packages, you need to explicitly enable gtk usage during ViSP cmake configuration step by:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp -DUSE_GTK=ON
\endcode

\subsection install_ubuntu_visp_get_source 4.2. Get ViSP source code

There are different ways to get ViSP source code:

- You can download the <a href="https://visp.inria.fr/download">latest release</a> as a zip or a tarball.
  Once downloaded, uncompress the file using either
\code{.sh}
$ tar xvzf visp-x.y.z.tar.gz -C ${VISP_WS}
\endcode
or
\code{.sh}
$ unzip visp-x.y.z.zip -d ${VISP_WS}
\endcode

- You can also download a <a href="https://visp.inria.fr/download#snapshot">daily snapshot</a>.
  Once downloaded, uncompress the file using
\code{.sh}
$ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C ${VISP_WS}
\endcode

- Or you get the cutting-edge ViSP from [GitHub repository](https://github.com/lagadic/visp) using the following command
\code{.sh}
$ cd ${VISP_WS}
$ git clone https://github.com/lagadic/visp.git
\endcode

We suppose now that ViSP source is in the directory `${VISP_WS}/visp`. The following should be adapted if you downloaded
ViSP from a zip or tarball. In that case, the source is rather in something like `${VISP_WS}/visp-x.y.z`.

\subsection install_ubuntu_visp_config 4.3. Configure ViSP from source

These are the steps to configure ViSP from source with CMake:

- In the workspace, create first a directory named `visp-build` that will contain all the build material; generated
  Makefiles, object files, output libraries and binaries.
\code{.sh}
$ mkdir ${VISP_WS}/visp-build
\endcode

- Enter the `visp-build` folder and configure the build:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp
\endcode
A more versatile way to configure the build is to use `ccmake`, the CMake GUI:
\code{.sh}
$ ccmake ../visp
\endcode
The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced
way where some options could be easily turned ON/OFF. It allows also to see which are the 3rd parties that will be used.
To generate the makefiles, just press [g] key in the ccmake gui.
\image html img-ccmake-ubuntu-all.png Snapshot of the `ccmake ../visp` command used to configure ViSP.

\subsection install_ubuntu_visp_build 4.4. Build ViSP libraries

To build ViSP libraries proceed with:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ make -j$(nproc)
\endcode

\subsection install_ubuntu_visp_doc 4.5. Build ViSP documentation

To build ViSP documentation, you have first to install Doxygen package:
\code{.sh}
$ sudo apt-get install doxygen graphviz texlive-latex-base
\endcode

Since Ubuntu 22.04, to render Latex formula you need also to install `texlive-latex-extra` package:
\code{.sh}
$ sudo apt install texlive-latex-extra
\endcode

Then you can proceed with:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp
$ make -j$(nproc) visp_doc
\endcode
The generated documentation is then available in `${VISP_WS}/visp-build/doc/html/index.html`

\note
- To speed up generating online doc, particularly around formula rendering, you can use
  [MatJax](https://www.mathjax.org).
  To this end, install MathJax and build doc using:
\code{.sh}
$ sudo apt install npm
$ npm install mathjax
$ cmake ../visp -DUSE_MATHJAX=ON
$ make -j$(nproc) visp_doc
\endcode
\note
- It is also possible to generate a more complete documentation that includes also all the internal classes.
  This could be achieved setting CMake var `ENABLE_FULL_DOC` to `ON` like:
\code{.sh}
$ cmake ../visp -DENABLE_FULL_DOC=ON
$ make -j$(nproc) visp_doc
\endcode

\subsection install_ubuntu_visp_dir 4.6. Set VISP_DIR environment var

In order to ease ViSP detection by CMake when ViSP is used as a 3rd party in an external project, like the one described
in the \ref tutorial-getting-started, you may set `VISP_DIR` environment variable with the path to the
`VISPConfig.cmake` file:
\code{.sh}
$ echo "export VISP_DIR=${VISP_WS}/visp-build" >> ~/.bashrc
$ source ~/.bashrc
\endcode

\section install_ubuntu_dataset 5. Install ViSP data set

Some ViSP examples and tests require a data set that contains images, video, models that is not part of ViSP source
code. This data set is available in Github (https://github.com/lagadic/visp-images) or as a release in a separate
archive named `visp-images-x.y.z.zip`. This archive could be downloaded from https://visp.inria.fr/download page. Note
that ViSP tutorials are not using ViSP data set.

We give hereafter the two ways to get this data set:

\subsection install_ubuntu_dataset_release 5.1. Get data set release

- Download `visp-images-3.6.0.zip` from https://visp.inria.fr/download and uncompress it in your workspace `%%VISP_WS%`:
\code{.sh}
$ unzip ~/Downloads/visp-images-3.6.0.zip -d ${VISP_WS}
\endcode
- We suppose now that the data are located in `${VISP_WS}/visp-images-3.6.0`.
\code{.sh}
$ ls ${VISP_WS}/visp-images-3.6.0
3dmodel          README.md    ellipse     mbt        video
AprilTag         Solvay       ellipse-1   mbt-cao    warp
Bayer            calibration  endianness  mbt-depth  xml
Gaussian-filter  circle       faces       memorial
Klimt            cube         iv          mire
LICENSE.txt      dnn          line        mire-2
\endcode
- Once downloaded, you need to set `VISP_INPUT_IMAGE_PATH` environment variable to help ViSP examples and tests to
  detect automatically the location of the requested data. In our case, this variable should be set to
  `${VISP_WS}/visp-images-3.6.0`. It is more convenient if this environment variables is automatically added to your bash
  session every time a new shell is launched:
\code{.sh}
$ echo "export VISP_INPUT_IMAGE_PATH=${VISP_WS}/visp-images-3.6.0" >> ~/.bashrc
$ source ~/.bashrc
\endcode

\subsection install_ubuntu_dataset_github 5.2. Get data set from github

- Use git to get the data set latest version:
\code{.sh}
C:\> cd ${VISP_WS}
C:\> git clone https://github.com/lagadic/visp-images.git
\endcode
- Once cloned, you need to set `VISP_INPUT_IMAGE_PATH` environment variable to help ViSP examples and tests to detect
  automatically the location of the requested data. In our case, this variable should be set to `${VISP_WS}%/visp-images`.
  In a shell run:
\code{.sh}
$ echo "export VISP_INPUT_IMAGE_PATH=${VISP_WS}/visp-images" >> ~/.bashrc
$ source ~/.bashrc
\endcode

\subsection install_ubuntu_dataset_test 5.3. Test data set usage

- From now, you can try to run ViSP examples and tests. For example you can run `displayX` example that should open a
  windows with Klimt painting image and some overlay drawings:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ ./example/device/display/displayX

A click to close the windows...

A click to display a cross...
Cross position: 201, 441

A click to exit the program...
Bye
\endcode

\section install_ubuntu_tips 6. Tips and tricks

\subsection install_ubuntu_tips_new_3rdparty 6.1. How to take into account a newly installed 3rd party

Since all 3rd parties are optional you may have started to install only some of them. Imagine that you just installed a
new third-party, or that you upgraded the version of this 3rd party. The next step is to go back to the build folder,
configure ViSP with CMake to detect the newly installed third-party library and build again ViSP. This could be achieved
with:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp
\endcode

Here you can check the content of the `ViSP-third-party.txt` file and see if the newly installed 3rd party is well
detected (see \ref install_ubuntu_tips_3rd_party).

Finally, you need to rebuild ViSP with:
\code{.sh}
$ make -j$(nproc)
\endcode

\subsection install_ubuntu_tips_install 6.2. How to install ViSP

Installing ViSP is optional and not recommended, since ViSP could be used as a 3rd party without installation.
If you still want to proceed with the installation run:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ sudo make install
\endcode
\note The default install location is set to `/usr/local`. This location could be changed modifying
`CMAKE_INSTALL_PREFIX` var:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/usr
$ make -j$(nproc)
$ sudo make install
\endcode

\note If you proceed to ViSP installation in a system folder like `/usr` or `/usr/local` there is no need
to \ref install_ubuntu_visp_dir that helps CMake to find ViSP libraries in an external project that uses ViSP as a
3rd party. If you rather install ViSP in a non "standard" folder, let say `/my/install/folder`, you have to set
`VISP_DIR` to `/my/install/folder/lib/cmake/visp` that contains the `VISPConfig.cmake` file:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/my/install/folder
$ make -j$(nproc)
$ sudo make install
$ echo "export VISP_DIR=/my/install/folder/lib/cmake/visp" >> ~/.bashrc
$ source ~/.bashrc
\endcode

\subsection install_ubuntu_tips_uninstall 6.3. How to uninstall ViSP
After ViSP installation, you can remove installed material using:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ sudo make uninstall
\endcode

\subsection install_ubuntu_tips_modules 6.4. How to build only ViSP libraries

If you want to build only ViSP modules libraries, nor the examples, tutorials and tests:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ make -j$(nproc) visp_modules
\endcode

\subsection install_ubuntu_tips_module_once 6.5. How to build a ViSP specific module

If you want to build a given module and all the dependencies:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ make -j$(nproc) visp_<module_name>
\endcode

For example to build the model-based tracker module named mbt, run:
\code{.sh}
$ cd ${VISP_WS}/visp-build
$ make -j$(nproc) visp_mbt
\endcode

\subsection install_ubuntu_tips_target 6.6. Which are the targets that could be run with make ?

To know which are the target available with `make`:
\code{.sh}
$ make help | grep visp
... visp_doc
... visp_examples
... visp_tests
... visp_modules
... visp_demos
... visp_tutorials
... visp_clipper
... visp_apriltag
... visp_qbdevice
... visp_pugixml
... visp_core
... visp_gui
... visp_imgproc
... visp_io
... gen_visp_java_source
... visp_klt
... visp_me
... visp_sensor
... visp_ar
... visp_blob
... visp_robot
... visp_visual_features
... visp_vs
... visp_vision
... visp_detection
... visp_mbt
... visp_tt
... visp_tt_mi
... visp_java
... visp_java_jar_source_copy
... visp_java_jar
\endcode

\subsection install_ubuntu_tips_3rd_party 6.7. Which are the 3rd party libraries that are used in ViSP ?

To see which are the optional 3rd parties that are found during the configuration stage and that will be used by
ViSP during the build you can have a look to the text file named `ViSP-third-party.txt` and located in
`${VISP_WS}/visp-build`. We provide hereafter an example of a possible content of this file that contains also build info.
\code{.sh}
$ cat ${VISP_WS}/visp-build/ViSP-third-party.txt
==========================================================
General configuration information for ViSP 3.3.1

  Version control:               3.2.0-1313-g31602e1f7-dirty

  Platform:
    Timestamp:                   2020-12-11T12:10:30Z
    Host:                        Linux 5.4.0-53-generic x86_64
    CMake:                       3.16.4
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               RelWithDebInfo

  C/C++:
    Built as dynamic libs?:      yes
    C++ Compiler:                /usr/bin/g++  (ver 7.5.0)
    C++ flags (Release):         -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -mavx -fPIC -O3 -DNDEBUG
    C++ flags (Debug):           -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -mavx -fPIC -g
    C Compiler:                  /usr/bin/gcc
    C flags (Release):           -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -mavx -fPIC -O3 -DNDEBUG
    C flags (Debug):             -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -mavx -fPIC -g
    Linker flags (Release):
    Linker flags (Debug):

  ViSP modules:
    To be built:                 core gui imgproc io java_bindings_generator klt me sensor ar blob robot visual_features vs vision detection mbt tt tt_mi java
    Disabled:                    -
    Disabled by dependency:      -
    Unavailable:                 -

  Python (for build):            /usr/bin/python2.7

  Java:
    ant:                         /usr/bin/ant (ver 1.10.5)
    JNI:                         /home/fspindle/visp-ws/java/jdk-11.0.6/include /home/fspindle/visp-ws/java/jdk-11.0.6/include/linux /home/fspindle/visp-ws/java/jdk-11.0.6/include

  Build options:
    Build deprecated:            yes
    Build with moment combine:   no

  Mathematics:
    Blas/Lapack:                 yes
    \- Use MKL:                  no
    \- Use OpenBLAS:             yes (ver 0.2.20)
    \- Use Atlas:                no
    \- Use Netlib:               no
    \- Use GSL:                  no
    \- Use Lapack (built-in):    no
    Use Eigen3:                  yes (ver 3.3.4)
    Use OpenCV:                  yes (ver 3.2.0)

  Simulator:
    Ogre simulator:
    \- Use Ogre3D:               yes (ver 1.9.0)
    \- Use OIS:                  yes (ver 1.3.0)
    Coin simulator:
    \- Use Coin3D:               yes (ver 4.0.0)
    \- Use SoWin:                no
    \- Use SoXt:                 no
    \- Use SoQt:                 no
    \- Use Qt5:                  no
    \- Use Qt4:                  no
    \- Use Qt3:                  no

  Media I/O:
    Use JPEG:                    yes (ver 80)
    Use PNG:                     yes (ver 1.6.34)
    \- Use ZLIB:                 yes (ver 1.2.11)
    Use OpenCV:                  yes (ver 3.2.0)
    Use stb_image (built-in):    no

  Real robots:
    Use Afma6:                   no
    Use Franka:                  yes (ver 0.7.1)
    Use Viper650:                no
    Use Viper850:                no
    Use Kinova Jaco:             yes
    Use aria (Pioneer):          no
    Use PTU46:                   no
    Use Biclops PTU:             no
    Use Flir PTU SDK:            no
    Use Parrot ARSDK:            yes
    \-Use ffmpeg:                yes
    Use Virtuose:                yes
    Use qbdevice (built-in):     yes (ver 2.6.0)
    Use takktile2 (built-in):    yes (ver 1.0.0)

  GUI:
    Use X11:                     yes
    Use GTK:                     no
    Use OpenCV:                  yes (ver 3.2.0)
    Use GDI:                     no
    Use Direct3D:                no

  Cameras:
    Use DC1394-2.x:              yes (ver 2.2.5)
    Use CMU 1394:                no
    Use V4L2:                    yes (ver 1.14.2)
    Use directshow:              no
    Use OpenCV:                  yes (ver 3.2.0)
    Use FLIR Flycapture:         yes
    Use Basler Pylon:            no
    Use IDS uEye:                yes (ver 4.93.0)

  RGB-D sensors:
    Use Realsense:               no
    Use Realsense2:              yes (ver 2.36.0)
    Use Kinect:                  no
    \- Use libfreenect:          no
    \- Use libusb-1:             yes (ver 1.0.21)
    \- Use pthread:              yes
    Use PCL:                     yes (ver 1.8.1)
    \- Use VTK:                  yes (ver 6.3.0)

  F/T sensors:
    Use atidaq (built-in):       no
    Use comedi:                  no
    Use IIT SDK:                 no

  Detection:
    Use zbar:                    yes (ver 0.10)
    Use dmtx:                    yes (ver 0.7.4)
    Use AprilTag (built-in):     yes (ver 3.1.1)
    \- Use AprilTag big family:  no

  Misc:
    Use Clipper (built-in):      yes (ver 6.4.2)
    Use pugixml (built-in):      yes (ver 1.9.0)
    Use libxml2:                 yes (ver 2.9.4)

  Optimization:
    Use OpenMP:                  yes
    Use pthread:                 yes
    Use pthread (built-in):      no
    Use cxx standard:            11

  Documentation:
    Use doxygen:                 yes

  Tests and samples:
    Use catch2 (built-in):       yes (ver 2.9.2)
    Tests:                       yes
    Demos:                       yes
    Examples:                    yes
    Tutorials:                   yes

  Install path:                  /usr/local

==========================================================
\endcode

\section install_ubuntu_next 7. Next tutorial

You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to
build your own project.

*/