Skip to content

Commit

Permalink
update for use with latest ofxRealSenseTwo
Browse files Browse the repository at this point in the history
removed windows project files
now works with OSX, too.
  • Loading branch information
maybites committed Mar 27, 2020
1 parent 519f892 commit 09dd419
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 2,673 deletions.
35 changes: 0 additions & 35 deletions HeadSpaceRS.sln

This file was deleted.

714 changes: 0 additions & 714 deletions HeadSpaceRS.vcxproj

This file was deleted.

1,770 changes: 0 additions & 1,770 deletions HeadSpaceRS.vcxproj.filters

This file was deleted.

14 changes: 0 additions & 14 deletions PropertySheet.props

This file was deleted.

107 changes: 67 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,31 @@ by Martin Fröhlich
## Cameras

Tested:
Intel® RealSense™ Depth Cameras D435
* Intel® RealSense™ Depth Cameras D435

Untested:
Intel® RealSense™ Depth Cameras D415
Intel® RealSense™ Depth Modules D400, D410, D420, D430
Intel® RealSense™ Vision Processor D4m
Intel® RealSense™ Tracking Module (limited support)
* Intel® RealSense™ Depth Cameras D415
* Intel® RealSense™ Depth Modules D400, D410, D420, D430
* Intel® RealSense™ Vision Processor D4m
* Intel® RealSense™ Tracking Module (limited support)

## Supported Platforms

Tested:
Windows 10 (Build 1803 or later)
* Windows 10 (Build 1803 or later)
* Mac OSX (High Sierra 10.13.2)

Untested:
Ubuntu 16.04/18.04 LTS (Linux Kernels 4.4, 4.8 ,4.10, 4.13 and 4.15)
Windows 8.1 *
Mac OS* (High Sierra 10.13.2)

****hardware frame synchronization is currently (as in Sept. 2018) not available for the D400 series
* Ubuntu 16.04/18.04 LTS (Linux Kernels 4.4, 4.8 ,4.10, 4.13 and 4.15)
* Windows 8.1

## Overview

It is based on openFrameworks and Intel RealSense SDK, should run on Windows (tested).

### Functionality

HeadSpace runs as an application on a dedicated computer with one attached RealSense device. The machine needs to be powerfull enough to do all the tracking analysis necessary.
HeadSpace runs as an application on a dedicated computer with one attached RealSense device. The machine needs to be powerfull enough to do all the tracking analysis necessary.

It is built for a accurate tracking of bodies. The tracker can send the bodies position and heigth, head-toptip-position, head-center-position, eye-center-position and gaze direction.

Expand All @@ -57,15 +55,15 @@ every client in the network can respond to this broadcast and send a handshake r

> **/ks/request/handshake** \<ClientListeningPort>
upon receiving this request, the server will send the calibration data. If the client misses some of the calibration data it has to resend the handshake request.
upon receiving this request, the server will send the calibration data. If the client misses some of the calibration data it has to resend the handshake request.

In order to get the trackingdata, the server then needs an update message every 10 seconds.

> **/ks/request/update** \<ClientListeningPort>
>
>
upon receiving this request, the server will send a continous stream of the tracking data for the next 11 seconds. Since the server will keep on sending its broadcast message every 10 seconds, the clients resend of the update-message can be triggered by the broadcast-message and thus the connection will never drop.

HeadSpace will stop sending the stream of tracking data if no update-message is received anymore and drop the registration of the client.
HeadSpace will stop sending the stream of tracking data if no update-message is received anymore and drop the registration of the client.

If no client is registered anymore, the server will again start sending the broadcast message every second.

Expand All @@ -79,7 +77,7 @@ If the server encounters a problem or stops, it will atempt to broadcast an exit
####transformation

> **/ks/server/calib/trans** \<serverID> \<x-rotate[deg]> \<y-rotate[deg]> \<z-translate[m]>
>
>
with this info the kinect transformation matrix in relation to the floor can be calcualted like this (example code for openframeworks):

Expand All @@ -94,7 +92,7 @@ The transformation matrix is mainly used to correctly transform the frustum and
####kinects frustum:

> **/ks/server/calib/frustum** \<serverID> \<left[m]> \<right[m]> \<bottom[m]> \<top[m]> \<near[m]> \<far[m]>
>
>
the frustum needs to translated by the above transformation matrix to be in the correct space

Expand All @@ -108,7 +106,7 @@ the frustum needs to translated by the above transformation matrix to be in the
####gaze:

> **/ks/server/calib/gazepoint** \<serverID> \<gazePosX[m]> \<gazePosY[m]> \<gazePosZ[m]>
>
>


Expand All @@ -134,61 +132,90 @@ the message is sent each time at the beginning of a new frame. 'sendBodyBlob', '
####head

> **/ks/server/track/head** \<serverID> \<frameNo> \<blobID> \<sortPos> \<headTopPosX[m]> \<headTopPosY[m]> \<headTopPosZ[m]> \<headCenterPosX[m] \<headCenterPosY[m] \<headCenterPosZ[m]>
>
>
---
####eye

> **/ks/server/track/eye** \<serverID> \<frameNo> \<blobID> \<sortPos> \<eyePosX[m]> \<eyePosY[m]> \<eyePosZ[m]> \<eyeGazeX> \<eyeGazeY> \<eyeGazeZ>
>
>
eyeGazeX, Y, Z is a normalized vector. Beware: The gaze is calculated based on a defined gaze-point and not through facial feature tracking. It assumes that each tracked person looks at this gaze-point.

---
####framedone

> **/ks/server/track/framedone** \<serverID> \<frameNo>
>
>
the last message sent for the current frame.

---

## Download

To grab a copy of HeadSpace for your platform, check here [download page](http://github.com/tecartlab/HeadSpaceRS/releases).

The `master` branch of this repository corresponds to the most recent release. This GitHub repository contains code and libs for all the platforms.

## Building
## Dependecies

* Openframeworks release [0.11.0](http://openframeworks.cc/download).
* Openframeworks addon ofxGui
* Openframeworks addon [ofxRealSenseTwo](https://github.com/tecartlab/ofxRealSenseTwo)
* Openframeworks addon [ofxGuiExtended](https://github.com/frauzufall/ofxGuiExtended)

### Windows
* Microsoft Visual Studio Community edition 2017 https://visualstudio.microsoft.com/de/downloads/

### Dependecies
### OSX
* XCode 11.3

Microsoft Visual Studio Community edition 2017 https://visualstudio.microsoft.com/de/downloads/
Intel® RealSense™ SDK 2.0 (build 2.16.0) https://github.com/IntelRealSense/librealsense
Openframeworks release 0.10.0 [download page](http://openframeworks.cc/download).
Openframeworks addon [ofxRSSDK](https://github.com/tecartlab/ofxRSSDK)
Openframeworks addon [ofxGuiExtended](https://github.com/frauzufall/ofxGuiExtended)

## Installation

* Clone/unzip this repo into the **\<openframeworks>/apps/myApps/** folder.
* BE AWARE: This repo is [using LFS](https://www.atlassian.com/git/tutorials/git-lfs) for its binary libraries..

### Instructions

drop this repositoriy into the \<openframeworksfolder>/apps/\<yourappfolder>
Use project generator to create the Visual Studio and XCode project files by pressing 'import' and navigate to this addons example folder. press 'update'.

drop the addons into the \<openframeworksfolder>/addons/ folder
#### Windows exe

#### Visual Studio
Examles require to be linked to the installed RealSense SDK. All the examples assume the SDK is installed under C:\Program Files(x86)\Intel RealSense SDK 2.0
1. open Visual Studio project.
2. copy from
* /addons/ofxRealSenseTwo/libs/IntelRealSense_2.xx.x/lib/vs/x64/Intel.Realsense.dll
* /addons/ofxRealSenseTwo/libs/IntelRealSense_2.xx.x/lib/vs/x64/realsense2.dll
* /addons/ofxRealSenseTwo/libs/IntelRealSense_2.xx.x/lib/vs/x64/realsense2.lib

if otherwise, change the following:
into the **bin** folder.

* Menu > Project > Properties > C/C++ > General > Additional Include directories > (Edit...) > (RSSKD_Dir)\include
* Menu > Project > Properties > Linker > General > Additional Library directories > (Edit...) > (RSSKD_Dir)\lib\x64
3. choose solution platform **x64** and build the app. (only libraries for x64 are provided with ofxRealSenseTwo)

#### OSX app

1. open XCode project.
2. If you desire the create a standalone app you have to make the following changes to the XCode project:
1. select the project inside the project navigator
2. select tab **Build Phases**
3. press **+** and select 'New Run script phase'
4. copy paste the following code:
```
cp -r $OF_PATH/addons/ofxRealSenseTwo/libs/IntelRealSense_2.33.1/lib/osx/ $TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/
cd $TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/
install_name_tool -change @rpath/librealsense2.2.33.dylib @executable_path/librealsense2.2.33.dylib $PRODUCT_NAME
```
into the little editor of the new phase.
5. switch active scheme to Release.
6. run build.
7. the created app should have now have the needed realsense library inside the bundle.
## How to
to come...
## Version
HeadSpace uses [Semantic Versioning](http://semver.org/),
HeadSpace uses [Semantic Versioning](http://semver.org/),
Version 0.0.2
- update to new ofxRealSenseTwo
Version 0.0.1
- initial release
Expand All @@ -202,4 +229,4 @@ created by Martin Froehlich for [tecartlab.com](http://tecartlab.com)
loosely based on a concept by Andrew Sempre and his [performance-space](https://bitbucket.org/tezcatlipoca/performance-space)
##Licence
MIT and see license.md
MIT and see license.md
87 changes: 0 additions & 87 deletions addon_config.mk

This file was deleted.

2 changes: 1 addition & 1 deletion addons.make
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ofxGuiExtended
ofxNetwork
ofxOpenCv
ofxOsc
ofxRSSDK
ofxRealSenseTwo
Binary file removed bin/Intel.Realsense.dll
Binary file not shown.
Binary file removed bin/realsense2.dll
Binary file not shown.
8 changes: 0 additions & 8 deletions icon.rc

This file was deleted.

2 changes: 1 addition & 1 deletion src/TrackingNetworkManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class TrackingNetworkManager {

string getOscMsgAsString(ofxOscMessage m);

vector<string> TrackingNetworkManager::matchesInRegex(string _str, string _reg);
vector<string> matchesInRegex(string _str, string _reg);

vector<string> localIpAddresses;

Expand Down
2 changes: 1 addition & 1 deletion src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void ofApp::update(){
ofBackground(100, 100, 100);

// there is a new frame and we are connected
if(realSense->update(ofxRSSDK::PointCloud::INFRALEFT)) {
if(realSense->update(ofxRealSenseTwo::PointCloud::INFRALEFT)) {

if(bUpdateMeasurment){
measurementCycleRaw();
Expand Down
4 changes: 2 additions & 2 deletions src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Frustum.h"
#include "CaptureMeshArray.h"

#include "ofxRSSDKv2.h"
#include "ofxRealSenseTwo.h"
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API

#include <ofMatrix4x4.h>
Expand All @@ -31,7 +31,7 @@
#define N_MEASURMENT_CYCLES 10

using namespace std;
using namespace ofxRSSDK;
using namespace ofxRealSenseTwo;

//helpfull links during development:
// https://github.com/openframeworks/openFrameworks/issues/3817
Expand Down

0 comments on commit 09dd419

Please sign in to comment.