Thursday, August 10, 2017

Vive mocap for the Vive Tracker only (no HMD)

Setup and hack
  • This only works on Windows
  • Install Steam
  • Install SteamVR
    • In Steam: Library | Tools | SteamVR | right click | Install Game...
  • Clone the OpenVR SDK
  • Change file default.vrsettings
    • Located in C:\Program files (x86)\Steam\steamapps\common\SteamVR\ressources\settings
    • Change line requirehmd : true for requirehmd : false
    • More details on Luke Beno's blog (he is from Triad Semiconductor's)
  • Opt-in beta for SteamVR
    • From the SteamVR line in the Library tab
    • Right click Properties | Betas | Select the beta... | beta - ...
    • More details here
  • If you use C++ you can start with example provided by Omnifinity on github

Compile
  • Under Visual Studio
  • Run in Release config
  • You will need to indicate the example solution
    • The path for the OpenVR headers
    • The path for the OpenVR lib

Run
  • Run Steam
  • Run SteamVR
    • SteamVR will indicate NOT READY in red, this is normal
    • The Vive Tracker LED will be green
    • SteamVR will show the Vive Tracker icon in green as here
    • SteamVR's Vive Tracker green icon will display "tracking" when you mouse over it
  • Copy a version of openvr_api.dll next to your executable
  • Double click the compiled executable from the explorer
    • Or alternatively run a command prompt and call the application from it

Troubleshoot 

  • It often happens that we pair the system when actually willing to shut it down
    • This is because pairing is a 2s press and shutting down is a 5s press
    • So when release the press too fast it pairs the device with the dongle
  • This pairing seems not to work correctly
    • The led does not go green
    • And SteamVR no longer recognize the Vive Tracker
  • In order to re-pair the Vive Tracker correctly
    • Start Steam
    • Start SteamVR
    • Plug the base station
    • Manually pair the device (2s push on the device's button)
    • Then in SteamVR: press button SteamVR beta triangle | Devices | Pair Controllers
    • Everything should be fine after a few seconds




http://steamcommunity.com/app/358720/discussions/0/1470841715957441627/
https://steamcommunity.com/app/358720/discussions/0/133263024016740056/
https://steamcommunity.com/app/358720/discussions/0/133263024016787200/
http://steamcommunity.com/app/358720/discussions/0/361787186419244897/
https://www.solidearthvr.com/2017/05/12/tutorial-vive-tracker-basic-setup-in-unity/#device_numbering

Thursday, February 4, 2016

Installing CUDA + compiling Infinitam

This post describes how to install and compile Infinitam. A prerequisite for this is to install CUDA (this is also shown here).



Install CUDA
  • I have installed CUDA 8.0.44 (download here)
  • CUDA proposes different ways of installation
    • A .run file, and a .deb file
    • I am currently using the .run file
    • Follow the steps in the install guide with great care (as the CUDA install can be very tricky)
  • After this the CUDA samples and Infinitam compile fine


Install Infinitam
  • Clone Infinitam from here
  • Follow the steps from the ReadMe.md on github
    • From the created build folder  
             cmake ../InfiniTAM -DOPEN_NI_ROOT=/home/arennuit/Tools/AsusXtion/OpenNI2/
    • If cmake complains about missing GLUT libraries (GLUT_Xi_LIBRARY and GLUT_Xmu_LIBRARY) 
             sudo apt-get install libxmu-dev libxi-dev  (more info here)
  • At this point use ccmake check that cmake is pointing to the right version of OpenNI (which should be OpenNI2)
    • ccmake ../InfiniTAM
    • press 't' to toggle to the advatnced mode
    • check cmake variables OpenNI_LIBRARY (there are 3 OpenNI variables)
    • cmake has a tendency to choose old OpenNI 1 path in /usr/lib or /usr/local/lib (the error is described here)
    • change the value of OpenNI_LIBRARY to where it should point to /home/arennuit/Tools/AsusXtion/OpenNI2/Bin/x64-Release/libOpenNI2.so 
    • configure with 'c' and regenerate with 'g'
    • run cmake ../InfiniTAM
  • make
  • test using sudo ./Infinitam
    • without sudo we get Warning: USB events thread - failed to set priority. This might cause loss of data
    • sudo is required to set the USB async priority thread to critical (more details here)
  • Also it can happen that the camera is not detected
    • we get cout messages stalling at trying OpenNI device: <OpenNI default device>
    • or at OpenNI: Initialization ...
    • and ctrl+c may not work
    • in this case change USB port and restart (from a new terminal?)

NOTE: in my situation (but it seems to only occur in some specific configurations) there is a USB bandwidth problem. Even though the RGB data is not used in the registration it is streamed over USB. And in some configurations the USB is a bottleneck.
A workaround is to ask for a reduced resolution RGB image. This can be done by modifying the constructor in file InfiniTAM/InfiniTAM/Engine/OpenNIEngine.h and replacing
imageSize_rgb = Vector2i(640, 480) by imageSize_rgb = Vector2i(320, 240). More details in this issue.

Thursday, January 14, 2016

Installing Asus Xtion (on Ubuntu 14.04)

As of writing these lines (14/01/2016), the PrimeSense / Asus Xtion is a rather old device now. It has not really found its equivalent as a standard in depth sensing though and is still very much the standard in depth-based dev (i.e. SLAM...). Because of this we will show you some steps which have worked for us to install an Asus Xtion on a Gigabyte P34 laptop running Ubuntu 14.04.5 (also tested with 14.04.2).

Let's first start by stating that it takes a few seconds to set-up when you know the steps to follow but it takes hours to get to know which steps are relevant (in jungle of possible problems found on the Internet.

The painful symptom is that whatever you do, the device is not found:
  • The error output is:
After initialization:
SimpleViewer: Device open failed:
DeviceOpen using default: no devices found

  • Despite ASUS being listed when using lsusb
  • And despite the device being recognized when plugging it and running dmesg

What was tested and does NOT work (device not found):
  • Installing the OpenNI 2 binaries from the Structure website
    • The solution uses OpenNI 2 but recompiled 
  •  Recompiling the primesense driver from github/primesense
    • It is still available
    • There were 2 errors during the compilation (XnOS.h is not found and when I look at it from the source, it is only present in the PSCommon folder, which does not look right... There is also a 2nd error...)
  • A lot of posts on the web refer to using the Asus Xtion with ROS
    • These advices are irrelevant to our case that do not include ROS
  • Installing libfreenect and OpenNI2-FreenectDriver from OpenKinect 
    • These are for the Kinect (v1), not for the Asus Xtion 

Uncertain steps (we have no idea whether they had an influence):
  • We have updated the firmware
    • This operation has to be done on windows
    • The Firmware update is provided on the Asus website (windows section)
    • The device was of type 0600 before the firmware update and 0601 after (use lsusb to check)
  • Under windows the device only works if the XHCI mode is disabled in the BIOS
    • Not sure about this (I have not re-enabled the XHCI mode)
    • In a general way there seem to be problems with using the device on a USB 3 port. Disabling XHCI transforms USB 3 ports in USB 2
    • Some more explanations here

What has worked:
  • In folder Tools, create folder AsusXtion/Sensor
  • Installing the Linux drivers & SDK binaries from the Asus website
    • The version to download comes from the linux platform (not the Ubuntu platform)
    • This file Xtion_Driver_SDK.zip contains a folder SDK, which itself contains a Linux_x64_20.2.0.rar file. Unrar this file (the unrar package need to be installed) and copy the content of archive Sensor_Bin_Linux64_v5.0.2.3.tar.bz2 into folder Tools/AsusXtion/Sensor
    • Then I have called script sudo ./install
      • It outputs a log error: niReg is not found, at line 50, and you should not mind about this error message
    • OpenNI + NITE (nothing to do for these - we do not use them)
      • The OpenNI and NITE version provided by Asus in Xtion_Driver_SDK.zip where not used
      • Asus also propose another version of the OpenNI package (v20.4.2.20) which I have not tested
  • Recompiling OpenNI 2 from occipital the Structure website
    • The sources are here in github/occipital
      • Les cloner dans Tools/AsusXtion
    • Use branch develop
    • There are few dependencies to install 
      • Suivre les indications du Readme.md
      • Among them the java dev kit (jdk)
        • Otherwise it gives (hardly noticeable) errors
        • Type javac in a terminal to know if it is installed
    • make 
      • From Tools/asusXtion/OpenNI2
      • make
    • install 
      • From folder Tools/asusXtion/OpenNI2/Packaging/Linux
      • sudo ./install  
  • Tester avec NiViewer:
    • cd Tools/AsusXtion/OpenNI2/Bin/x64_Release
    • ./NiViewer
    • I had to wait a bit after the compilation / install of OpenNI2 for the system to work, I have also plugged / unplugged a few times... 

NOTE:
  • Because they are so important to us:
    • Archive Xtion_Driver_SDK.zip was saved into the dev folder of our google drive
    • Repo github.com/occipital/openni2 was forked in our github

Useful links:

Saturday, October 12, 2013

Compiling PCL/KinFu

Here are the steps to compile the PCL (including KinFu and KinFu large scale) on Linux (Ubuntu 12.04).

KinFu is not available from the compiled binaries, it needs to be compiled from the sources (branch master).

Here are the steps to follow as of 12/10/2013:
Dependencies
The easiest is probably to install the latest PCL package (so the dependencies are installed automatically):
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl 
sudo apt-get update
sudo apt-get install libpcl-all
Tools
Install git, CMake using the package manager...
Clone the sources
git clone https://github.com/PointCloudLibrary/pcl
Build folder
Get in the source's main folder and create a build directory, get in it

CMake
Configure your CMake project using ccmake. ccmake is a tool which helps handling cmake files, it is installed with package cmake-curses-gui.
sudo apt-get install cmake-curses-gui


The configuration itself:

ccmake ..



Make sure you enable the following options (you need to have the CUDA toolkit installed and be in ccmake's advanced mode to have these show):

BUILD_GPU ON
CUDA_HOST_COMPILER /usr/bin/gcc-4.6 (or your CUDA-compatible gcc version)
cmake -DCMAKE_BUILD_TYPE=Release ..


Also check you have these variables set (should already ben ON):
BUILD_gpu_kinfu ON
BUILD_gpu_kinfu_large_scale ON

CMake produces the makefile (and other files) in the build directory itself.
Make the binaries
make
(sudo) make install
All produced files (bin, lib, obj...) are stored in the build folder

___________________________________________________
Installing the CUDA toolkit and SDK:
The CUDA toolkit package contains both the toolkit and the SDK (samples). It is a real pain to install:
  • Do not install the graphics driver: nVidia's support for Linux seems to be rather loose and it is likely you update to a faulty driver version which prevents X to start. I had to reinstall Ubuntu because of this.
  • nVidia advises to install the distribution-specific package (managed package .deb which loads in the Ubuntu Software Center) but it did not work for me, the Software Center said the package was faulty.
  • Now when you install the distribution-agnostic package (.run file):

    • Do not accept the graphics driver update (for the above mentioned reason)
    • The installer tells you that CUDA is incompatible with gcc version 4.7.4. So it does not work either...

  • The idea is thus to use Ammar Qammaz' script which uses a different version of gcc
<CUDA toolkit>.run -override compiler
      • Install a compatible version of gcc (4.4) and sets nvcc to use it
Add option compiler-bindir in nvcc's profile
___________________________________________________
Potentially useful links:

Wednesday, May 9, 2012

iisuOscBridge Sources

Good news!

The sources are now freely accessible to the world ;) I have put together a github project so this should make things easy for everyone to get access. Google code is actually much easier to use than I thought...

The chosen license is LGPL because I want this code to live as much as possible on its own. Hopefully this will allow to get more contributions from you guys ;)

Enjoy!

PS: I would really appreciate to get to know about you if you download the sources or executables. No worries, it's only because I am curious ;)

Wednesday, February 29, 2012

iisuOscBridge Download

Dear all,

here is a link to a windows installer for iisuOscBridge.

This link is using Dropbox. This is only a temporary way of sharing files with you, dear readers, until I put something better in place.

Initially the bridge is only going to be available under Windows and it is not clear yet whether there will be a linux port. It may be related to the number of people asking for it... So if you shout loud enough you may be heard ;)

Cheers,

Antoine.

Welcome!

Hiya all!

And welcome to the marvelous world of iisuOscBridge!

The SDK of iisu is a piece of middleware which provides motion capture data out of 3D cameras. It is able to provide you with the exact position and configuration of gamer or users. iisu is a bit like Kinect but in much cooler (hey, I am one of iisu’s designers after all ;)).

Now iisuOscBridge is a networking layer which works on top of iisu. That is iisuOscBridge streams data out of iisu and to the outside world using the OSC networking protocol.

The main goal of iisuOscbridge is to make the data provided by iisu easily available to the artists’ community. Using the oscBridge (I have been very intimate with this software, so oscBridge is the little short name I gave to iisuOscBridge - and… yes, you can build a strong growing relation with your code ;)) you can stream the iisu out to software such as Processing, Max, Processing, Pure data... anything that can receive OSC data.

I am actually employed by SoftKinetic, the company which produced iisu. And more than that, I am deeply involved in the R&D for the motion capture’s algorithms in iisu. Though it turns out iisuOscBridge is a side project I developed in my spare time. I have spent around four months on it, nights or week-ends…

This blog is aimed at providing you news and getting feedbacks on iisuOscBridge. So please, download it, use it, break it, get crazy about it… and let me know about it all! ;)

Thanks,

Antoine.