Skip to content

Instantly share code, notes, and snippets.

@diegoferigo
Last active April 26, 2018 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegoferigo/3602fc2d5b627d897c77243172530855 to your computer and use it in GitHub Desktop.
Save diegoferigo/3602fc2d5b627d897c77243172530855 to your computer and use it in GitHub Desktop.
Setup the Workstation: cyberith + oculus

Tools

Chocolatey

Install Chocolatey to handle dependencies. Then:

choco install cmake --installargs 'ADD_CMAKE_TO_PATH=User'
choco install git
choco install ninja # This is required by opencv installed via vcpkg
choco install rapidee

Visual Studio

Install Visual Studio. You can find the installer in the intranet in the repository\common\drivers_and_software\microsoft\Visual Studio.

At the current moment (Feb 2018):

  • vcpkg needs either the 2015 Update 3 or 2017
  • cyberith provides the sdk for 2015

Considering these two VS version are ABI compatible, installing the 2017 version is recommended.

Install VS enabling all the C++ packages.

Vcpkg

Install vcpkg:

cd C:\Users\icub\Documents
mkdir code
mkdir git
cd git
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\bootstrap-vcpkg.bat
.\vcpkg.exe integrate install # From an admin cmd

Dependencies

./vcpkg install --triplet x64-windows ace gsl eigen3 sqlite3 opencv freeglut ode sdl2 qt5-declarative qt5-multimedia

Due to the institute firewall rules, for some reason the download of some of the archives fails (vcpkg#932). A workaround is downloading them from a browser that allows resuming a download such as chrome (with firefox it didn't work). Get the link of the file from the powershell and paste it in the browser. The download will stop before finishing, at this point restart it and move the downloaded archive to the vcpkg/downloads folder.

Here below you can find a list of archives which download fails updated to Apr 10th 2018:

robotology-superbuild

Before installing the superbuild, read carefully the Windows installation notes. For this setup we have chosen to handle dependencies with vcpkg, and their access from the superbuild should be configured manually. Open the Rapid Environment Editor program we installed in the first step with chocolatey, and add the following User VARIABLES:

VCPKG_ROOT=C:\Users\icub\Documents\code\git\vcpkg
CMAKE_PROGRAM_PATH=%VCPKG_ROOT%/installed/x64-windows/tools
CMAKE_PREFIX_PATH=%VCPKG_ROOT%/installed/x64-windows;%VCPKG_ROOT%/installed/x64-windows/debug

And append to Path the following variables:

%VCPKG_ROOT%/installed/x64-windows/debug/bin
%VCPKG_ROOT%/installed/x64-windows/bin

Tip: Use Get-ChildItem Env: to print all environment variables from the powershell.

Now let's install the robotology-superbuild:

cd C:\Users\icub\Documents\code\git\
git clone https://github.com/robotology/robotology-superbuild.git
cd robotology-superbuild
cmake -DNON_INTERACTIVE_BUILD:BOOL=ON ..
cmake --build . --config Release

Read the docs to understand how to let CMake find packages when importing them from Visual Studio or Open Source projects.

Note: vcpkg ships a toolchain script for setting up the environment. From CMake GUI projects can be configured to source C:\Users\icub\Documents\code\git\vcpkg\scripts\buildsystems\vcpkg.cmake. However, the projects handled by the superbuild still cannot access the variables set by the toolchain. Setting the environment variables as we already did is a possible workaround.

Oculus

Cyberith

  • Go to https://developer.cyberith.com and log in (ask Daniele for the credentials)
  • From the SDK tab, download the C++ SDK for Windows
  • From the Tools, download the Virtualizer Control Panel
  • From the Instructions tab, follow the Virtualizer + Oculus CV1 Setup document
  • Optional: download the demos

Then:

  • Extract CybSDK_tools_controlpanel_main in C:\Users\icub\git\cyb\ControlPanel
  • Extract CybSDK_sdk_windows_cpp_core in C:\Users\icub\git\cyb\SDK
  • Optional: extract the demo in C:\Users\icub\git\cyb\Demos\<folder>
@traversaro
Copy link

@diegoferigo note that 'ADD_CMAKE_TO_PATH=User' can create problems depending on the rest of the PATH configuration, because several Qt5 dlls are installed with the CMake executable.

@diegoferigo
Copy link
Author

I'm not sure I understood the problem, the environment variable involved should be Path=...;C:\Program Files\CMake\bin;... which contains:

PS C:\> ls 'C:\Program Files\CMake\bin\'


    Directory: C:\Program Files\CMake\bin


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        3/28/2018   8:33 AM       18961920 cmake-gui.exe
-a----        3/28/2018   8:33 AM        8072192 cmake.exe
-a----        3/28/2018   8:32 AM         821248 cmcldeps.exe
-a----        3/28/2018   8:33 AM        7817728 cpack.exe
-a----        3/28/2018   8:32 AM        8655872 ctest.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment