Getting started
Take your first steps with the Teslasuit C# SDK — from referencing the library to running your first haptic interaction.
Requirements#
| Requirement | Version |
|---|---|
| Teslasuit hardware | v. 4.5+ |
| Teslasuit SDK | 2.5.1+ |
| .NET | .NET Framework 4.7.2+ or .NET 6+ on Windows |
| Language | C# 7.3+ |
Reference the SDK#
1. Get the assemblies and native library#
The SDK ships with Teslasuit Studio, so make sure it is installed and on the desired target version. Studio provides the managed assemblies (TsSDK and TsApi) alongside the native teslasuit_api.dll that they wrap. A typical install location is C:\Program Files\Teslasuit\Studio.
Add references to TsSDK.dll and TsApi.dll in your project, then bring the namespaces into scope:
using TsSDK;
using TsAPI;
using TsAPI.Types;2. Let the SDK resolve the native library#
The managed assemblies load the native teslasuit_api.dll at runtime. Studio normally registers its install directory so the library resolves automatically. If it does not, call TsRoot.InitSDKInstallation once before you create anything else. It configures the installation path and adds the native library directory to the process search path:
TsRoot.InitSDKInstallation();The TsRoot constructor also calls this for you, so an explicit call is only needed when the library cannot be found by the usual means.
Note: Only one TsRoot instance may exist during the program lifecycle. Creating a second one will throw an error. Dispose of it when you are done so the native resources are released.
Connect to a device#
Device connection is managed by Teslasuit Control Center (CC), not by your C# program. The SDK can only reach a device that is already connected and active in Control Center — there is no way to initiate or maintain a connection from code alone.
Before running any C# program:
- Open Teslasuit Control Center.
- Connect your device and wait for it to appear as active.
- Complete the calibration procedure in Control Center. Subsystems such as haptic and mocap will not produce correct output on an uncalibrated device.
Once the device is connected and calibrated in Control Center, the SDK can discover it. Create a TsRoot, then read connected devices from the device manager:
using System.Linq;
using System.Threading;
using TsSDK;
TsRoot.InitSDKInstallation();
using var tsRoot = new TsRoot();
// Poll until a device is attached (Control Center owns the connection).
IDevice device = null;
while (device == null)
{
device = tsRoot.DeviceManager.Devices.FirstOrDefault();
Thread.Sleep(100);
}
// ... use device with the haptic / mocap / biometry APIs ...The manager also raises OnDeviceConnected and OnDeviceDisconnected events. Those events fire from a background thread, so marshal to your UI or main thread before touching shared state. If you only want one product type, SuitManager and GloveManager expose the connected suits and gloves separately.
Access a subsystem#
Every subsystem hangs off the IDevice interface as a property. Read the property, then call methods on it:
device.HapticPlayer.Stop(); // haptic
device.Mocap.Start(); // mocap
device.Biometry.Ppg.Start(); // biometry (PPG)Next#
Once you have a connected device, here is a suggested reading flow through the rest of the documentation.
1. Run something end-to-end — Examples#
Get a feel for the API by running a complete, minimal program on real hardware:
- Examples · Overview — every runnable example, grouped by subsystem.
- Play a haptic touch — play your first touch on the suit.
- Read heart rate — read live heart rate from a PPG node.
- Stream motion data — stream skeleton data and biomechanical angles.
2. Understand what you just ran — Main concepts#
Each subsystem has a concept page that explains what it senses or does, and the vocabulary the rest of the reference assumes:
- Main concepts · Overview — a map of the XR5 subsystems with a per-topic reading list.
- Haptics & EMS — programmable electrical stimulation.
- Mocap — full-body motion capture.
- PPG — optical heart-rate sensing.
- Body & channel map — a Python-first interactive tool showing how bones resolve to physical channels. Conceptually the same resolution the C# mapping interface performs.
3. Look things up — API reference#
When you know what you want to build, the reference covers the SDK interface by interface. It is split into two layers:
API · Core — the layer above subsystems (connecting devices, mapping, shared types):
- TsRoot & subsystems — the entry point and base subsystem interface.
- Devices — discover suits, gloves, and generic devices.
- Mapping — resolve a bone to its physical channels.
- Assets — load and manage haptic assets.
- Common types — the structs and enums used across every module.
API · Subsystems — one interface per device capability:
- Haptic — create, play, and control haptic touches and playables.
- Mocap — skeleton, raw IMU, and biomechanical data.
- Biometry — PPG heart-rate sensing.
- Force feedback — per-finger resistance on the glove.
