These are chat archives for dronekit/dronekit-android

23rd
Jul 2016
Kelly Schrock
@kellyschrock
Jul 23 2016 13:58
Hey all, I have a question about Follow shots on the Solo. I'm using DroneKit-Android and putting the Solo into a Follow shot. It's working as expected in general, but sometimes after ending the shot, my gimbal is locked on a specific ground location. Specifically, the last lat/lng I sent it. Looking at the Solo's code (/usr/bin/shotManager.py), it looks like selecting SOLO_SHOT_NONE (analogous to SoloMessageShot.FREE_FLIGHT in DroneKit-Android) explicitly releases the gimbal, so I'm stumped as to why it keeps wanting to look at the last location. Is there something I need to do beyond sending SoloMessageShot.FREE_FLIGHT over MessageApi? The other shots I have (Orbit and Selfie) don't have this problem. Thanks!
pablomar13
@pablomar13
Jul 23 2016 16:24
@kellyschrock what I do to release the gimbal control is to call the following method:
GimbalApi.getApi(this.drone).stopGimbalControl(gimbalListener);
Kelly Schrock
@kellyschrock
Jul 23 2016 16:26
@pablomar13 I knew about that api, but didn't think it should be necessary to call it. I'm going to try it. If it gets me the results, it's fine with me. :-) Thanks!
Kelly Schrock
@kellyschrock
Jul 23 2016 16:44
@pablomar13 Hmmm, that didn't appear to work. I logged the result, and I got an error (COMMAND_DENIED). The interesting bit is that when it gets stuck, I can fly around in Loiter and the camera always tries to point at the last location. So I stop following over my front yard, the gimbal is stuck, and everywhere I fly, I'm pointing at that exact location (as long as I'm panned so it can point at it). So it looks like the last ROI is being saved somewhere. I thought of calling ControlApi.goTo(null) to perhaps set the last ROI to null. But looking at the DK-Android code, that would just cause a NullPointerException. So, still on the hunt.
Kelly Schrock
@kellyschrock
Jul 23 2016 17:26
Something that seems to make a bit of sense: When I exit Follow, shotManager.py enters APPSHOT_NONE (shotManager.py:enterShot()). While in there processing APP_SHOT_NONE, it calls del currController, kicking it out of scope so it's garbage-collected. I'm no Dr. Python, but that seems to imply that Follow is suddenly killed in that case, after sending the last SET_POSITION_TARGET_GLOBAL_INT command. So that seems like it would be leaving the last ROI in place, doesn't it? I know from experience that the only way to make it _stop staring at the last ROI is to either enter a different shot, or power-cycle the Solo. Seems like there should be some kind of self.currController.exit call shotManager could before killing the current shot, giving it a chance to clean up after itself. Just a thought.
pablomar13
@pablomar13
Jul 23 2016 18:20
@kellyschrock it would be no surprise to find that to restart some code, you'd have to power cycle Solo and restart your program. From my own experience, every time I tried to exit any configuration I applied to Solo, it would get stuck. So any code I do for Solo is linear... no going back: you mess up, you restart all. It sucks but after expending months trying to figure it out I decided to let it go.
Kelly Schrock
@kellyschrock
Jul 23 2016 19:54
Interesting... That hasn't been my experience up to now. I occasionally get a hiccup with the Gopro state, not often. I think that's as much the fault of the GoPro as anything. It occasionally locks up and has to have its battery pulled. In any case, I just took it out and flew around for about 45 minutes testing my code, and not once did it lock the gimbal. As soon as I exited the shot, it would let me mess with the gimbal again manually. So I don't know... it's inconsistent. I'm charging batteries, will try again soon.