How to take photo or streaming by thermal camera

Hi there, we are trying to take photo through thermal camera(anafi thermal), but it return
camera.photo_state(cam_id=1, available=‘not_available’, state=‘inactive’, list_flags=’’)
camera.photo_progress(cam_id=1, result=‘error_bad_state’, photo_count=0, media_id=’’, list_flags=’’)

here is my code snippet
import time
import olympe
import os
import subprocess
import tempfile
from olympe.media import (
media_created,
resource_created,
media_removed,
resource_removed,
resource_downloaded,
indexing_state,
delete_media,
download_media,
download_media_thumbnail,
MediaEvent,
)
from olympe.messages.camera import (
set_camera_mode,
set_photo_mode,
take_photo,
)
from logging import getLogger

olympe.log.update_config(
{
“loggers”: {
“olympe”: {“level”: “INFO”, “handlers”: [“console”]},
“urllib3”: {“level”: “DEBUG”, “handlers”: [“console”]},
name: {“level”: “DEBUG”, “handlers”: [“console”]},
}
}
)

logger = getLogger(name)

DRONE_IP = os.environ.get(“DRONE_IP”, “192.168.53.1”)
cameraId = 1

def setup_photo_burst_mode(drone):
drone(set_camera_mode(cam_id=cameraId, value=“photo”)).wait()
drone(
set_photo_mode(
cam_id=cameraId,
mode=“single”,
format=“rectilinear”,
file_format=“jpeg”,
burst=“burst_14_over_1s”,
# the following parameters are ignored in photo burst mode but we
# must provide valid values for them anyway
bracketing=“preset_1ev”,
capture_interval=5.0,
)
).wait()

def main(drone, media=None):
setup_photo_burst_mode(drone)
drone(take_photo(cam_id=cameraId)).wait()

def test_media():
drone = olympe.Drone(DRONE_IP)

with olympe.Drone(DRONE_IP) as drone:
    assert drone.connect(retry=5, timeout=60)
    main(drone)
    assert drone.disconnect()

if name == “main”:
test_media()
time.sleep(100)

actually,I just change the cam_id to thermal camera id, but it failed. Also, how to make the live stream to show the thermal camera stream? thanks!

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