Git Product home page Git Product logo

mavsdk-swift's Introduction

MAVSDK

The official MAVSDK client for Swift. This cross-platform gRPC library communicates to MAVLink compatible systems using a plugin architecture.

Installing

Swift Package

Add the following to your Package.swift dependencies:

dependencies: [
     .package(url: "https://github.com/mavlink/mavsdk-swift", from: "1.0.1"),
],

And add each product within each target as needed (MavsdkServer may be optional):

targets: [
    .target(name: "MyTarget",
            dependencies: [
              .product(name: "Mavsdk", package: "Mavsdk"),
              .product(name: "MavsdkServer", package: "Mavsdk")
            ],
    ),
  ]

Start MAVLink connection

The steps below assume that your iOS device has a network connection to the drone, such as WiFi.

By default, the SDK will connect using MAVLink on UDP port 14540 to match the default port of the PX4 SITL (software in the loop simulation) drone.

The backend is currently limited to UDP only, even though the core supports UDP, TCP, and serial.

import MavsdkServer
import Mavsdk

let port = mavsdkServer.run()
let drone = Drone(port: Int32(port))

After that, you can start writing some code as described below.

For advanced users: note that mavsdkServer.run() will run the SDK backend on a background thread on the iOS device. You could use Drone(address:port:scheduler) connect the SDK to another backend IP address and port (such as 192.168.0.42) and running

let drone = Drone(address: "192.168.0.42", port: 50051)

Start writing code

After that, you can start using the SDK, for instance:

_ = drone.action.arm()
     .subscribe(onCompleted: {
          drone.action.takeoff()
     }, onError: { error in
          print(error.localizedDescription)
     })

or

_ = drone.telemetry.position
     .subscribe(onNext: { position in
          print(position)
     }, onError: { error in
          print(error.localizedDescription)
     })

You can learn more about RxSwift, and check out MAVSDK-Swift-Example for more information on using this framework.

Contribute

Before contributing, it's a good idea to file an issue on GitHub to get feedback from the project maintainers.

Build the SDK

MAVSDK functions are mainly generated from files in the /proto submodule (see Sources/Mavsdk/proto). First, you may need to initialize any uninitialized and nested submodules.

git submodule update --init --recursive

Before building the SDK you may need to install the following packages via Homebrew.

brew install protobuf

You will also need to install the following Python libraries for MAVSDK. The first two commands are optional, and the last is required.

python3 -m venv venv
source venv/bin/activate

pip3 install protoc-gen-mavsdk

Then, to generate the source code, run:

bash Sources/Mavsdk/tools/generate_from_protos.bash

NOTE: The following requires Xcode 12 and Swift 5.3.

With your current Xcode project open, you can then locally source Mavsdk to override the remote Swift Package into your project. Open a Finder window, drag-and-drop the Mavsdk directory within the top level of your .xcodeproj, then click File > Swift Packages > Resolve Package Versions to resolve the package dependencies.

NOTE: If you have Xcode 11 and Swift 5.2 or lower and require MavsdkServer, use these additional steps.

Move MavsdkServer.swift from within the Mavsdk package into your main project. Modify Package.swift to remove the following:

.library(name: "MavsdkServer",
   targets: [
      "mavsdk_server"
   ]
)

Next, using Finder, download, unzip and move the binary for the iOS MAVSDK server (mavsdk_server.xcframework) downloaded from MAVSDK Releases into your projects root directory (or where other dependencies may be installed) and update FRAMEWORK_SEARCH_PATHS in the Target Build Settings accordingly to find it.

Generate docs

Note: CI generates docs for the main branch and pushes them to a s3 bucket.

To test the doc generation locally, install jazzy:

sudo gem install jazzy

Then, to generate the docs, run:

bash Sources/Mavsdk/tools/generate_docs.sh

mavsdk-swift's People

Contributors

ayamembs avatar byuarus avatar douglaswsilva avatar hamishwillee avatar jonasvautherin avatar julianoes avatar kylewludwig avatar sushma7785 avatar unipheas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mavsdk-swift's Issues

Show mission on the map

Would be nice to show, on the map, the mission that the sample app will upload to the drone.

@ayameMBS Is it a reasonably easy thing to do?

GRPC_CALL_OK crash

Tested with:

  • Yuneec H520-G and ST10C remote controller
  • Swift 4 Xcode 10.1
  • MAVSDK Example app
  • Carftile.resolved:
binary "https://code.videolan.org/videolan/VLCKit/raw/master/Packaging/MobileVLCKit.json" "3.1.4"
binary "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json" "0.17.0"
github "Dronecode/DronecodeSDK-Swift" "0.5.0"
github "ReactiveX/RxSwift" "4.5.0"
github "grpc/grpc-swift" "0.8.1"

Reproduce:

  • Connect iPad to drone running HITL via wifi
  • Run Example app
  • After connecting to the drone and start subscribing to telemetry, app will crash.

Crash message:

E0624 15:20:24.714529000 6164901888 call_op_set.h:943] assertion failed: GRPC_CALL_OK == g_core_codegen_interface->grpc_call_start_batch( call_.call(), ops, nops, core_cq_tag(), nullptr)

I noticed that the crash will happen after subscribing to some telemetry observables. I'd receive some results, for instance position would return location for a few seconds and then crash after a while.

I saw crashes in observePosition(), observeGroundSpeed(), observeGPS(), but suspect it can happen in any place we have some observable callback, specially in telemetry.

Crash Stack:

#3        0x00000001044129ac in grpc::CoreCodegen::assert_fail(char const*, char const*, int) ()
#4        0x0000000104423dbc in grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallNoOp<3>, grpc::internal::CallNoOp<4>, grpc::internal::CallNoOp<5>, grpc::internal::CallNoOp<6> >::ContinueFillOpsAfterInterception() ()
#5        0x00000001042df4ec in grpc::ServerWriter<dronecode_sdk::rpc::telemetry::PositionResponse>::Write(dronecode_sdk::rpc::telemetry::PositionResponse const&, grpc::WriteOptions) ()
#6        0x0000000104155440 in std::__1::__function::__func<dronecode_sdk::backend::TelemetryServiceImpl<dronecode_sdk::Telemetry>::SubscribePosition(grpc::ServerContext*, dronecode_sdk::rpc::telemetry::SubscribePositionRequest const*, grpc::ServerWriter<dronecode_sdk::rpc::telemetry::PositionResponse>*)::'lambda'(dronecode_sdk::Telemetry::Position), std::__1::allocator<dronecode_sdk::backend::TelemetryServiceImpl<dronecode_sdk::Telemetry>::SubscribePosition(grpc::ServerContext*, dronecode_sdk::rpc::telemetry::SubscribePositionRequest const*, grpc::ServerWriter<dronecode_sdk::rpc::telemetry::PositionResponse>*)::'lambda'(dronecode_sdk::Telemetry::Position)>, void (dronecode_sdk::Telemetry::Position)>::operator()(dronecode_sdk::Telemetry::Position&&) ()
#7        0x0000000104409158 in std::__1::__function::__func<dronecode_sdk::TelemetryImpl::process_global_position_int(__mavlink_message const&)::$_1, std::__1::allocator<dronecode_sdk::TelemetryImpl::process_global_position_int(__mavlink_message const&)::$_1>, void ()>::operator()() ()
#8        0x00000001043ccbc4 in dronecode_sdk::ThreadPool::worker() ()
#9        0x00000001043cd1c8 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (dronecode_sdk::ThreadPool::*)(), dronecode_sdk::ThreadPool*> >(void*) ()

Cocoapods

It looks like the podspec is outdated. I've tried to update it, but can't get XCode to see the module.

Do you have any advice?

Thanks!

Command ack causing connection issues with vehicle

After a lot of digging around I found out one thing that has been causing a lot of connection issues between drone and sdk.

Reproducible steps:

  1. Use all the latest backend and swift SDK in DronecodeSDK_Swift_Example and connect to vehicle via WIFI while connected to debugger via XCode. Tested with our drone and camera.
  2. Subscribe to cameraStatus:
_ = drone.camera.cameraStatus
.subscribe(onNext: { status in
NSLog("Camera Status: \(status)")
}, onError: { error in
NSLog("Error cameraStatusSubscription: \(error.localizedDescription)")
})
  1. Try to set some camera setting:
let option = Camera.Option(optionID: "1", optionDescription: "")
let setting = Camera.Setting(settingID: "CAM_COLORMODE", settingDescription: "", option: option)
_ = drone.camera.setSetting(setting: setting)
.do(onError: { error in
NSLog("failure: setSetting() \(error)")
}, onCompleted: {
NSLog("Completed")
})
.subscribe()
  1. You will see something like this in an infinite loop in the debugger:
[06:37:23|Debug] Lost 3762002188609060911 (mavsdk_impl.cpp:360)
Drone disconnected
[06:37:23|Debug] Discovered 3 component(s) (UUID: 3762002188609060911) (system_impl.cpp:563)
Drone connected with UUID : 3762002188609060911
[06:37:23|Warn ] sending again, retries to do: 3 (527). (mavlink_commands.cpp:219)
[06:37:24|Warn ] sending again, retries to do: 2 (527). (mavlink_commands.cpp:219)
[06:37:24|Warn ] sending again, retries to do: 1 (527). (mavlink_commands.cpp:219)
[06:37:25|Error] Retrying failed (527) (mavlink_commands.cpp:235)
[06:37:25|Warn ] Command ack 527 not matching our current command: 525 (mavlink_commands.cpp:141)
[06:37:25|Warn ] sending again, retries to do: 3 (525). (mavlink_commands.cpp:219)
[06:37:26|Warn ] sending again, retries to do: 2 (525). (mavlink_commands.cpp:219)
[06:37:26|Warn ] sending again, retries to do: 1 (525). (mavlink_commands.cpp:219)
[06:37:27|Error] Retrying failed (525) (mavlink_commands.cpp:235)
[06:37:27|Warn ] sending again, retries to do: 3 (520). (mavlink_commands.cpp:219)
[06:37:28|Warn ] sending again, retries to do: 2 (520). (mavlink_commands.cpp:219)
[06:37:28|Warn ] Command ack 527 not matching our current command: 520 (mavlink_commands.cpp:141)
[06:37:28|Warn ] sending again, retries to do: 1 (520). (mavlink_commands.cpp:219)
[06:37:29|Error] Retrying failed (520) (mavlink_commands.cpp:235)
[06:37:29|Warn ] sending again, retries to do: 3 (527). (mavlink_commands.cpp:219)
[06:37:30|Warn ] sending again, retries to do: 2 (527). (mavlink_commands.cpp:219)
[06:37:30|Warn ] sending again, retries to do: 1 (527). (mavlink_commands.cpp:219)
[06:37:31|Error] Retrying failed (527) (mavlink_commands.cpp:235)
[06:37:31|Warn ] Command ack 527 not matching our current command: 525 (mavlink_commands.cpp:141)
[06:37:31|Warn ] Command ack 525 not matching our current command: 520 (mavlink_commands.cpp:141)
[06:37:31|Warn ] sending again, retries to do: 3 (520). (mavlink_commands.cpp:219)
[06:37:32|Warn ] sending again, retries to do: 2 (520). (mavlink_commands.cpp:219)
[06:37:32|Warn ] sending again, retries to do: 1 (520). (mavlink_commands.cpp:219)
[06:37:33|Error] Retrying failed (520) (mavlink_commands.cpp:235)
[06:37:33|Warn ] sending again, retries to do: 3 (527). (mavlink_commands.cpp:219)
[06:37:34|Warn ] sending again, retries to do: 2 (527). (mavlink_commands.cpp:219)
[06:37:34|Warn ] Command ack 525 not matching our current command: 527 (mavlink_commands.cpp:141)
[06:37:34|Warn ] sending again, retries to do: 1 (527). (mavlink_commands.cpp:219)
[06:37:35|Info ] heartbeats timed out (system_impl.cpp:312)
[06:37:35|Debug] Lost 3762002188609060911 (mavsdk_impl.cpp:360)
Drone disconnected
[06:37:35|Debug] Discovered 3 component(s) (UUID: 3762002188609060911) (system_impl.cpp:563)
Drone connected with UUID : 3762002188609060911
[06:37:35|Error] Retrying failed (527) (mavlink_commands.cpp:235)
[06:37:35|Warn ] sending again, retries to do: 3 (525). (mavlink_commands.cpp:219)
[06:37:36|Warn ] sending again, retries to do: 2 (525). (mavlink_commands.cpp:219)

After that you won't be able to send any command to the drone and all your telemetry will be frozen. Only way to fix it is to reset both app and drone.

NOTE: I saw this issue with cameraStatus but I'm afraid we could get this command ack lock with other subscriptions as well. So it's worth it to once you fix the issue to also take a look at other subscriptions to see if they could have the same issue.

Carthage setup is not working

screen shot 2018-03-30 at 11 37 19 am

Carthage fails to build DroneCore-Swift. It won't create the Carthage/Build/iOS/Dronecode_SDK_Swift.framework

I'm using:

  • Sierra MacOS 10.12.6
  • Xcode 9.2 Build version 9C40b
  • Carthage version 0.29.0

Step to reproduce:

  • create a new iOS single view app project.
  • create the file Cartfile with code:
    # Require the iOS framework of DroneCore SDK
    github "dronecore/DroneCore-Swift"
  • run Carthage in your app's repository
    carthage update

Add camera features to Sample app

Not all the features are implemented yet, but many of them are (like takePhoto, etc), as detailed in #5.

Would be nice to add them/some of them in the app already.

Unable to set camera settings (setSettings)

With the latest Mavlink SDK v0.21.1 and a local built updated version of the Mavlink-Swift v0.7.0 I am not able to set camera settings.

System:

  • Xcode 10.1
  • Swift 5
  • iPad Mini 4 with IOS 12.2
  • Drone and camera you guys know

I don't get any errors in the logs, aside from I stop receiving telemetry and cannot send or get any values from the vehicle. Which makes me think that after trying to set settings, something is blocking the communication channel. This happened testing via wifi and MFi.

Upon connection to the app, I get this in the logs:

|Info ] 12:02:29|Debug] [12:02:29|Info ] Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:47)
[12:02:30|Info ] Server started (grpc_server.cpp:12:02:30|Info ] Waiting to discover system...[12:02:30|Info ] New system on: 127.0.0.1:49464 (udp_connection.cpp:263)
[12:02:30|Debug] Component Unsupported component (240) added. (system_impl.cpp:401)
[12:02:30|Debug] Discovered 1 component(s) (UUID: 1) (system_impl.cpp:561)
[12:02:30|Info ] System discovered [UUID: 1] (connection_initiator.h:62)
[12:02:30|Info ] New system on: 192.168.42.1:48023 (udp_connection.cpp:263)
[12:02:30|Debug] Component Camera 1 (100) added. (system_impl.cpp:401)
[12:02:31|Debug] request camera info (camera_impl.cpp:140)
[12:02:31|Debug] Component Autopilot (1) added. (system_impl.cpp:401)
[12:02:31|Debug] Component Gimbal (154) added. (system_impl.cpp:401)
[12:02:31|Warn ] sending again, retries to do: 3  (511). (mavlink_commands.cpp:222)
[12:02:31|Error] Error: get param busy timeout: MIS_TAKEOFF_ALT (mavlink_parameters.cpp:456)
[12:02:31|Error] Error: UUID changed (system_impl.cpp:257)
[12:02:31|Warn ] Command ack 520 not matching our current command: 521 (mavlink_commands.cpp:143)
[12:02:31|Info ] Using cached file for Yuneec E90. (camera_impl.cpp:909)
[12:02:31|Debug] step range missing for CAM_CUSTOMWB (camera_definition.cpp:371)
[12:02:31|Error] min range missing for CAM_SPOTAREA (camera_definition.cpp[12:02:31|Warn ] Not found: CAM_SPOTAREA (camera_definition.cpp:220)
[12:02:31|Error] min range missing for CAM_ASPECTRATIO (camera_definition.cpp:345)
[12:02:31|Warn ] Not found: CAM_ASPECTRATIO (camera_definition.cpp:220)
[12:02:31|Debug] Ignoring string params. (camera_definition.cpp:121)
[12:02:31|Warn ] Default missing for CAM_SYSTEMTIME (camera_definition.cpp:196)
[12:02:31|Debug] Ignoring custom params. (camera_definition.cpp:126)
[12:02:31|Debug] Ignoring custom params. (camera_definition.cpp:126)
[12:02:31|Warn ] Default missing for CAM_ZOOM (camera_definition.cpp:196)
[12:02:31|Warn ] Comparison type mismatch between uint8_t and uint16_t (mavlink_parameters.h:407)
[12:02:31|Error] Chosen value smaller than minimum (camera_definition.cpp:550)

I imagine it could be related to this issue: mavlink/MAVSDK@08d1422 but I'm not sure.

Please let me know if you anything anything else from me.

Not connecting to ESP8266 WiFi Module

I tried the current version of the example app (with 0.4.1) and it wasn't establishing a connection with my ESP8266 WiFi Module, but QGC was able to. Not able to get it to connect with 0.5.0 either.

It's not crashing, just not connecting. Here is the log

2019-06-26 19:44:58.875767+0800 DronecodeSDK_Swift_Example[65517:4136020] [DYMTLInitPlatform] platform initialization successful
2019-06-26 19:44:59.109322+0800 DronecodeSDK_Swift_Example[65517:4135848] creating player instance using shared library
Running backend in background (MAVLink port: 14540
[07:44:59|Info ] DronecodeSDK version: 0.15.0 (dronecode_sdk_impl.cpp:25)
[07:44:59|Debug] New: System ID: 0 Comp ID: 0 (dronecode_sdk_impl.cpp:285)
[07:44:59|Info ] Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:43)
[07:44:59|Info ] Server started (grpc_server.cpp:27)
[07:44:59|Info ] Waiting to discover system... (connection_initiator.h:57)

Originally posted by @unipheas in #133 (comment)

Arming Failed: Can't connect to 3DR Solo

Hello,

I am trying to get a working sample of the DronecodeSDK library working in my iOS app. That being said, I am having trouble getting the SDK to actually connect to my 3DR Solo drone. By following the basic guide in the README, I get the following error while attempting to arm the drone:

Arming failed: The operation couldn't be completed. (SwiftGRPC.RPCError error 0)

I have made sure that my iOS simulator is connected to the drone wifi. I have also tried to run the sample project but to no avail (same error).

Any help would be appreciated.

Environment:
XCode -> 9.4.1
3DR Solo Drone
iOS Simulator (iPhone 8+)

Implement frontend mission

  • UploadMission
  • DownloadMission
  • StartMission
  • PauseMission
  • SetCurrentMissionItemIndex
  • GetCurrentMissionItemIndex
  • GetMissionCount
  • IsMissionFinished
  • SubscribeMissionProgress

Place the sample mission around the drone

Not everybody is running the simulator in Zurich. It would be nice to set the sample mission with respect to the position of the drone (e.g. update the mission if it is more than x meters away from the (home) position of the drone).

What do you think @ayameMBS?

Add method for cancelling mission upload/download process

For big missions, mission upload/download process could take a significant time. We need to have an option to cancel a mission upload and start uploading another mission. If we try to upload/download while upload/download is in progress, the request will fail.

Camera setSetting not working

When trying to set any settings for camera I get this error:

[06:18:07|Error] Error: set param busy timeout: CAM_COLORMODE (mavlink_parameters.cpp:470)
failure: setSetting() CameraError(code: Dronecode_SDK_Swift.Camera.CameraResult.Result.error, description: "Error")

Backend.framework fails Apple validation

Steps to reproduce:

  • Open the DroneCore sample app
  • Select Deployment target 10.0
  • Select generic iOS Device as your target device in XCode
  • Go to product->archive
  • When it is done, go to window->organizer and select tab Archives
  • Select the latest archive and Validate.., then agree with everything and complete the validation. You will see the list of errors.

Most of those issues can be fixed by changing the cmake file and adding the missing values to the info.plist file of backend.framework (Dmitry did it).

Cannot connect to jMavSim running inside the LAN from iPhone, but QGC can.

Beforehand, in iPhone emulator, the swift demo app can connect to the drone simulated in local jMavSim.

Now, the problem is:

  1. jMavSim started and set to broadcast MAVLINK to ports 14550 and 14540 in PC1.
  2. QGC can connect to the drone in the jMavSim from PC2 in the same LAN.
  3. The swift demo app running on real iPhone in Macbook(the 3rd computer) cannot connect to jMavSim running on PC1.

Best and Thanks!

Remove Carthage

As discussed with @byuarus and @ayameMBS, let's remove support for Carthage and keep Cocoapods and the build scripts.

  • Remove Carthage configuration
  • Remove Carthage instructions from README

Addressing #15 and #29.

Introduce The Library

I want to introduce the library into the existing OC project, may I ask what method is needed? The Carthage import library used in the demo often times out of time. Can we download the library separately and introduce it into the demo?

Needs CI

we need to guarantee a certain degree of safety on our SDK, we need to set up a recipe for building/running tests and host that on Jenkins.

  • build script
  • integration-tests script
  • jenkins job
  • jenkins <-> github integration
  • readme build badge

Cancel mission upload and download now working currently

I'm testing the latest SDK with latest firmwares and it seems that this got broken.
I call the .cancelMissionUpload() command, but it doesn't cancel and there's no callback until the mission finishes uploading. Then I get this:

[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Debug] Send mission item 87 (mission_impl.cpp:1118)
[05:31:58|Info ] Mission accepted (mission_impl.cpp:165)
17:31:58.041 ๐Ÿ“ฐ [DroneIntegrationTestViewController.swift:136 uploadMission()]: +DIT+ Mission Uploaded.
[05:31:58|Warn ] No mission upload in progress (mission_impl.cpp:398)
17:31:58.052 ๐Ÿ“ฐ [DroneIntegrationTestViewController.swift:149 cancelMissionUpload()]: +DIT+ Mission Canceled.

Carthage bootstrap timed out

The Carthage import library used in the demo often times out of time. Can we download the library separately and introduce it into the Demo?

Cannot build GRPC-Swift package in SwiftGRPC-Package.xcodeproj with Carthage

Currently I'm trying to use the Carthage build to add the frameworks. I am running Carthage version 0.32 and Swift 4.2

I am having issues when trying to run

carthage bootstrap --platform ios

I am currently stuck with the build error:

Downloading RxSwift.framework binary at "Atomic.2
*** Building scheme "SwiftGRPC-Package" in SwiftGRPC-Carthage.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/renosimomoh/Drone\ Delivery\ /Medical\
Drone/Carthage/Checkouts/grpc-swift/SwiftGRPC-Carthage.xcodeproj -scheme SwiftGRPC-Package -configuration Release -derivedDataPath /Users/renosimomoh/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/grpc -swift/b7659e1031b441da2db60fa879e8157799730f02 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/_s/vpqkvyq96rl9q9kj_b50w1s80000gn/T/grpc-swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/renosimomoh/Drone Delivery /Medical Drone/Carthage/Checkouts/grpc-swift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/_s/vpqkvyq96rl9q9kj_b50w1s80000gn/T/carthage xcodebuild.aT7PEJ.log``

Carthage build not working

carthage build
*** xcodebuild output can be found in /var/folders/6h/nc4rf_dj3bdd9_0yz7vgtwb00000gn/T/carthage-xcodebuild.hAIujh.log
*** Building scheme "Dronecode-SDK-Swift" in Dronecode-SDK-Swift.xcodeproj
Build Failed
        Task failed with exit code 65:
        /usr/bin/xcrun xcodebuild -project /Users/julianoes/src/DroneCore-Swift/SampleCode/SwiftSampleCode/Carthage/Checkouts/DroneCore-Swift/Source/Dronecode-SDK-Swift/Dronecode-SDK-Swift.xcodeproj -scheme Dronecode-SDK-Swift -configuration Release -derivedDataPath /Users/julianoes/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/DroneCore-Swift/ed3cd194a2c71ad62a4147010eb572c3823e311a -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/6h/nc4rf_dj3bdd9_0yz7vgtwb00000gn/T/DroneCore-Swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/julianoes/src/DroneCore-Swift/SampleCode/SwiftSampleCode/Carthage/Checkouts/DroneCore-Swift)

The log ends with:

/Users/julianoes/src/DroneCore-Swift/SampleCode/SwiftSampleCode/Carthage/Checkouts/DroneCore-Swift/Source/Dronecode-SDK-Swift/Dronecode-SDK-Swift/Generated/telemetry.grpc.swift:25:8: error: no such module 'gRPC'
import gRPC
^

** ARCHIVE FAILED **


The following build commands failed:
        CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
        CompileSwift normal arm64
(2 failures)

XCTest framework is causing single SIGABRT

When building a new iOS project and importing the XCTest.framework into the project it is causing a signal SIGABRT error. It seems to be because there is an image missing. This was the output

dyld: Library not loaded: @rpath/XCTest.framework/XCTest
Referenced from: /usr/lib/swift/libswiftXCTest.dylib
Reason: image not found

Error with backend.json 0.16.0

When performing the command
Carthage build --platform iOS --no-skip-current --verbose
I am receiving the following error
*** Downloading binary-only framework backend at "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json" No available version for binary "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json" satisfies the requirement: == 0.16.0
I had to change the Cartfile to 0.15.0 for it to work.

*** I am using Shadowsocks and proxying through the GFW in China, if this has anything to do with it. However, 0.15.0 worked so I'm not sure about that.

Gimbal .setMode and .setPitchAndYaw work but return "unknown" error

Problem:
With the builds of MAVSDK-Swift.framework 0.7.0 + mavsdk_server.framework 0.20.0 Setting gimbal mode or pitchAndYaw both work but return an unknown error.

Tested with:

  • XCode 10.2.1
  • Swift 5
  • IOS 12.2
  • The drone and camera you already know

Repro Steps:

  1. Call gimbal.setMode or callgimbal.setPitchAndYaw
  2. This is the odd part. You will get an error that says success, the mode will be set.
โ–ฟ GimbalError
  - code : MAVSDK_Swift.Gimbal.GimbalResult.Result.unknown
  - description : "Success"

Let me know if you need more info.

Carthage build fails with Swift 4.2 / Xcode 10

Carthage build fails because of grpc-swift, as my Carthage integration there was relying on an implementation detail of Swift 4.1, and breaks with Swift 4.2+.

This issue is related to grpc/grpc-swift#329.

I tried to fix it using xcodegen (see PR here), but did not finish it. Somebody with more experience with Xcode projects / xcodegen may have more success.

This adresses #102, too.

[Cocoa pod] Install error

I run "pod install" at
/DroneCore-Swift-master/Sample Code/Swift Sample Code
but error occured
Please help me to solve it, pod's log below:

Analyzing dependencies
Downloading dependencies
Installing DroneCore-Swift (0.0.1)

[!] Error installing DroneCore-Swift
[!] /usr/bin/curl -f -L -o /var/folders/k4/5cpcyfbx6nd7y0fdvb6rqhz80000gn/T/d20180409-28514-1ibv0sn/file.zip https://s3.eu-central-1.amazonaws.com/dronecode-sdk/dronecore-swift-prototype.zip --create-dirs --netrc-optional

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 403 Forbidden

"SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background)" has crash

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

let drone = Drone.init(address: "", port: 8090)
drone.action.arm()
.andThen(drone.action.takeoff())
.subscribe(onCompleted: {
print("123")
}) { (error) in
print(error)
}
.dispose()

return true
}

but there has carsh in method of Drone init

Swift Version conflict in XCode 9.3

I tried to compile and run the example in order to test the live stream with the E90.

Unfortunately, I get the Swift version error:

/Users/julianoes/src/DroneCore-Swift/SampleCode/SwiftSampleCode/DronecodeSDKSwiftDemo/Controllers/TelemetryViewController.swift:10:8: Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1: /Users/julianoes/src/DroneCore-Swift/SampleCode/SwiftSampleCode/Pods/DroneCore-Swift/Dronecode_SDK_Swift.framework/Modules/Dronecode_SDK_Swift.swiftmodule/arm64.swiftmodule

Could it be that Dronecode_SDK_Swift.framework is still built using XCode 9.2 or earlier? Or is something wrong with my setup/config?

Dronecode still exists

When creating the Carthage file and using github "mavlink/MAVSDK-Swift" ~> 0.5.0 Dronecode_SDK_Swift.framework still exists. You will then need to import Dronecode_SDK_Swift in your code

Implement frontend for camera

  • TakePhoto
  • StartPhotoInterval
  • StopPhotoInterval
  • StartVideo
  • StopVideo
  • StartVideoStreaming
  • StopVideoStreaming
  • SetMode
  • SubscribeMode
  • SetVideoStreamSettings
  • SubscribeVideoStreamInfo
  • SubscribeCaptureInfo
  • SubscribeCameraStatus
  • SubscribeCurrentSettings
  • SubscribePossibleSettings
  • SetSetting

Error building SDK from Carthage

Keep get this error when trying to run carthage bootstrap --platform ios:

3DR-000328:Downloads douglas$ cd /Users/douglas/Downloads/DronecodeSDK-Swift-master\ 2 
3DR-000328:DronecodeSDK-Swift-master 2 douglas$ carthage bootstrap --platform ios
*** Checking out grpc-swift at "0.8.1"
*** Checking out RxSwift at "4.5.0"
*** Downloading binary-only framework backend at "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json"
*** xcodebuild output can be found in /var/folders/2d/t05mnyvs1ll3z81lgn1xlqgw0000gp/T/carthage-xcodebuild.nGAape.log
*** Downloading RxSwift.framework binary at "[4,5]"
***  Skipped installing RxSwift.framework binary due to the error:
	"Incompatible Swift version - framework was built with 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3) and the local version is 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)."

    Falling back to building from the source
*** Building scheme "SwiftGRPC-Package" in SwiftGRPC-Carthage.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/douglas/Downloads/DronecodeSDK-Swift-master\ 2/Carthage/Checkouts/grpc-swift/SwiftGRPC-Carthage.xcodeproj -scheme SwiftGRPC-Package -configuration Release -derivedDataPath /Users/douglas/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/grpc-swift/0.8.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/2d/t05mnyvs1ll3z81lgn1xlqgw0000gp/T/grpc-swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/douglas/Downloads/DronecodeSDK-Swift-master 2/Carthage/Checkouts/grpc-swift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/2d/t05mnyvs1ll3z81lgn1xlqgw0000gp/T/carthage-xcodebuild.nGAape.log
3DR-000328:DronecodeSDK-Swift-master 2 douglas$ 

NOTE: We're using XCode 10.1

Implement plugin to set mavlink params

This feature will allow us to set different configuration for the drone, like RC signal loss behavior, enable/disable HITL mode, failsafe behavior, adjust RC sticks sensitivity...

Task failed with exit code 65

I created a new Xcode Project for iOS. It's just a default app, nothing has changed once the create button was clicked. I then went into the terminal and into the project directory and typed the following commands as per the instructions for this repo.

gem install --user xcodeproj
touch Cartfile
vi Cartfile
# add github "Dronecode/DronecodeSDK-Swift" ~> 0.3.0
rm -rf Carthage ~/Library/Caches/org.carthage.CarthageKit ~/Library/Caches/carthage
carthage bootstrap --platform ios

I then receive this error, which was also mentioned here but it was for the Swift SDK itself.

carthage bootstrap --platform ios
*** Checking out grpc-swift at "0.8.2"
*** Checking out DronecodeSDK-Swift at "0.4.1"
*** Checking out RxSwift at "4.5.0"
*** xcodebuild output can be found in /var/folders/gs/_gq_c3k97db9b1xg6dg84lww0000gn/T/carthage-xcodebuild.3zbbvi.log
*** Downloading binary-only framework backend at "https://s3.eu-central-1.amazonaws.com/dronecode-sdk/backend.json"
*** Downloading RxSwift.framework binary at "[4,5]"
***  Skipped installing RxSwift.framework binary due to the error:
	"Incompatible Swift version - framework was built with 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3) and the local version is 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)."

    Falling back to building from the source
*** Building scheme "SwiftGRPC-Package" in SwiftGRPC-Carthage.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/unipheas/Developer/px4/DroneCode_iOS/Carthage/Checkouts/grpc-swift/SwiftGRPC-Carthage.xcodeproj -scheme SwiftGRPC-Package -configuration Release -derivedDataPath /Users/unipheas/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/grpc-swift/0.8.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/gs/_gq_c3k97db9b1xg6dg84lww0000gn/T/grpc-swift SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/unipheas/Developer/px4/DroneCode_iOS/Carthage/Checkouts/grpc-swift)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/gs/_gq_c3k97db9b1xg6dg84lww0000gn/T/carthage-xcodebuild.3zbbvi.log

The log has this to say

ld: warning: directory not found for option '-L/usr/local/homebrew/Cellar/nghttp2/1.35.1/lib'
ld: library not found for -lnghttp2
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **


The following build commands failed:
	SwiftCodeGeneration normal armv7
	SwiftCodeGeneration normal arm64
	Ld /Users/unipheas/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/grpc-swift/0.8.2/Build/Intermediates.noindex/ArchiveIntermediates/SwiftGRPC-Package/IntermediateBuildFilesPath/SwiftGRPC-Carthage.build/Release-iphoneos/BoringSSL.build/Objects-normal/armv7/BoringSSL normal armv7
(3 failures)

I looked into installing nghttp2 through Brew but it seems to already be installed. This seems to be slightly different from issue #120.

One last thing, I'm running the following

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin18.6.0

and Xcode Version 10.2.1 (10E1001)

Backend framework does not contain bitcode

When building a new iOS project and import MAVSDK-Swift, it is failing to build because of an Enabled Bitcode. Here is the output

'/Users/unipheas/Developer/MAVSDK-Swift-Starter-App/Carthage/Build/iOS/backend.framework/backend' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/unipheas/Developer/MAVSDK-Swift-Starter-App/Carthage/Build/iOS/backend.framework/backend' for architecture arm64

As a temporary fix you will need to go into Build Settings, click All, then search for bitcode, then switch Enable Bitcode to No.

CameraPhotoIntervalS not working in MissionItem

Drone will take picture every second despite of the value we set. For instance:

Dronecode_SDK_Swift.Mission.MissionItem(latitudeDeg: location.latitude,
                                         longitudeDeg: location.longitude,
                                         relativeAltitudeM: 4.0,
                                         speedMS: 4.0,
                                         isFlyThrough: false,
                                         gimbalPitchDeg: -30,
                                         gimbalYawDeg: 0,
                                         cameraAction: .startPhotoInterval, 
                                         loiterTimeS: 0,
                                         cameraPhotoIntervalS: 5)

Incompatible library version of libswiftCore.dylib

I'm using:
macOS 10.13.4 High Sierra
XCode 9.3 with Toolchain: Swift 4.0.3.

pod install worked and the build works as well but on loading I get:

dyld: Library not loaded: @rpath/libswiftCore.dylib

  Referenced from: /private/var/containers/Bundle/Application/A4A675F3-41DB-46DD-97EA-D60F1D64ADB0/DronecodeSDKSwiftDemo.app/Frameworks/SwiftProtobufPluginLibrary.framework/SwiftProtobufPluginLibrary

  Reason: Incompatible library version: SwiftProtobufPluginLibrary requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0

I've tried deleting all of DerivedData and clean building without success.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.