Skip to content

T265: How to Set Exposure Mode Before Starting the Pipeline #5182

@JBBee

Description

@JBBee

Required Info
Camera Model T265
Firmware Version 0.2.0.857
Operating System & Version Win10
Kernel Version (Linux Only)
Platform PC
SDK Version 2.30.0
Language C#
Segment AR

Issue Description

I have a question about how to set an option on a sensor when using the pipeline interface prior to starting the pipeline. For example the following code throws the exception: To control exposure you must set sensor to manual exposure mode prior to streaming on the line ps2.Options[Option.Exposure].Value = 16000; How do I set the sensor to manual exposure mode before starting the pipeline?

   static void Main(string[] args)
    {
        using (var ctx = new Context())
        {
            var devices = ctx.QueryDevices();
            if (devices.Count == 0) return;
            var dev = devices[0]; //T265

            var poseSensor = dev.QuerySensors<Sensor>().First(s => s.Is(Extension.PoseSensor));
            var ps = PoseSensor.FromSensor(poseSensor);
            ps.Options[Option.EnableAutoExposure].Value = 0;

            var pipeline = new Pipeline(ctx);
            var pp = pipeline.Start(f => { using (f) { Console.WriteLine("Got Frame"); } });

            var poseSensor2 = pp.Device.QuerySensors<Sensor>().First(s => s.Is(Extension.PoseSensor));
            var ps2 = PoseSensor.FromSensor(poseSensor2);

            ps2.Options[Option.Exposure].Value = 16000;
            ps2.Options[Option.Gain].Value = 1.4f;

            AutoResetEvent stopEvent = new AutoResetEvent(false);
            Console.CancelKeyPress += (s, e) =>
            {
                e.Cancel = true;
                stopEvent.Set();
            };
            stopEvent.WaitOne();

            pipeline.Stop();
            Thread.Sleep(1000);
        }
        System.Console.WriteLine("Done");
    }

Thanks.

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