hl2ss icon indicating copy to clipboard operation
hl2ss copied to clipboard

Better PV Extrinsics

Open nhahn opened this issue 10 months ago • 1 comments

For the PV calibration -- there is an alternative that can be used to get the extrinsics from the Research Mode Rignode to the PV camera. By taking the RM Rignode locator and then locating that in the PV coordinate system, we get the consistent, correct extrinsics. This code solves that problem, and could be included in the calibration information for the PV, rather than having to run the separate calibration script.

static void PV_OnVideoFrameArrived_Intrinsics(MediaFrameReader const& sender, MediaFrameArrivedEventArgs const& args)
.....  
 GUID nodeId = ResearchMode_GetRigNodeId();
 SpatialLocator g_locator = SpatialGraphInteropPreview::CreateLocatorForNode(nodeId);
 int64_t timestamp = frame.SystemRelativeTime().Value().count();
 float4x4 extrinsics = Locator_Locate(QPCTimestampToPerceptionTimestamp(timestamp), Locator_GetLocator(), frame.CoordinateSystem());

Thanks for the great library!

nhahn avatar Apr 09 '24 14:04 nhahn

That is very cool. Thanks for sharing.

jdibenes avatar Apr 15 '24 21:04 jdibenes