These are chat archives for dronekit/dronekit-android

30th
Mar 2016
mliu1212
@mliu1212
Mar 30 2016 01:08
@chaviw what does setting rc 3 1500 do exactly? When I do so the drone just takes off (past the altitude specified in the takeoff) and continues to raise in altitude.
chaviw
@chaviw
Mar 30 2016 01:10
@mliu1212 rc 3 1500 should set the controllers so it acts like the throttle control is in the middle (instead of all the way down)
mliu1212
@mliu1212
Mar 30 2016 01:42
@chaviw would there be any explanation why its overriding the takeoff command?
chaviw
@chaviw
Mar 30 2016 02:04
@mliu1212 What does your takeoff command look like? It should not affect that
mliu1212
@mliu1212
Mar 30 2016 02:04
@chaviw ControlApi.getApi(this.drone).takeoff(20, new AbstractCommandListener() {
            @Override
            public void onSuccess() {
                alertUser("Taking off...");
            }

            @Override
            public void onError(int i) {
                alertUser("Unable to take off.");
            }

            @Override
            public void onTimeout() {
                alertUser("Unable to take off.");
            }
        });
chaviw
@chaviw
Mar 30 2016 02:09
@mliu1212 How high does the vehicle take off to? The value your sending it is in meters in case you assumed it was feet
mliu1212
@mliu1212
Mar 30 2016 02:33
@chaviw It just continues to rise in altitude until I tell it to land
When is the appropriate time to enableManualControl? takeoff seems to work without enabling it but the the command from goTo doesn't seem to get sent without it. What disables manual control? I am asking because my vehicle keeps getting disarmed before actually completing the goTo command
pablomar13
@pablomar13
Mar 30 2016 20:58
Hi all! I'm trying to get live stream from my GoPro into my app, but for some reason the stream works for a couple of seconds and then it freezes. I haven't been toying with android for a long time so any help is welcome.
This is the code for the camera:
// Camera preview
final TextureView cameraView = (TextureView) findViewById(R.id.cameraView);
cameraView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
showToast("Video display is available.");
VideoStream.setEnabled(true);
}
        @Override
        public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {

        }

        @Override
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
            VideoStream.setEnabled(false);
            return true;
        }

        @Override
        public void onSurfaceTextureUpdated(SurfaceTexture surface) {

        }
    });

    //Setup the button to activate video streaming to the app
    VideoStream = (Button) findViewById(R.id.video_stream);
    VideoStream.setEnabled(false);
    VideoStream.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            showToast("Starting video stream.");
            startVideoStream(new Surface(cameraView.getSurfaceTexture()));
        }
    });
}

private void startVideoStream(Surface videoSurface) {
    SoloCameraApi.getApi(drone).startVideoStream(videoSurface, "", true, new AbstractCommandListener() {
        @Override
        public void onSuccess() {
            if (VideoStream != null)
                VideoStream.setEnabled(false);
        }

        @Override
        public void onError(int executionError) {
            showToast("Error while starting the video stream: " + executionError);
        }

        @Override
        public void onTimeout() {
            showToast("Timed out while attempting to start the video stream.");
        }
    });
}

private void stopVideoStream() {
    SoloCameraApi.getApi(drone).stopVideoStream(new SimpleCommandListener() {
        @Override
        public void onSuccess() {
            if (VideoStream != null)
                VideoStream.setEnabled(true);
        }
    });
}
mliu1212
@mliu1212
Mar 30 2016 23:49
are goTo commands not meant to run in succession? I cannot get my SITL drone to do more than one goTo command.