Skip to content

Generating ViSP wrapper plugin

Fabien Spindler edited this page Dec 29, 2022 · 10 revisions

Table of contents :

  1. Software requirements
  2. How to build ViSP wrapper plugin
    2.1. On Ubuntu
    2.2. On MacOS
    2.3. On Windows
  3. Next tutorial: Unity AR Demo

1. Software requirements

  • Before building solution for application, your computer should have ViSP and some other third party libraries (like OpenCV) installed that may be used in the project. Detailed download and installation tutorials are available on the ViSP main page.
  • Unity Engine (2018.4.20f1 or more recent version)

Return to table of content.

2. How to build ViSP wrapper plugin

2.1. On Ubuntu

Here we explain how to generate and install ViSPUnity.so plugin:

  • The first step is to build ViSP following Tutorial: Installation from source for Linux Ubuntu or Debian. We recall here after the main steps:
    • First Create a workspace
    • Proceed with Quick ViSP installation
    • From here we suppose that you successfully build ViSP in $VISP_WS/visp-build folder. Thus ViSP shared libraries are available in $VISP_WS/visp-build/lib folder.
  • The second step is to build ViSP wrapper plugin. To this end run the following commands:
    • Download the project

      $ cd $VISP_WS
      $ git clone https://github.com/lagadic/visp_unity
      
    • Build the wrapper linking to ViSP

      $ cd visp_unity
      $ mkdir vispWrapper-build
      $ cd vispWrapper-build
      $ cmake ../vispWrapper -DVISP_DIR=$VISP_WS/visp-build
      $ make
      

      Here you should find the plugin in $VISP_WS/visp_unity/vispWrapper-build/ViSPUnity.so

    • Copy the plugin ViSPUnity.so in $VISP_WS/visp_unity/unityProject/Assets/ folder running:

      $ make install
      
    • You can also build the Doxygen documentation running:

      $ make doc
      

      Documentation is now available in $VISP_WS/visp_unity/vispWrapper-build/doc/html/index.html.

Return to table of content.

2.2. On MacOS

Here we explain how to generate and install ViSPUnity.bundle plugin:

  • The first step is to build ViSP following Tutorial: Installation from source for OSX with Homebrew. We recall here after the main steps:
    • First Create a workspace
    • Proceed with Quick ViSP installation
    • From here we suppose that you successfully build ViSP in $VISP_WS/visp-build folder. Thus ViSP shared libraries are available in $VISP_WS/visp-build/lib folder.
  • The second step is to build ViSP wrapper plugin. To this end run the following commands:
    • Download the project

      $ cd $VISP_WS
      $ git clone https://github.com/lagadic/visp_unity
      
    • Build the wrapper linking to ViSP

      $ cd visp_unity
      $ mkdir vispWrapper-build
      $ cd vispWrapper-build
      $ cmake ../vispWrapper -DVISP_DIR=$VISP_WS/visp-build
      $ make
      

      Here you should find the plugin in $VISP_WS/visp_unity/vispWrapper-build/ViSPUnity.bundle

    • Copy the plugin ViSPUnity.bundle in $VISP_WS/visp_unity/unityProject/Assets/ folder running:

      $ make install
      
    • You can also build the Doxygen documentation running:

      $ make doc
      

      Documentation is now available in $VISP_WS/visp_unity/vispWrapper-build/doc/html/index.html.

Return to table of content.

2.3. On Windows

Here we explain how to generate and install ViSPUnity.dll plugin. Following instructions are provided for Visual Studio 2019 (vc16) but could be adpated to any other version easily:

  • The first step is to build ViSP following Tutorial: Installation from source for Windows with Visual C++ 2019 (vc16). We recall here after the main steps:
    • First Create a workspace
    • Proceed with Quick ViSP installation
    • From here we suppose that you successfully install ViSP in %VISP_WS%/visp-build-vc16/install folder. Thus ViSP shared libraries (DLL) are available in %VISP_WS%\visp-build-vc16\install\x64\vc16\bin folder.
  • The second step is to build ViSP wrapper plugin. To this end run the following commands:
    • Download the project

      C:\> cd %VISP_WS%
      C:\> git clone https://github.com/lagadic/visp_unity
      
    • Build the wrapper linking to ViSP

      C:\> cd visp_unity
      C:\> mkdir vispWrapper-build-vc16
      C:\> cd vispWrapper-build-vc16
      C:\> cmake -G "Visual Studio 16 2019" -A "x64" ..\vispWrapper -DVISP_DIR=%VISP_WS%\visp-build-vc16\install
      C:\> cmake --build . --config Release
      

      Here you should find the plugin in %VISP_WS%\visp_unity\vispWrapper-build-vc16\Release\ViSPUnity.dll

    • Copy the plugin ViSPUnity.dll in %VISP_WS%\visp_unity\unityProject\Assets\ folder running:

      C:\> cmake --build . --config Release --target install
      
    • You can also build the Doxygen documentation running:

      C:\> cmake --build . --config Release --target doc
      

      Documentation is now available in %VISP_WS%\visp_unity\vispWrapper-build-vc16\doc\html\index.html.

Return to table of content.

3. Next tutorial: Unity AR Demo

After this, you may run the project in Unity. Some important steps are given in the next document: Running Project in Unity Engine

Return to table of content.