Get more detailed explination of failed expectation in Olympe?

Hello team,

I am using Olympe with a simulated Anafi AI in Sphinx. I am wondering how I can better understand when an expectation I send to the drone is failing.

I know that I can use expectation.explain() to get a string that is colored in red where the failing occured. But for example, when I try to change camera2 configuration, my expectation fails if I try to set the photo_mode to enums.camera2.PhotMode.time_lapse. It works when I set it to single though. I don’t understand why the TIME_LAPSE setting is not accepted.

More generally, is there a way to get detailed explanation of why an expectation did fail ?

Hi @elibenjel,

Sorry for the delay. It’s not easy to change the configuration of camera2. The olympe example photo2 is a good start if you want to change the configuration. For example, this config works:

drone(
        Command.Configure(
            camera_id=0,
            config=Config(
                camera_mode="photo",
                photo_mode="time_lapse",
                photo_time_lapse_interval=5.0,
                photo_file_format="jpeg",
                photo_dynamic_range="standard",
                photo_resolution="12_mega_pixels",
                photo_format=("rectilinear"),
                photo_signature="none"
            ),
            _timeout=3.0,
        )
    ).wait()

We can examine your configuration if you need help.

Regards,
Axel

Thank you @Axelm, this config worked.

Is it possible to also set the photo_resolution to 48MP ?

Hi @elibenjel,

Yes, it’s possible. Set the photo_resolution paramater to:

drone(
        Command.Configure(
            camera_id=0,
            config=Config(
                ...
                photo_resolution="48_mega_pixels",
                ...
            ),
            _timeout=3.0,
        )
    ).wait()

Regards,
Axel

Note that setting the photo resolution at runtime will only work with a real drone. With sphinx, it will have no effect (see Shortcomings and limitations - 2.15.1).

This topic was automatically closed after 38 days. New replies are no longer allowed.