title | author |
---|---|
VCP for C# Manual |
ryu-raptor |
- Build
- Sample
- Archtecture
- API Documentation
- WebSocket Documentation
- netstandard 2.0
- .NET Core (Note: You can choose other .NET systems which support netstandard 2.0.)
- sta/websocket-sharp
- Currently using chenzuo/WebSocketSharp.Standard
- System.Text.Json
Dependencies are written in VCP.csproj
, you don't need to manually install them.
% dotnet pack -c Release
NuGet package is placed as bin/Release/VCP.[Version].nupkg
.
- Using local NuGet packages.
% nuget add package [Your NuGet Package Path] -s [Local Repository Path (usually ./packages)]
% dotnet add [Your NuGet Package Name] -s [Local Repository Path (same as above)]
% dotnet build -c Release
% dotnet publish -c Release [Your Deploy Path]
using System;
var client = new VCP.WebSocket.SinkClient("ws://localhost:3000");
client.AddProcessor(new HeadPoseSink());
/* Here Main Loop */
class HeadPoseSink : VCP.WebSocket.APISink<VCP.API.HeadPose>
{
public override void OnMessage(VCP.API.HeadPose pose)
{
var rot = pose.Rotation;
Console.WriteLine($"({rot.Pitch}, {rot.Roll}, {rot.Yaw})");
}
}
using System;
var client = new SourceClient("ws://localhost:3000");
client.Send(new HeadPose() {
Rotation = new EularAngle() { Pitch = 3.1, Roll = 0, Yaw = 0.43 },
Position = new SpacialPosition() { X = 0, Y = 1, Z = 0 }
})
See VCP Specification.
Virtual Control Protocol root namespace
C# Native and JSON/MessagePack compatible API interfaces.
WebSocket interface
See source code in VCP.API
namespace.