ReFlex Logo
ReFlex (Title)
Documentation
Navigation

ReFlex.TrackingServer

Platform-independent server application using ASP.NET Core as backend and Angular as frontend. Replaces the legacy ServerWPF app.

Table of Contents

  1. Table of Contents
  2. Installation and start
  3. Sensors
  4. .NET Testing
  5. Backend Logging
  6. SignalR Hubs
  7. Insomnia
  8. Development certificates
  9. Developing Angular ClientApp
  10. Electron Desktop app
  11. Azure Kinect Build issues
  12. Depth Camera issues
  13. Known Issues

Installation and start

  1. Option: (Debugging in Visual Studio)

    • Start “TrackingServer” in Visual Studio (for running backend)
    • launch Chrome launch config for Angular debugging
  2. Option (Debugging in Visual Studio Code):

    • prerequisite: app must be build beforehand in Visual Studio
    • launch Core & Chrome launch config

⬆ back to top


Sensors

By default, sensors and associated libraries are NOT included in the build configuration.

To Build Sensors, use the following Constants in the TrackingServer.csproj Project file:

Constant included sensors / projects
MS_AZURE_KINECT Sensor\AzureKinectModule (Microsoft Azure Kinect)
MS_KINECT2 Sensor\Kinect2Module (Microsoft Kinect2)
INTEL_REALSENSE Sensor\RealSenseL515Module (Intel RealSense L515)
  Sensor\RealSenseR2Module (Intel RealSense R2)
  Sensor\RealSenseR435Module (Intel RealSense R435)

The constants should be added in the associated Config section, e.g.:

    <PropertyGroup Condition=" '$(Platform)' == 'x64' Or '$(Platform)' == 'AnyCPU'">
    <PlatformTarget>x64</PlatformTarget>
      <DefineConstants>TRACE;MS_AZURE_KINECT;INTEL_REALSENSE</DefineConstants>
  </PropertyGroup>

.NET Testing

For more options, refer to Online Configuration Tool for Report Generator

Alternative, using tool dotnet-coverage (only on Windows)

Backend Logging

{
  "logger": "Microsoft.*",
  "maxLevel": "Debug",
  "final": true
}

SignalR Hubs

For sending status information and updates as well as data like point cloud, there are SignalR-Hubs available in the backend:

Service Mapping Methods Description
TrackingHub /trkhub startState/stopState current status of sensor
NetworkHub /nethub startState/stopState current status of network broadcast
PointCloudHub /pointcloudhub startState/stopState whether pointcloud is active or not
    startPointCloud/stopPointCloud receive point cloud data
TuioHub /tuiohub startState/stopState whether tuioservice is sending or not
    startPackageDetails/stopPackageDetails receive tuio packages (as string)
PerformanceHub /perfhub startState/stopState whether performance data is collected or not
    startCollectingData/stopCollectingData receive performance data
CalibrationHub /calibhub startState/stopState whether a valid calibration has been set or not
    startCalibrationSubscription/sttopCalibrationSubscription receive calibration updates
ProcessingHub /prochub startState/stopState whether ainteraction processing is active or not
    startInteractions/stopInteractions receive interactions
    startInteractionFrames/stopInteractionFrames receive interaction frames
    startInteractionHistory/stopInteractionHistory receive interaction history

Insomnia

HTTP-Requests, Websocket communication and gRPC communication can be tested using Insomnia. The request provided by the ASP.NET backend are exported as workspace and can be found in Insomnia Workspace Export.

For testing SignalR, Insomnia offers the feature of chained Requests Documentation, therefore it is not necessary to copy the response values in the address bar. Just sending the requests in the correct order should be sufficient. The current Workspace provides three methods:

Development certificates

To do this, run the following command in an elevated command prompt / powershell / etc…

  dotnet dev-certs https --trust

if there are other certificates already installed, these can be removed by the following commands:

  dotnet dev-certs https --clean

Subsequently, it should be possible to install the certificates with the commands stated above.

However, if these commands don’t work, it is also possible to globally install the dev certs:

  dotnet tool uninstall --global dotnet-dev-certs
  dotnet tool install --global dotnet-dev-certs

⬆ back to top


Developing Angular ClientApp


  ng g c myComponent --module app # creates myComponent in open source mono repo for ReFlex.TrackingServer/ClientApp/src/app

⬆ back to top


Electron Desktop app

Prerequisites

Building the App

By default, no sensors are included in the Build, you can add sensor Support by setting the appropriate flags with adding /p:DefineAdditionalConstants=MS_AZURE_KINECT%2CMS_KINECT2%2CINTEL_REALSENSE as parameter (use %2C as separator for specifying multiple flags) (see also Sensors)

Remarks

⬆ back to top


Azure Kinect Build issues

AzureKinect nuget Package contains a platform check based on Visual Studio Environment variables that stops VS Code from build (because the env-vars are not defined in VSCode).

C:\Users\...\.nuget\packages\microsoft.azure.kinect.sensor\1.4.1\build\netstandard2.0\Microsoft.Azure.Kinect.Sensor.targets(4,5): error : Azure Kinect only supports the x86/x64 platform ('AnyCPU' not supported)

If that’s the case, open the file targets file of the package and remove the check:


  <!-- remove the complete element -->
  <Target Name="EnsureAzureKinectPlatform" BeforeTargets="PrepareForBuild">
    <Error Condition="'$(Platform)' != 'x64' AND '$(Platform)' != 'x86' AND '$(OutputType)'!='Library'" Text="Azure Kinect only supports the x86/x64 platform ('$(Platform)' not supported)" />
  </Target>

refer to GitHub issue

⬆ back to top


Depth Camera issues

⬆ back to top


Known Issues

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- <Target Name="EnsureAzureKinectPlatform" BeforeTargets="PrepareForBuild">
    <Error Condition="'$(Platform)' != 'x64' AND '$(Platform)' != 'x86'" Text="Azure Kinect only supports the x86/x64 platform ('$(Platform)' not supported)" />
  </Target> -->

⬆ back to top