NPE in WaypointMissionOperator.checkParameters with DJI Matrice 100 or 600 - dji-sdk

UPDATE
Trying to load a waypoint mission with the Android SDK sample updated to version 4.11 results in an internal Null Pointer Exception
Prerequisites:
An android phone installed with the sample SDK updated to 4.11
A Matrice 100 / 600 connected to the DJI Assistant 2
Steps to reproduce:
Open the sample SDK
Click "Open" after the drone connects
Click "New Waypoint Mission Operator"
Click "Load"
App crashes with the following stack
com.dji.sdk.sample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dji.sdk.sample, PID: 14107
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
at dji.common.mission.waypoint.Waypoint.checkParameters(Unknown Source:15)
at dji.common.mission.MissionUtils.checkEachWaypointValid(Unknown Source:18)
at dji.common.mission.MissionUtils.checkWaypointMissionParameters(Unknown Source:44)
at dji.common.mission.waypoint.WaypointMission$Builder.checkParameters(Unknown Source:10)
at dji.internal.mission.abstraction.waypoint.WaypointMissionAbstraction.a(Unknown Source:0)
at dji.sdk.mission.waypoint.WaypointMissionOperator.loadMission(Unknown Source:32)
at com.dji.sdk.sample.demo.missionoperator.WaypointMissionOperatorView.onClick(:107)
at android.view.View.performClick(View.java:6310)
at android.view.View$PerformClick.run(View.java:24970)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6662)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Original Question
The same code works perfectly on the P4A but fails on the Matrice 100 / 600.
Here are the relevant parts of my code in Kotlin.
Create a list of waypoints.
val waypointList: List<Waypoint> = data.points.map {
val waypoint = Waypoint(it.latitude, it.longitude, it.altitude)
waypoint.speed = 3
waypoint.heading = 0
waypoint.gimbalPitch = 0
waypoint.turnMode = WaypointTurnMode.CLOCKWISE
waypoint.actionRepeatTimes = 1
waypoint.actionTimeoutInSeconds = 3
waypoint.cornerRadiusInMeters = 1
waypoint
}
Create a WaypointMission.Builder Object
val mission = WaypointMission.Builder()
.waypointList(waypointList)
.waypointCount(waypointList.size)
.autoFlightSpeed(10)
.repeatTimes(1)
.setGimbalPitchRotationEnabled(false)
.setExitMissionOnRCSignalLostEnabled(false)
.finishedAction(WaypointMissionFinishedAction.NO_ACTION)
.maxFlightSpeed(13)
.flightPathMode(WaypointMissionFlightPathMode.CURVED)
.headingMode(WaypointMissionHeadingMode.AUTO)
.gotoFirstWaypointMode(WaypointMissionGotoWaypointMode.POINT_TO_POINT)
mission.checkParameters()
WaypointOperator.loadMission(mission.build())
WaypointOperator.uploadMission()
With the P4A: the code continues with no error, and goes off to the waypoint mission.
With Matrice 100, the checkParameters function in step 3 returns no result and the code just stalls here with the WaypointOperator.currentState staying at READY_TO_UPLOAD
I have tried everything in the last 2 days, and the only thing I can guess is that I am missing some parameter that the Matrice 100 needs, but I have no clue what that might be, and can't find anything in the documentation about it.

It is a bug on DJI's part, but they offered me a temporary solution until the next version is released.
After confirming, this problem only occurs when your aircraft is not mounting the camera.
So, for the temporary workaround, you can mount a camera on your drone when you using v4.11.
Also, this issue will be fixed in the coming v4.11.1 official release.

Related

Is there any solution for getting item of media queue at nay index?

I am using google chrome cast feature for my iOS App. I am getting an issue with live chrome cast id. I am not able to get media Queue list or It is also not providing the item at any index while I have added 5 item (video) in queue.
Ex : I am using code like this : remotemediaCient.mediaQueue.item(at: UInt(i)) // where i is index number
It is giving me nil in every case.
Please provide me solution. Thanks

Draw a graph using D3 (v3) in a WebWorker

The goal is to draw a graph using D3 (v3) in a WebWorker (Rickshaw would be even better).
Requirement #1:
The storage space for the entire project should not exceed 1 MB.
Requirement #2:
Internet Explorer 10 should be supported
I already tried to pass the DOM element to Webworker.
This brought the following error message:
DOMException: Failed to execute 'postMessage' on 'Worker': HTMLDivElement object could not be cloned.
var worker = new Worker( 'worker.js' );
worker.postMessage( {
'chart' : document.querySelector('#chart').cloneNode(true)
} );
The GitHub user chrisahardie has made...
a small proof on concept showing how to generate a d3 SVG chart in a
web worker and pass it back to the main UI thread to be injected into
a webpage.
https://github.com/chrisahardie/d3-svg-chart-in-web-worker
He integrated jsdom into the browser with Browserify.
The problem:
The script has almost 5 MB, which is too much memory requirements for the application.
So my question:
Does anyone have experience in solving the problem or has any idea how the problem can be solved and the requirements can be met?
The Web Workers don't have access to the following JavaScript objects: The window object, The document object and The parent object. So, all we could do on that side would be to build something that could be used for quickly creating the DOM. The worker(s) could e.g process the datasets and do all the heavy computations, then pass the result back as a set of arrays. More details, you could check this article and this sample

Sonarqube Alert - New Major Issues since change previous analysis

I'm trying to create a notification in sonarqube (4.1.2) that will notify me whenever any new analysis found any new major issues. So I created an alert which is:
new major issues + change since previous analysis + is greater than 0 warning threshold and 0 error threshold
However I'm sometimes am not notify when there's a new major issue on the new analysis. I was wondering about how does this "new major issue" alert works?
Example:
I get major issue A and B in previous analysis. I rerun the analysis this time around after fixing A and B but I introduce major issue C. Will the new major issue be 1 (new major issue C) or -1 (C minus A and B)
New issues metric (major or whatever severity) counts the added issues, not the differential. So in your example, you'll get 1.
So if you've set:
new major issues + change since previous analysis + is greater than 0
warning threshold and 0 error threshold
, then you should see an alert in the dashboard of your project in that example.
Now, your question is about notification on alerts: this notification is sent when the alert level changes. So for example, when your project was OK (green) and passes to ERROR (red). In your example, this means that:
if your project was OK and you add 1 issue, then you'll get a notification that your project turned to RED
but if your project was always RED and you add 1 issue, then you'll get no notification because its alert level remains the same (RED)

ScheduledAgent and GeoCoordinateWatcher - how to make them work?

I'm trying to get GPS position via GeoCoordinateWatcher running in ScheduledAgent. Unfortunately only location I get is some old one, recorded when application was running. How to get current (latest) location in ScheduledAgent?
I have come across the same problem. Unfortunaty, this is intended behaviour according to the WP7.1 APIs
According to the documentation, "This API, used for obtaining the geographic coordinates of the device, is supported for use in background agents, but it uses a cached location value instead of real-time data. The cached location value is updated by the device every 15 minutes."
http://msdn.microsoft.com/en-us/library/hh202962(v=VS.92).aspx
My 2 Centlys.
it is probably becoz the GeoCoordinateWatcher takes some time (2 seconds or so) to get the new coordinate values and to lock to GPS or Cellular Mast or Wifi or whatever. And it will give you the last recordered position in the meantime.
So, try to hook to the following events
watcher.StatusChanged += new EventHandler< GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
watcher.PositionChanged += new EventHandler< GeoPositionChangedEventArgs< GeoCoordinate>>(watcher_PositionChanged);
where watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
and call the NotifyComplete(); in your "watcher_PositionChanged" event handler.

Any body have any luck with ShellTileSchedule?

Any body have any luck with ShellTileSchedule? I have followed the Microsoft example and still have gotten no where.
"How to: Update Your Tile Without Push Notifications for Windows Phone"
Has any one seen a complete example that works on a device or emulator?
Yes...I started with the sample at http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7Silverlight/UsingPushNotificationsLab/Exercise-2-Introduction-to-the-Toast-and-Tile-Notifications-for-Alerts/
and skipped immediately down to "Task 3 – Processing Scheduled Tile Notifications on the Phone." After that I had to wait about 1 hour, leaving the emulator running on my desktop (1 hour is the minimum update interval, indicated as such for "performance considerations."
_shellTileSchedule = new ShellTileSchedule
{
Recurrence = UpdateRecurrence.Interval,
Interval = UpdateInterval.EveryHour,
StartTime = DateTime.Now - TimeSpan.FromMinutes(59),
RemoteImageUri = new Uri(#"http://cdn3.afterdawn.fi/news/small/windows-phone-7-series.png")
};
Note that setting the StartTime to DateTime.Now - 59 minutes did nothing. It still waited a full hour for its first update. I could not find any mechanism to perform "go to this URI and Update yourself NOW!", other than calling out to a web service that tickles a Tile Notification.
as #avidgator said, you'll have to wait an hour.
i have written a tutorial on how to update the tile instantly here:
http://www.diaryofaninja.com/blog/2011/04/03/windows-phone-7-live-tile-schedules-ndash-executing-instant-live-tile-updates
basically it involves opening a push/toast update channel and then getting the phone to send "itself" a live tile update request. this will trigger the phone to go and get the tile "right now"
hope this helps
Are the channels necessary for this kind of update?
Is there a full code example of what has to be done to create an app that just updates its tile?
BTW: How about setting the Recurrence to UpdateRecurrence.Onetime and the StartTime to Now + 20 seconds for testing purposes?
I just got an tile update after an hour without channels and so on. So that answered my first question. But having to wait an hour while trying to develop an app is... unsatisfying.
It is easy. Just use the following code when you setup ShellTileSchedule.
ShellTile applicationTile = ShellTile.ActiveTiles.First();
applicationTile.Update(
new StandardTileData {
BackgroundImage = new Uri("www.ash.com/logo.jpg"),
Title = ""
});

Resources