I build a new kernel for virtual stick photogrammetry missions with AEB and SAEB. DJI SDK missions have only simple photo capabilities.
Sometimes we need to have AEB or SAEB or even multiple pitch photogrammetry missions. We can realize code with the virtual stick mode for any aircraft. This works for the Mavic Mini and the Mavic Air 2 or any other aircraft.
Virtual Stick offers the developers a lot of possibilities to do intelligent code.
The main issue with Virtual Stick is that you loose control over the remote sticks. The aircraft will not move if you move your sticks. We can add a security to stop the Virtual Stick Mode immediately when we touch the sticks.
First we delegate the remote controller
// Stop Virtual Stick if somebody touches the sticks
During flight we check the distance to the target and the bearing to the target GPS.
If the distance become the same as speed we decrease the speed.
If the aircraft heading is not towards the target we correct the heading by the calculated bearing.
We change the altitude if necessary to the target.
If the distance to the target is near to 0.5m we stop sending Virtual Stick commands.
//MARK: Show Virtual Stick Move Action
func showVS() {
let bearing = self.GPSController.getBearingBetweenTwoPoints(point1: self.aircraftLocation, point2: self.vsTargetLocation)
let distance = self.GPSController.getDistanceBetweenTwoPoints(point1: self.aircraftLocation, point2: self.vsTargetLocation)
// Slow down the aircraft
if distance <= Double(self.vsSpeed) {
self.vsSpeed = Float(distance / 2)
if distance < 2 {
print("Close, slow speed \((self.vsSpeed*10).rounded()/10)m/s distance to target \((distance*10).rounded()/10)m")
}
} else {
print("Move, distance to target \((distance*10).rounded()/10)m speed \((self.vsSpeed*10).rounded()/10)m/s")
hdrpano Posted at 12-19 09:50
The iOS sample code is not optimized for Xcode 12 and iOS 14... dark mode.
I corrected the iOS sample and added Virtual Stick native drone code.
The sample code would be interesting for me. I would be grateful in case you can share it.
It would actually be nice to have DJI support real waypoint features for the MIni & Mini 2 just like the Mavic Pro. Tell the bird to fly from x to y at z speed etc. Why this hassle with virtual sticks ? I use the waypoint features a lot in combination with Litchi. I would even get rid of the MP if my new Mini 2 had the same features. DJI, if you read this...
I want to track inventory vertically. I want to use the virtual sticks to make sure I can go up then right then down then right then up and repeat x amount of times. is this possible? thanks in advance for the information.