How to use the mavsdk.generated.camera.CameraError function in mavsdk

To help you get started, we’ve selected a few mavsdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.SetSettingRequest()
        
        setting.translate_to_rpc(request.setting)
                
            
        response = await self._stub.SetSetting(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "set_setting()", setting)
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Take one photo.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.TakePhotoRequest()
        response = await self._stub.TakePhoto(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "take_photo()")
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Start video streaming.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StartVideoStreamingRequest()
        response = await self._stub.StartVideoStreaming(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "start_video_streaming()")
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StartPhotoIntervalRequest()
        request.interval_s = interval_s
        response = await self._stub.StartPhotoInterval(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "start_photo_interval()", interval_s)
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Start a video recording.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StartVideoRequest()
        response = await self._stub.StartVideo(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "start_video()")
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.SetModeRequest()
        
        camera_mode.translate_to_rpc(request.camera_mode)
                
            
        response = await self._stub.SetMode(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "set_mode()", camera_mode)
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Stop current video streaming.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StopVideoStreamingRequest()
        response = await self._stub.StopVideoStreaming(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "stop_video_streaming()")
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Stop a running photo timelapse.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StopPhotoIntervalRequest()
        response = await self._stub.StopPhotoInterval(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "stop_photo_interval()")
github mavlink / MAVSDK-Python / mavsdk / generated / camera.py View on Github external
Stop a running video recording.

         Raises
         ------
         CameraError
             If the request fails. The error contains the reason for the failure.
        """

        request = camera_pb2.StopVideoRequest()
        response = await self._stub.StopVideo(request)

        
        result = self._extract_result(response)

        if result.result is not CameraResult.Result.SUCCESS:
            raise CameraError(result, "stop_video()")