MAVSDK-Java icon indicating copy to clipboard operation
MAVSDK-Java copied to clipboard

Having issues sending commands over TCP to drone

Open mfran89 opened this issue 6 months ago • 1 comments

Hey!

I had used mavsdk 1.3.1 and mavsdk 1.3.2 on android alittle while ago, primarily using it via the serial method and got it to work. I recently tried to use the tcp method of connecting to the drone and it looks like I am successfully able to connect to the drone, however I am having issues sending commands to it.

For example I used to send

List<MissionRaw.MissionItem> missionItems  = drone.getMissionRaw().downloadMission()
                    .doOnError(throwable -> Log.e(TAG, "Failed to get mission "+ throwable.getMessage())).blockingGet();

When I wanted to get a mission downloaded, but using TCP it blocks forever and doesnt return.

Similarly , when I want to get telemetry information like below :

 _disposables.add(drone.getTelemetry().getGpsInfo().subscribe(GPS
                -> {
            String numSats = GPS.getNumSatellites().toString();
            String fixType = GPS.getFixType().toString();
            Log.d(TAG, " gps fix and type" +GPS.getNumSatellites() + "  " + GPS.getFixType());
            }, throwable -> {
            Log.e(TAG, "Error occurred while getting GPS data " + throwable.getMessage(), throwable);
        }));

I would usually see asynchronous log cat messages show up about the gps information. Over TCP I do not see any messages coming through. What I do see via the debug data is that MAVSDK is printing the status text like MAVLink: emergency: L0: NOTICE! Auto adjusting transition alt! but when I try to get that telemetry streamed via the subscribe method I used above I do not see that stream for via my function.

Any thoughts and advice on this would be really helpful.

Thanks Mike

mfran89 avatar Aug 01 '24 00:08 mfran89