open_camera_stream()
  • 1 Minute to read

open_camera_stream()


Article summary

This command opens a camera windows on the fleet manager so it can be rotated and see a streaming of the camera selected.

Reference

Argument

ArgumentsTypeDefault valueDescription
titlestrTitle of the window
button_ok_txtstrText of the ok button
subtitlestr''Subtitle of the window
default_camerastr''Name of the camera to show
button_cancel_txtstr''Text of the cancel button

Return

Dict

Exceptions

  • TypeError

See the complete list of fleet exceptions

Usage Example

from raya.application_base import RayaApplicationBase
from raya.controllers.fleet_controller import FleetController
from raya.enumerations import *


class RayaApplication(RayaApplicationBase):

    async def setup(self):
        self.fleet: FleetController = await self.enable_controller('fleet')
        await self.fleet.update_app_status(
                status=FLEET_UPDATE_STATUS.INFO,
                message='setup ok'
            )

    async def loop(self):
        response = await self.fleet.open_camera_stream(
            title='stream from camera',
            button_ok_txt='Ok',
            default_camera='nav_bottom'
        )
        self.log.info(f'open_camera_stream response: {response}')
        self.finish_app()

    async def finish(self):
        await self.fleet.finish_task(
            result=FLEET_FINISH_STATUS.SUCCESS,
            message='finish ok'
        )

Once the task is executed you should see this on the fleet manager
image.png

In case that the user clicks ok i will send that response to the app, in our example it will show the respose

(INFO) open_camera_stream response: {'data': 'Ok'}

Was this article helpful?

What's Next