Darp.Fairino 0.7.0

dotnet add package Darp.Fairino --version 0.7.0
                    
NuGet\Install-Package Darp.Fairino -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Darp.Fairino" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Darp.Fairino" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Darp.Fairino" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Darp.Fairino --version 0.7.0
                    
#r "nuget: Darp.Fairino, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Darp.Fairino@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Darp.Fairino&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Darp.Fairino&version=0.7.0
                    
Install as a Cake Tool

Darp.Fairino

Darp.Fairino is a modern async .NET SDK for Fairino robot controllers. It provides typed command helpers, realtime-state feedback, dependency injection registration, and a Result<..., FairinoError> failure model for controller and transport errors.

The SDK is developed and tested against Fairino robot software v3.9.5, which is also the minimum supported version.

Install

dotnet add package Darp.Fairino

The package currently targets net10.0.

Quick Start

using Darp.Fairino;
using Darp.Fairino.DependencyInjection;
using Darp.Results;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddFairinoRobot();

await using ServiceProvider provider = services.BuildServiceProvider();
await using FairinoRobot robot = provider.GetRequiredService<FairinoRobot>();

// The realtime states are fixed for the life of the connection; pass null for a command-only connection.
var realtimeStates = new FairinoRobotStateConfiguration(
    [FairinoRobotStates.JointCurPos, FairinoRobotStates.MotionDone],
    TimeSpan.FromMilliseconds(8));

Result<Success, FairinoError> connectResult = await robot.ConnectAsync("192.168.58.2", realtimeStates);
if (connectResult.TryGetError(out FairinoError? connectError))
{
    Console.WriteLine($"Connection failed: {connectError.Message}");
    return;
}

Result<SoftwareVersion, FairinoError> versionResult = await robot.GetSoftwareVersionAsync();
if (versionResult.TryGetValue(out SoftwareVersion version, out FairinoError? versionError))
{
    Console.WriteLine($"Robot model: {version.RobotModel}");
    Console.WriteLine($"Web version: {version.WebVersion}");
    Console.WriteLine($"Controller version: {version.ControllerVersion}");
}
else
{
    Console.WriteLine($"Version query failed: {versionError.Message}");
}

await robot.DisconnectAsync();

Only connect to a reachable controller on a trusted local network.

Geometry and units

Motion and kinematics methods use JointPos and Aardvark transforms:

Value Input Result Units
Six joint angles JointPos JointPos Radians
TCP, flange or offset pose Euclidean3d Euclidean3d Metres, quaternion rotation

The SDK follows Fairino's controller coordinate definitions. It converts to the controller's millimetres and degrees when sending commands and converts responses back. GetActualJointPosAsync replaces GetActualJointPosDegreeAsync. Optional pose offsets accept null for identity.

using Aardvark.Base;

var result = await robot.GetActualTcpPoseAsync();
if (result.TryGetValue(out Euclidean3d pose, out var error))
    Console.WriteLine($"TCP in metres: {pose.Trans}");

External-axis coordinates, force/torque records, scalar motion options and raw telemetry arrays retain their documented controller units.

Local kinematics

The package embeds a URDF for each supported robot model, for use with Darp.Kinematics. GetDhCompensationAsync reads the calibration of the connected robot, which converts to the DH offset table that Darp.Kinematics expects:

using Darp.Kinematics;

DhCompensation compensation = (await robot.GetDhCompensationAsync()).Unwrap();
IKinematics kinematics = SerialKinematics.ParseEmbeddedUrdf(
    typeof(FairinoRobot).Assembly,
    "Darp.Fairino.Models.fr5_v6.urdf",
    "base_link",
    "flange",
    compensation
);
Robot Resource Links
FR5 V6 Darp.Fairino.Models.fr5_v6.urdf base_link to flange

The local model calculates the pose of the flange. The controller calculates the pose of the active TCP, so multiply with GetTcpOffsetAsync to compare the two.

Configuration

FairinoRobotOptions holds the command timeout and the controller ports. Transport internals such as the reconnect policy are managed by the SDK.

services.AddFairinoRobot(options =>
{
    options.CommandTimeout = TimeSpan.FromSeconds(30);
    options.StatePort = 20005;
});

API Shape

The Fairino C# SDK manual can be used as a reference for available controller operations. In Darp.Fairino, methods are async and use an Async suffix.

Failure Model

SDK operations return operational failures as Result<..., FairinoError>. This includes robot error codes, network failures, protocol errors, timeouts, and not-connected states.

Caller cancellation throws OperationCanceledException, and invalid arguments throw the usual .NET argument exceptions.

Connection State

FairinoRobot.ConnectionState describes the realtime-state connection, which is the only persistent connection to the controller. A lost connection is recovered automatically until DisconnectAsync is called, and the realtime states passed to ConnectAsync are re-applied before the state returns to Connected. Changing the realtime states means disconnecting and connecting again.

using IDisposable subscription = robot
    .WhenConnectionStateChanged()
    .Subscribe(state => Console.WriteLine($"Robot connection: {state}"));

While the connection is being recovered, state reads fail with FairinoErrorMessages.NotConnected, and a state read that was already waiting fails with FairinoErrorMessages.ConnectionLost.

XML-RPC commands and UDP commands do not use this connection. They are neither rejected nor cancelled during a recovery, and a UDP command such as ServoJAsync still reports success. The SDK cannot tell a network interruption from a controller restart, so re-check the robot after a recovery and restart a servo session if one was active.

Build

dotnet restore Darp.Fairino.slnx
dotnet build Darp.Fairino.slnx --no-restore
dotnet pack src/Darp.Fairino/Darp.Fairino.csproj --no-build

License

This project is licensed under the Apache License 2.0. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 89 10/7/2026
0.6.1 99 9/27/2026
0.6.0 94 9/27/2026
0.5.0 102 9/24/2026
0.4.0 225 7/1/2026
0.3.0 174 5/25/2026
0.2.0 126 5/19/2026