DroidPlanner / Tower

Ground Control Station for Android Devices
https://play.google.com/store/apps/details?id=org.droidplanner.android
Other
622 stars 554 forks source link

DPv2 not showing flight modes #719

Closed Skipirate closed 10 years ago

Skipirate commented 10 years ago

So lets try to summarize the bug:

Please let me know if the description above has some error. And also, give the exact version code you have flashed on ardupilot.

We will do our best to fix this issue, but first we need to be able to reproduce the bug. From what I understood this is a bug that's related only to DP working with the newer releases of arducopter. There is no relation to the tablets, board, telemetry. Just an incompatibility between firmware and software.

I hijacked @Skipirate post to keep the bug description up here. Bellow is the original message.

Hey guys, I have a apm 2.6 with the latest firmware on. In missionplanner everything works all just fine also with the 3dr module. Now i also got a samsung galaxy tab 3 where i have 3 planner installed on 1- droidplanner 2- droidplanner v2.0 3- andropilot In both the first and second app, i can plan missions,load them to the apm, the hub also works, batt voltage, arming... The thing that is not working on the tab is it doesnt reconize the flight modes or doesnt change them. Found a some videos where they can use kinda all the funtion. I also have been reading that it works with previous 2.9.1 firmware. and also some people who have this problem, but at the end theres not really a solution. Trying everything out i didnt tried the andropilot, started it and i just reconizes all right away, load the missions, ...... and it also changes the flight modes! So this one does work!! This tells me that its not the tablet, its not the new apm firmware, its not the 3dr module or connection. But i like the droidplanner the most i would be great if that one would work! anyone else has some idea or know some info about a fix... plz let me know https://www.youtube.com/watch?v=Mip6j9ZJTto grtz

tjhj commented 10 years ago

I have the same issue. This prevents me from entering guided or follow mode or land with DP1 or DP2.

Nexus 7 tablet here.

Skipirate commented 10 years ago

Hey tjhj,

Ha looks like i am not the only one!! would be so great to change the flight modes on the tablet!! but no one responded yet to the problem.

Could you check the andropilot on google play and see if it is that same because in andropilot it does reconize the guide,auto ,land modes...

I think there is something in the app and not the tablet devices.

grtz

tjhj commented 10 years ago

Hi Grtz,

The flight modes work for me in Andropilot, but not in DP1/2. It sucks because I can't use guided or follow with this flight mode bug going on.

Oddly in earlier with APM:Copter 3.0+ it was working but now with the latest release it's broken. It still works with 2.91b.

I agree it's not a tablet hardware issue, but it's still a question of where the bug is coming from. Is it really an APM:Copter bug (I feel not because andropilot works) or a Dp bug.

On Apr 16, 2014, at 10:48 AM, Skipirate notifications@github.com wrote:

Hey tjhj,

Ha looks like i am not the only one!! would be so great to change the flight modes on the tablet!! but no one responded yet to the problem.

Could you check the andropilot on google play and see if it is that same because in andropilot it does reconize the guide,auto ,land modes...

I think there is something in the app and not the tablet devices.

grtz

— Reply to this email directly or view it on GitHub.

Skipirate commented 10 years ago

Hi,

Yep indeed we have the same issue, i also want to be able to change to guide or auto mode on the tablet, but its not working in dp&dp2 for some bug reason. I read that also from the 2.9.1b, is there a possibility upload the older fimware!? didnt look into that, but that kinda retarded.

So thats why i posted this thread so the creator of the droidplanner can look into his source code, because with andropilot it does reconize it so that kinda makes me think that it is also not because of the new apm firmware, but realy something in the app.

Also posted it on rcgroups & diydrones, i also need/want this to work...

you got any idee how to get this message to the creator?!

grtz

m4gr3d commented 10 years ago

@Skipirate , github notifies when an issue is opened, so we're aware of the bug.

@Skipirate from what I gather, you're having the issue with apm 2.6 running firmware 2.9.1, right? @tjhj are you using the same hardware, and firmware version too?

I have an apm 2.6, so I'll try to see if i can replicate the bug you're seeing.

Thanks for the bug report!

tjhj commented 10 years ago

Hi,

Thanks for looking into this.

To clarify the bug does not happen on 2.9.1. But does happen on 3+

It seems related to that DP is showing unknown for the flight mode on the flight data display.

I reflashed an APM 2.5 and a 2.6 to the newest firmware and it still occurs on both. I am also seeing the bug with my tri, quad and y6. So it does not appear to be related to board version or frame configuration.

I am running a nexus 7 for the tablet. OTG connection.

If there is anything else I can do to help please let me know.

Thank you for your help and time.

On Apr 16, 2014, at 11:36 AM, Fredia Huya-Kouadio notifications@github.com wrote:

@Skipirate , github notifies when an issue is opened, so we're aware of the bug.

@Skipirate from what I gather, you're having the issue with apm 2.6 running firmware 2.9.1, right? @tjhj are you using the same hardware, and firmware version too?

I have an apm 2.6, so I'll try to see if i can replicate the bug you're seeing.

Thanks for the bug report!

— Reply to this email directly or view it on GitHub.

Skipirate commented 10 years ago

Hey ne0fhyk,

Yes thank for looking into this! I have an Apm 2.6 with ublox and compas with 3dr telemetrie.v2 Its running the arducopter V3.1+ hexa firmware.Using the galaxy tab3.

thx already for the response, hope the bug can get fixed that would be epic! Grtz

jmachuca77 commented 10 years ago

Is this issue related to issue #635 ?

Skipirate commented 10 years ago

Well it doesn't seem quite the same, our tables dont show or change flight modes throught the 3dr telemetrie, only through the switch control on the tx.

arthurbenemann commented 10 years ago

Hi guys, Im sorry for neglecting this thread for so long.

We will do our best to fix this issue, but first we need to be able to reproduce the bug. From what I understood this is a bug that's related only to DP working with the newer releases of arducopter. There is no relation to the tablets, board, telemetry. Just an incompatibility between firmware and software.

Go to the first comment on this issue for a better description of the bug.

Skipirate commented 10 years ago

Hey arthur!

No problem there is only so much time to go around he!

I dont know if you saw the video there you https://www.youtube.com/watch?v=Mip6j9ZJTto

How can i provide the exact code that is on my ardupilot? I am running Arducopter_hexa V3.1.2 right now.

Grtz

arthurbenemann commented 10 years ago

@Skipirate That clarify's the issue a little. I re-posted it at the top.

To get your excat firmware go to the "Terminal" window on Mission planner, and then on the CLI menu. You firmware version should show up there.

jmachuca77 commented 10 years ago

changing mode via tablet doesn't do nothing.

Not quite, for me using DP_2.2.5_RC1, I can switch the modes using the tablet. The APM and     pixhawk both running 3.1.2 will both change modes. However DP2 always displays "Stabilize" even though the copter actually changes modes.

mode changes from other sorces (RC controller) are not reported in the app.

 Correct.
Skipirate commented 10 years ago

this is the firmware version V3.1.2

apmfw

Skipirate commented 10 years ago

@jmachuca77

that even an extra point to take into the bug report.

tjhj commented 10 years ago

Hi all,

Thank you for looking into this,

I did some more checking to confirm the bug.

I am running 3.1.3 Apm copter.

The mode display and switching modes from the tablet work in mission planner and " the other droid based controller".

In DP 1 (1.2.0), the flight mode on the hub is displayed as unknown, selecting a mode on the tablet does nothing, changing modes on the remote does not change on dp1.

In DP2 (2.2.5_RC1) on connection the flight mode is displayed as stabilize mode regardless of what is selected on the remote. (Verified in mode with MP). Changing modes on the remote or on the tablet does nothing.

Thank you for your time, hard work, effort and great software.

arthurbenemann commented 10 years ago

Thank you all for helping to specify this report. I'm on a turbulent week, maybe I'll have some time to test this by end of next week. This bug is my top priority. On Apr 18, 2014 1:14 PM, "tjhj" notifications@github.com wrote:

Hi all,

Thank you for looking into this,

I did some more checking to confirm the bug.

I am running 3.1.3 Apm copter.

The mode display and switching modes from the tablet work in mission planner and " the other droid based controller".

In DP 1 (1.2.0), the flight mode on the hub is displayed as unknown, selecting a mode on the tablet does nothing, changing modes on the remote does not change on dp1.

In DP2 (2.2.5_RC1) on connection the flight mode is displayed as stabilize mode regardless of what is selected on the remote. (Verified in mode with MP). Changing modes on the remote or on the tablet does nothing.

Thank you for your time, hard work, effort and great software.

— Reply to this email directly or view it on GitHubhttps://github.com/DroidPlanner/droidplanner/issues/719#issuecomment-40820903 .

al1ik1 commented 10 years ago

Same issue, the modes do change correctly on the laptop but don't change on the tablet (seems to stick to stabilize- Nexus 7). I was using a tablet for the first time and thought i was doing something wrong...came back from flying and found this!

Thanks for your hard work!

AndKe commented 10 years ago

I have some extra electronics on board, I het flight mode from MavLink using: nav_mode = mavlink_msg_heartbeat_get_custom_mode(&msg); nav_mode is uint8_t

and the (multirotor)modes like: " Stabilize ", //0
" ACRO ", //1
" Altitude Hold ", //2
" AUTO ", //3
" Guided ", //4
" Loiter ", //5 " RTL ", //6 " Circle ", //7 " Position ", //8 " Land ", //9 " Optical Loiter ", //10 " Drift ", //11 " Sport ", //12

This method did not got affected by any version change. I would guess , unless you have an old/bad MavLink library - maybe you use something else than "mavlink_msg_heartbeat_get_custom_mode" that worked before ?

jcampen commented 10 years ago

I have the same issue. Although using the Latest Ardupilot32 Firmware on the Openpilot Revo hardware is working fine and not affected.

KerwoodDerby commented 10 years ago

Using DP2 and my cellphone, I collected telemetry over-the-air from a quadrotor running APM 3.1, and then from a hexrotor running APM 3.1.2. DP2 correctly reported the changing modes with the quadrotor, but not the hexrotor. I studied the .tlog files, and it seemed like the only difference in the heartbeat messages was the difference in MAV (2 for quad, 13 for hex). I also noticed that many of those reporting this problem are flying hexes.

jcampen commented 10 years ago

Good observation Derby and I confirm the same. Its working on my Quad but not my Hex. I Just tested this now by loading my Hex with the APM 3.1.3 Quad firmware and now DP2 is showing all the flight modes as working. So obviously its an issue with DP2 reading the Hex fw

Skipirate commented 10 years ago

Nice derby, gonna test this also wen i get home from work and see if it works with my Quad.

arthurbenemann commented 10 years ago

Derby, thats a great catch. Its probably why i never had this bug, I only have quads here.

Whats probably happening is that DP isnt recognizing the drone as a copter, thats why it refuses to interpret the mode changes. Em 21/04/2014 17:27, "KerwoodDerby" notifications@github.com escreveu:

Using DP2 and my cellphone, I collected telemetry over-the-air from a quadrotor running APM 3.1, and then from a hexrotor running APM 3.1.2. DP2 correctly reported the changing modes with the quadrotor, but not the hexrotor. I studied the .tlog files, and it seemed like the only difference in the heartbeat messages was the difference in MAV (2 for quad, 13 for hex). I also noticed that many of those reporting this problem are flying hexes.

— Reply to this email directly or view it on GitHubhttps://github.com/DroidPlanner/droidplanner/issues/719#issuecomment-40973340 .

jmachuca77 commented 10 years ago

I took a look at the code, without dbugging I cannot say for sure, but this might be the issue:

    public static ApmModes getMode(int i, int type) {
        for (ApmModes mode : ApmModes.values()) {
            if (i == mode.getNumber() & type == mode.getType()) {
                return mode;
            }
        }
        return UNKNOWN;
    }

I think the mode.getType will always return MAV_TYPE.MAV_TYPE_QUADROTOR, since the ApmModes enum is defined as such.

On the function getModeList which I guess is working correctly because the modes are listed, there is a work around:

    public static List<ApmModes> getModeList(int type) {
        List<ApmModes> modeList = new ArrayList<ApmModes>();

        if (isCopter(type)) {
            type = MAV_TYPE.MAV_TYPE_QUADROTOR;
        }

        for (ApmModes mode : ApmModes.values()) {
            if (mode.getType() == type) {
                modeList.add(mode);
            }
        }
        return modeList;
    }
jmachuca77 commented 10 years ago

Ok, I checked the above and making that change fixes the issue. I see mode changes from the remote on the tablet, and I can also change the mode and see the mode change reflected on the tablet. I am not set up yet to do pull requests and work with GIT, but the change needed should be as follows:

public static ApmModes getMode(int i, int type) {
        if (isCopter(type)) {
            type = MAV_TYPE.MAV_TYPE_QUADROTOR;
        }

        for (ApmModes mode : ApmModes.values()) {
            if (i == mode.getNumber() & type == mode.getType()) {
                return mode;
            }
        }
        return UNKNOWN;
    }

Hope this helps.

Skipirate commented 10 years ago

Well nice to hear jmachuca77 and that you also know to read the code or debug.I realy need to learn this too.because i know nothing about this code. Good that people like you guys respond and help!! Big tumbs up!!!!

jmachuca77 commented 10 years ago

Added Pullrequest #727

arthurbenemann commented 10 years ago

@Skipirate I'm sorry for the huge delay in solving this bug. It's just that I'm moving at the moment, and not having much time to focus on DP.

@jmachuca77 I'm glad you fixed the problem, I'll merge and release with the next revision.

Skipirate commented 10 years ago

@arthurbenemann No worries man! I know time is limited,... and that it will get fixed. :)

jcampen commented 10 years ago

Any news on this bug fix yet Arthur. If this fix is done but not released on the Gstore yet, how can I upgrade my fw?

arthurbenemann commented 10 years ago

@jcampen I`m delaying the release because there has been a huge branch (another pull) merged into master, so I want to do more testing before the release.

arthurbenemann commented 10 years ago

Hi guys, I have a release ready for testing at the following link: https://github.com/DroidPlanner/droidplanner/releases/download/Droidplanner_v2.3.1_RC1/DroidPlanner_2_3_1_RC1.apk

Please not that there could be some new bugs because of the big changes. But this issue should be fixed.

AndKe commented 10 years ago

2.3.1 Works great. - thanks.

arthurbenemann commented 10 years ago

Thanks for testing @AndKe, I'll close the issue.

And remember to update: https://github.com/DroidPlanner/droidplanner/releases/download/Droidplanner_v2.3.2_RC2/DP_2_3_2_RC2.apk