DepthProviderManager: AstraProPerseeDepthProvider can’t create RGB Stream (VideoCapture device ID is not valid)
DepthProviderManager: Couldn’t open device ( DeviceOpen using default: no devices found
)
DepthProviderManager: Can not create OpenNI depth generator (OpenNI Status: Can’t create any node of the requested type!)
I also see that the sensor starts working.
But the “onDepthSensorUpdate” function is never called. ( I see that through breakpoint in the function)
Ok so after some more digging I think it´s somehow related to the fact that I´m using a C# WPF Project.
the code below compiles and starts the sensor but it never calls “onDepthSensorUpdate” the Eventhandler
using System;
using System.Windows;
using System.Runtime.InteropServices;
using System.Threading;
using nuitrack;
using nuitrack.issues;
namespace NuitrackTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private DepthSensor _depthSensor;
private ColorSensor _colorSensor;
private UserTracker _userTracker;
private SkeletonTracker _skeletonTracker;
private GestureRecognizer _gestureRecognizer;
private HandTracker _handTracker;
private DepthFrame _depthFrame;
private SkeletonData _skeletonData;
private HandTrackerData _handTrackerData;
private IssuesData _issuesData = null;
public MainWindow()
{
//InitializeComponent();
//Sensor sx = new Sensor();
//sx.Start();
try
{
Nuitrack.Init("C:/nuitrack/data/nuitrack.config");
}
catch (nuitrack.Exception exception)
{
Console.WriteLine("Can not initialize Nuitrack. Exception: ", exception);
}
//Thread.Sleep(1000);
//// Create and setup all required modules
_depthSensor = DepthSensor.Create();
_depthSensor.SetMirror(false);
_colorSensor = ColorSensor.Create();
_userTracker = UserTracker.Create();
_skeletonTracker = SkeletonTracker.Create();
_handTracker = HandTracker.Create();
_gestureRecognizer = GestureRecognizer.Create();
// Add module event handlers
_depthSensor.OnUpdateEvent += onDepthSensorUpdate;
//_colorSensor.OnUpdateEvent += onColorSensorUpdate;
//_userTracker.OnUpdateEvent += onUserTrackerUpdate;
//_skeletonTracker.OnSkeletonUpdateEvent += onSkeletonUpdate;
//_handTracker.OnUpdateEvent += onHandTrackerUpdate;
//_gestureRecognizer.OnNewGesturesEvent += onNewGestures;
// Add an event handler for the IssueUpdate event
Nuitrack.onIssueUpdateEvent += onIssueDataUpdate;
// Create and configure the Bitmap object according to the depth sensor output mode
OutputMode mode = _depthSensor.GetOutputMode();
// Run Nuitrack. This starts sensor data processing.
try
{
Nuitrack.Run();
}
catch (nuitrack.Exception exception)
{
Console.WriteLine("Can not start Nuitrack. Exception: ", exception);
}
}
// Nuitrack depth sensor module data update callback
private void onDepthSensorUpdate(DepthFrame depthFrame)
{
_depthFrame = depthFrame;
}
private void onIssueDataUpdate(IssuesData issuesData)
{
_issuesData = issuesData;
}
}
}
You have to call Nuitrack.Update method in the main loop of your application. Please take a look at OnPaint method in nuitrack_csharp_sample.
Also, if you installed Nuitrack, you don’t have to specify the path to nuitrack.config file in Nuitrack.Init, otherwise you’ll have to modify nuitrack.config file. Therefore, please use Nuitrack.Init() for Nuitrack initialization.