Interface ReturnHomePilotingItf

    • Method Detail

      • activate

        boolean activate()
        Activates this piloting interface.

        If successful, the currently active piloting interface (if any) is deactivated and this one is activated.

        Returns:
        true on success, false in case the piloting interface cannot be activated at this point
      • getHomeLocation

        @Nullable
        Location getHomeLocation()
        Gets the current home location.

        The location altitude is relative to the take off point.

        Returns:
        the current home location, or null if unknown presently.
      • gpsWasFixedOnTakeOff

        boolean gpsWasFixedOnTakeOff()
        Tells whether first GPS fix was obtained before or after take-off.

        When Target.TAKE_OFF_POSITION is selected, in case the first fix was obtained after take-off, the drone will return at this first fix position, which may be different from the take-off position.

        Note that the returned value MUST ONLY be considered relevant when the current target is Target.TAKE_OFF_POSITION. Returned value is undefined in other modes.

        Returns:
        true if GPS was fixed before taking off, false otherwise.
        See Also:
        getCurrentTarget()
      • getPreferredTarget

        @NonNull
        EnumSetting<ReturnHomePilotingItf.Target> getPreferredTarget()
        Gets the return home target user setting.

        This setting allows the user to select whether the drone should return to its take-off position ot to the current pilot position.

        Note that this should be considered only as a preference. In any case, if the requirement are not met to honor the selected preferred target, the drone may ignore that setting and chose a different target instead.

        Returns:
        the preferred target setting
        See Also:
        getCurrentTarget()
      • getEndingBehavior

        @NonNull
        EnumSetting<ReturnHomePilotingItf.EndingBehavior> getEndingBehavior()
        Gets the return home ending behavior setting.

        This setting allows the user to select whether the drone should land or stay hovering after returning home.

        Returns:
        the ending behavior
      • getAutoStartOnDisconnectDelay

        @NonNull
        IntSetting getAutoStartOnDisconnectDelay()
        Gets the return home automatic activation upon disconnection delay setting (value in seconds).

        This setting allows the user to setup the delay the drone will wait before activating return home, when the connection with the controller is lost.

        Returns:
        the delay setting
      • getEndingHoveringAltitude

        @NonNull
        OptionalDoubleSetting getEndingHoveringAltitude()
        Gets the return home ending hovering altitude setting, above ground level, in meters.

        This setting is used only if ending behavior is set to HOVERING.

        Returns:
        the hovering altitude setting
      • getMinAltitude

        @NonNull
        OptionalDoubleSetting getMinAltitude()
        Gets the return home minimum altitude setting, relative to the take off point, in meters.

        If the drone is below this altitude when starting its return home, it will first reach the minimum altitude. If the drone is higher than this minimum altitude, it will operate its return home at its current altitude.

        Returns:
        the minimum altitude setting.
      • getHomeReachability

        @NonNull
        ReturnHomePilotingItf.Reachability getHomeReachability()
        Gets an estimation of the possibility for the drone to reach its return point.
        Returns:
        return point reachability
      • getAutoTriggerDelay

        long getAutoTriggerDelay()
        Gets delay before an automatic return home planned by the drone.

        The delay is calculated so that the return travel can be made before the battery is empty.

        The returned delay is not valid when reachability returned by getHomeReachability() is ReturnHomePilotingItf.Reachability.WARNING. In the other cases, the returned delay is zero.

        Returns:
        delay in seconds before return home if an automatic return home is planned, zero otherwise
      • autoTrigger

        @NonNull
        BooleanSetting autoTrigger()
        Gets the return home auto trigger setting.

        This setting allows the user to enable or disable the automatic trigger of a return to home.

        Note that even if this setting is set to false, the user can ask for a manual return to home.

        Returns:
        the auto trigger switch setting
      • setCustomLocation

        void setCustomLocation​(double latitude,
                               double longitude,
                               double altitude)
        Sets the custom home location.

        This location is used only if current target is on CUSTOM_LOCATION.

        Parameters:
        latitude - latitude of the custom location
        longitude - longitude of the custom location
        altitude - altitude of the custom location, relative to the take off point