Skip to content

Control with dji phantom with bluetooth client application. and connection from python

Notifications You must be signed in to change notification settings

arakawamoriyuki/phantom-ble-bridge

Repository files navigation

Build

pod install

  • $ cd PhantomBleBridge
  • $ sudo gem install cocoapods
  • $ pod repo update
  • $ pod install

dji developer registration

xcode setting

  • open PhantomBleBridge from xcode
  • Xcodeproject -> General -> Signing
  • Xcodeproject -> General -> Identifier -> Bundle Identifier
  • Info.plist -> DJISDKAppKey

shantom setting

  • fw update (aircraft and propo)
  • asp mode f(p3) p(p4)

Snippets

Start connection

DJISDKManager.startConnectionToProduct()

Stop connection

DJISDKManager.stopConnectionToProduct()

Turn on motors

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.turnOnMotorsWithCompletion()
}

Turn off motors

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.turnOffMotorsWithCompletion()
}

Take Off

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.startTakeoffWithCompletion()
}

Landing

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.startLandingWithCompletion()
}

Go home

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.startGoHomeWithCompletion()
}

Go home cancel

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.cancelGoHomeWithCompletion()
}

Controll

if let aircraft = DJISDKManager.product() as? DJIAircraft {
  aircraft.flightController.setVirtualStickModeEnabled(true)
  if aircraft.flightController.isVirtualStickControlModeAvailable() {

    # 秒単位での操作?
    # Filter the angle between -180 ~ 0, 0 ~ 180
    DJIVirtualStickFlightControlData data;
    data.pitch = 0
    data.roll = 0
    data.yaw = 180
    data.verticalThrottle = 0

    aircraft.sendVirtualStickFlightControlData(data)
  }
}

Controll log

TODO: https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/SimulatorDemo.html

Video feeder

TODO:

Tips

About

Control with dji phantom with bluetooth client application. and connection from python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published