| Required Info |
|
|---|
| Camera Model |
T265 |
| Firmware Version |
0.2.0.879 |
| Operating System & Version |
Win10 |
| Kernel Version (Linux Only) |
|
| Platform |
PC |
| SDK Version |
2.31.0 |
| Language |
C# |
| Segment |
AR |
Issue Description
I'm experiencing a crash when using the C# wrapper in the development branch (2.31.0). The following code causes a crash:
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
using (var ctx = new Context())
{
var devices = ctx.QueryDevices();
if (devices.Count == 0) return;
var dev = devices[0]; //T265
using (var sensor = dev.QuerySensors().First(s => s.Is(Extension.PoseSensor)))
using (var poseSensor = PoseSensor.FromSensor(sensor)) ;
}
System.Console.WriteLine("Done");
}
}
}
There appears to be one call to NativeMethods.rs2_create_sensor in SensorList but two calls to NativeMethods.rs2_delete_sensor each when the sensor and the poseSensor above are disposed.
Previously SensorList was generic so I could call QuerySensors() with the PoseSensor type directly but this was changed in #5170
How do I now get a PoseSensor from a device?
Thanks.
Issue Description
I'm experiencing a crash when using the C# wrapper in the development branch (2.31.0). The following code causes a crash:
There appears to be one call to
NativeMethods.rs2_create_sensorinSensorListbut two calls toNativeMethods.rs2_delete_sensoreach when thesensorand theposeSensorabove are disposed.Previously
SensorListwas generic so I could callQuerySensors()with thePoseSensortype directly but this was changed in #5170How do I now get a PoseSensor from a device?
Thanks.