Skip to content

Extracting HL2 Hand Pose Data from PSI Server and Sending to Python Over TCP #338

@sakibreza

Description

@sakibreza

I have successfully used the PSI documentation to capture RGB frame data from the HoloLens 2 and send it to a Python server over TCP. The approach works well, where I convert the RGB frame data into bytes and transmit it.

Now, I’m attempting to do the same for hand pose data. Specifically, I am trying to extract hand joint coordinates from PSI and send them over TCP to my Python server, but I’m facing difficulty. I’m looking for an equivalent method to the following, which I used for extracting RGB frames:

imageViewer = new ImageViewer(captureServerPipeline, $"Image Viewer: {title}", false);
stream.PipeTo(imageViewer, DeliveryPolicy.LatestMessage);

var webcamBytes =
    stream
        .Sample(TimeSpan.FromMilliseconds(200))
        .EncodeJpeg(90, DeliveryPolicy.LatestMessage)
        .Select(jpg => jpg.Resource.GetBuffer());

var frameWriter = new NetMQWriter<byte[]>(
    captureServerPipeline,
    "frames",
    "tcp://127.0.0.1:30000",
    MessagePackFormat.Instance);
webcamBytes.PipeTo(frameWriter);

N.B.: To make the RGB frame capture work, I modified the code at L449 in HoloLensCaptureServer.cs , and it successfully started sending RGB frames to the server.

This works for capturing the RGB frames. However, I am unable to figure out how to extract the actual hand pose data (specifically the joint coordinates) from PSI. I’ve tried using the Microsoft.Psi.MixedReality.StereoKit.HandsSensor class, but I couldn’t find a way to access the joint coordinates.

Could you please guide me on how to extract the hand pose data from PSI, similar to how I am extracting RGB frames? Any pointers or code examples would be greatly appreciated.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions