Skip to content

Commit

Permalink
Merge pull request #208 from Esri/main
Browse files Browse the repository at this point in the history
Updated to 1.3.0.
  • Loading branch information
JonasVautherin authored May 12, 2022
2 parents 54e4eb5 + 7707333 commit bfe734f
Show file tree
Hide file tree
Showing 42 changed files with 3,725 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ let package = Package(
]
),
.binaryTarget(name: "mavsdk_server",
url: "https://github.com/mavlink/MAVSDK/releases/download/v1.0.8/mavsdk_server.xcframework.zip",
checksum: "ac1cad61e9101f15725cbecb995a7be18ff87ee80d5aa67c91a70e9d0b43816f"),
url: "https://github.com/mavlink/MAVSDK/releases/download/v1.4.0/mavsdk_server.xcframework.zip",
checksum: "a38385a38d426a0d6b9700e142b4de978eddff5d6d33666c108fb35922f5c276"),
.testTarget(name: "MavsdkTests",
dependencies: [
"Mavsdk",
Expand Down
44 changes: 44 additions & 0 deletions Sources/Mavsdk/Generated/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public class Action {
case noVtolTransitionSupport
/// Error getting or setting parameter.
case parameterError
/// Action not supported.
case unsupported
case UNRECOGNIZED(Int)

internal var rpcResult: Mavsdk_Rpc_Action_ActionResult.Result {
Expand Down Expand Up @@ -170,6 +172,8 @@ public class Action {
return .noVtolTransitionSupport
case .parameterError:
return .parameterError
case .unsupported:
return .unsupported
case .UNRECOGNIZED(let i):
return .UNRECOGNIZED(i)
}
Expand Down Expand Up @@ -201,6 +205,8 @@ public class Action {
return .noVtolTransitionSupport
case .parameterError:
return .parameterError
case .unsupported:
return .unsupported
case .UNRECOGNIZED(let i):
return .UNRECOGNIZED(i)
}
Expand Down Expand Up @@ -1020,4 +1026,42 @@ public class Action {
return Disposables.create()
}
}

/**
Set current speed.
This will set the speed during a mission, reposition, and similar.
It is ephemeral, so not stored on the drone and does not survive a reboot.
- Parameter speedMS: Speed in meters/second
*/
public func setCurrentSpeed(speedMS: Float) -> Completable {
return Completable.create { completable in
var request = Mavsdk_Rpc_Action_SetCurrentSpeedRequest()



request.speedMS = speedMS



do {

let response = self.service.setCurrentSpeed(request)

let result = try response.response.wait().actionResult
if (result.result == Mavsdk_Rpc_Action_ActionResult.Result.success) {
completable(.completed)
} else {
completable(.error(ActionError(code: ActionResult.Result.translateFromRpc(result.result), description: result.resultStr)))
}

} catch {
completable(.error(error))
}

return Disposables.create()
}
}
}
6 changes: 6 additions & 0 deletions Sources/Mavsdk/Generated/Calibration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public class Calibration {
case cancelled
/// Calibration process failed since the vehicle is armed.
case failedArmed
/// Functionality not supported.
case unsupported
case UNRECOGNIZED(Int)

internal var rpcResult: Mavsdk_Rpc_Calibration_CalibrationResult.Result {
Expand All @@ -115,6 +117,8 @@ public class Calibration {
return .cancelled
case .failedArmed:
return .failedArmed
case .unsupported:
return .unsupported
case .UNRECOGNIZED(let i):
return .UNRECOGNIZED(i)
}
Expand Down Expand Up @@ -144,6 +148,8 @@ public class Calibration {
return .cancelled
case .failedArmed:
return .failedArmed
case .unsupported:
return .unsupported
case .UNRECOGNIZED(let i):
return .UNRECOGNIZED(i)
}
Expand Down
37 changes: 37 additions & 0 deletions Sources/Mavsdk/Generated/Camera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2037,4 +2037,41 @@ public class Camera {
return Disposables.create()
}
}

/**
Select current camera .
Bind the plugin instance to a specific camera_id
- Parameter cameraID: Id of camera to be selected
*/
public func selectCamera(cameraID: Int32) -> Completable {
return Completable.create { completable in
var request = Mavsdk_Rpc_Camera_SelectCameraRequest()



request.cameraID = cameraID



do {

let response = self.service.selectCamera(request)

let result = try response.response.wait().cameraResult
if (result.result == Mavsdk_Rpc_Camera_CameraResult.Result.success) {
completable(.completed)
} else {
completable(.error(CameraError(code: CameraResult.Result.translateFromRpc(result.result), description: result.resultStr)))
}

} catch {
completable(.error(error))
}

return Disposables.create()
}
}
}
Loading

0 comments on commit bfe734f

Please sign in to comment.