GSGuidedPilotingItf
@objc
public protocol GSGuidedPilotingItf : ActivablePilotingItf, PilotingItf
Guided piloting interface.
Note
This protocol is for Objective-C only. Swift must use the protocolGuidedPilotingItf
.
-
Starts a guided flight. Moves the drone according to the specified movement directive
This interface will change to
active
when the drone starts, and then toidle
when the drone reaches its destination or is stopped. It also becomesidle
in case of error.If this method is called while the previous guided flight is still in progress, it will be stopped immediately and the new guided flight is started.
In case of drone disconnection, the guided flight is interrupted.
Declaration
Swift
func move(directive: GuidedDirective)
Parameters
directive
movement directive
-
Current guided flight directive if there’s a guided flight in progress,
nil
otherwise.It can be either a
LocationDirective
or aRelativeMoveDirective
. The flight parameters have the values returned by the drone.Declaration
Swift
var currentDirective: GuidedDirective? { get }
-
Latest terminated guided flight information if any,
nil
otherwise.It can be either a
FinishedLocationFlightInfo
or aFinishedRelativeMoveFlightInfo
. The flight parameters have the values returned by the drone. It indicates the final state of the flight and, for a relative move, the move that the drone actually did.Declaration
Swift
var latestFinishedFlightInfo: FinishedFlightInfo? { get }
-
Tells whether a given reason is partly responsible of the unavailable state of this piloting interface.
Declaration
Swift
func hasUnavailabilityReason(_ reason: GuidedIssue) -> Bool
Parameters
reason
the reason to query
Return Value
true
if the piloting interface is partly unavailable because of the given reason. -
Starts a location guided flight. Moves the drone to a specified location, and rotates heading to the specified value.
This interface will change to
active
when the drone starts, and then toidle
when the drone reaches its destination or is stopped. It also becomesidle
in case of error.If this method is called while the previous guided flight is still in progress, it will be stopped immediately and the new guided flight is started.
In case of drone disconnection, the guided flight is interrupted.
Declaration
Swift
@available(*, deprecated, message: "Use func move(directive: GuidedDirective﹚ instead") func moveToLocation(latitude: Double, longitude: Double, altitude: Double, orientation: GSOrientationDirective, heading: Double)
Parameters
latitude
latitude of the location (in degrees) to reach
longitude
longitude of the location (in degrees) to reach
altitude
altitude above sea level (in meters) to reach
orientation
orientation of the location guided flight
heading
heading for the orientation (
headingStart
or'headingDuring
) -
Start sa relative move guided flight.
Rotates heading by a given angle, and then moves the drone to a relative position. Moves are relative to the current drone orientation (drone’s reference). Also note that the given rotation will not modify the move (i.e. moves are always rectilinear).
This interface will change to
active
when the drone starts, and then toidle
when the drone reaches its destination or is stopped. It also becomesidle
in case of error.If this method is called while the previous guided flight is still in progress, it will be stopped immediately and the new guided flight is started.
In case of drone disconnection, the guided flight is interrupted.
Declaration
Swift
@available(*, deprecated, message: "Use func move(directive: GuidedDirective﹚ instead") func moveToRelativePosition( forwardComponent: Double, rightComponent: Double, downwardComponent: Double, headingRotation: Double)
Parameters
forwardComponent
desired displacement along the front axis, in meters. Negative value for a backward move
rightComponent
desired displacement along the right axis, in meters. Negative value for a left move
downwardComponent
desired displacement along the down axis, in meters. Negative value for an upward move
headingRotation
desired relative rotation of heading, in degrees (clockwise)