How to use the mavsdk.generated.action.ActionError 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 / action.py View on Github external
Raises
         ------
         ActionError
             If the request fails. The error contains the reason for the failure.
        """

        request = action_pb2.SetReturnToLaunchAltitudeRequest()
        request.relative_altitude_m = relative_altitude_m
        response = await self._stub.SetReturnToLaunchAltitude(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "set_return_to_launch_altitude()", relative_altitude_m)
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
This switches the drone to 'Land' flight mode.

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

        request = action_pb2.LandRequest()
        response = await self._stub.Land(request)

        
        result = self._extract_result(response)

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

        request = action_pb2.SetTakeoffAltitudeRequest()
        request.altitude = altitude
        response = await self._stub.SetTakeoffAltitude(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "set_takeoff_altitude()", altitude)
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
reject the disarm command. Disarming means that all motors will stop.

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

        request = action_pb2.DisarmRequest()
        response = await self._stub.Disarm(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "disarm()")
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
This will reboot the autopilot, companion computer, camera and gimbal.

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

        request = action_pb2.RebootRequest()
        response = await self._stub.Reboot(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "reboot()")
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
is already in multicopter mode.

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

        request = action_pb2.TransitionToMulticopterRequest()
        response = await self._stub.TransitionToMulticopter(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "transition_to_multicopter()")
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
back to the launch (takeoff) position and land there.

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

        request = action_pb2.ReturnToLaunchRequest()
        response = await self._stub.ReturnToLaunch(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "return_to_launch()")
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
Before arming take all safety precautions and stand clear of the drone!

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

        request = action_pb2.ArmRequest()
        response = await self._stub.Arm(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "arm()")
github mavlink / MAVSDK-Python / mavsdk / generated / action.py View on Github external
Note that the vehicle must be armed before it can take off.

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

        request = action_pb2.TakeoffRequest()
        response = await self._stub.Takeoff(request)

        
        result = self._extract_result(response)

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

        request = action_pb2.SetMaximumSpeedRequest()
        request.speed = speed
        response = await self._stub.SetMaximumSpeed(request)

        
        result = self._extract_result(response)

        if result.result is not ActionResult.Result.SUCCESS:
            raise ActionError(result, "set_maximum_speed()", speed)