m4xw / rosettadrone_mini2

The Rosetta Drone 2 Project. Enable Mavlink and H.264 on DJI drones. Supports Mini 2 with Virt Stick Litchi CSV and DJI Waypoint class interpreters
BSD 3-Clause "New" or "Revised" License
28 stars 7 forks source link

app crashes after pressing "OPEN" #14

Open patogit opened 2 years ago

patogit commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. turn on the drone, the controller, and open Rosetta Drone on Sony Xperia XZ2 with Android 10 with WiFi connected to internet
  2. little messages appear in this order: "registering, pls wait..." then "Disconnected" then "Register Success" and OPEN turns blue.
  3. Tap "OPEN".
  4. App switches to landscape mode and instantly crashes.

This happens every single time.

m4xw commented 1 year ago

also note, if u plan to do ai stuff in-app, this place might be the most ideal for you https://github.com/m4xw/rosettadrone_mini2/blob/aefee606bfb88130740e67fcc279460633d283ef/app/src/main/java/sq/rogue/rosettadrone/MainActivity.java#L2178-L2192

ReadPixels and process, just remove the save stuff

stefansommer commented 1 year ago

excellent, thank you very much! The video stream is almost perfect now (still on my old phone, though. On the newer one, the video appears but is only updated every ~10s) My plan was to handle it from GC, but getting access to the video data was the first aim. Thanks for pointing to the right place in the code. If you get the stream to QGC to work at some point as well, it would be perfect of course. Let's keep in touch about the AI side. I'll keep you posted.

m4xw commented 1 year ago

Hm this fixed all stuff on my phone, weird you still have troubles. Maybe bitrate chokes the decoder? Fwiw one of the dozen intermediate android 13 updates was completely defunct for me without any good reason, so make sure you have the most recent patch level.

If you do the AI stuff from the GC side, you will have to deal with double the video processing workload on your phone. Old ones wont be happy. I am probably gonna adopt this as default soon, so I will fix GC streaming when I find some time. I also plan to rebase on latest upstream as some point.

Also just a hint: I noticed theres some QGC ver specific issues. I can check what ver I run when I get home. Didnt check against latest version in a while..

Also as extra note to what i quoted: mCodecOutputSurface is used when the app is for example minimized, so decoding continues in background mTranscodeOutputSurface is what actually shows on screen.

If you let me know the interface you want, I could prepare it. Update intervals, resolution (i assume u want to scale it down or training will take ages)

We can start a discussion about AI features in https://github.com/m4xw/rosettadrone_mini2/discussions