kostakis52 / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Flight Mode Zero (0) not recognized in APM Planner - Mode Numbers also confusing in CLI #360

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Switch APM to setup position (switch towards servo headers). Open APM, 
connect, Go to CLI Terminal -> Setup -> Modes. Set up six flight modes. 
2. Note that in the CLI, modes are given numbers 0-5. This does not match the 
mode numbers shown in Config.h, where they are 1-6. I think these should be 
consistent to avoid confusion. 
3. Switch APM to Fly and reset. In APM Planner under "Autopilot Status", look 
at the current Mode. Flick your mode switch on the transmitter. You will be 
able to change all modes except for Mode Zero (0). On my setup, when I switch 
to Mode Zero (0) it actually just stays in Mode 1. 

What is the expected output? What do you see instead?
I should have six modes, but instead I have five. I don't know if this is 
related to the fact they are being numbered 0-5 instead of 1-6, or if that is a 
separate, but confusing, issue. 

What version of the product are you using? On what operating system?
OS: Windows XP SP3
APM Planner 1.05
APM 2.2
Radio is a JR9303 and I've set up my mode switch as shown in the 9303 tutorial 
(I wrote it). My mode PWMs have been checked and are spot on. 

Please provide any additional information below.
At the very least, I believe in the CLI Setup modes should be labeled 1-6, so 
they will match what is shown in Config.h and other places. This avoids 
confusion and is just good practice. 

Secondly, whether that is the cause or something else, I am not able to get 
"Mode Zero" to show up in APM Planner. 

Original issue reported on code.google.com by bjior...@gmail.com on 12 Jun 2011 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago
EDIT: I don't think there is any issue with Mode Zero (0). I think the issue I 
was having is that I put RTL in that slot, and for some reason, APM Planner 
only shows Loiter instead of RTL (see issue #363). 

However, I still think it would be nice if CLI could display the modes as 1-6 
instead of 0-5, this would save infinite confusion for those of us looking back 
and forth between the code in APM_Config and CLI. 

Original comment by bjior...@gmail.com on 12 Jun 2011 at 8:27

GoogleCodeExporter commented 9 years ago
what firmware version are you running? there was a shuffle of modes between 
some of the 2.x versions, the planner is correct with the latest build.

Original comment by Meee...@gmail.com on 15 Jun 2011 at 12:23

GoogleCodeExporter commented 9 years ago
Oops, that was a typo above - it should have said I am using 2.1.2 from May 29. 
It still shows Position 0 in CLI in both "Setup -> Modes" and "Test -> 
Modeswitch". 

I don't see how Planner would have much to do with it, CLI is just 
serial-printing whatever APM tells it. 

I've changed this in my own copy, it only requires modifying two lines. This 
doesn't change any of the functionality, just what CLI prints. 

In the Setup tab, change the print_switch function to (change is adding 1 to 
p): 

void
print_switch(byte p, byte m)
{
    Serial.printf_P(PSTR("Pos %d: "),p + 1);
    Serial.println(flight_mode_strings[m]);
}

In the Test tab, change the following line in the test_modeswitch function (I 
am not showing the whole function - again here, the change is adding 1 to 
switchPosition): 

...
Serial.printf_P(PSTR("Position %d\n"),  switchPosition + 1);
...

Original comment by bjior...@gmail.com on 15 Jun 2011 at 12:35

GoogleCodeExporter commented 9 years ago
To be clear - this fixes the annoyance that modes are displayed as 0-5 in CLI. 
It has nothing to do with the other issue I raised about Mode Zero not working. 
That one turned out to be bogus and is not a problem, at least for me. It is 
more rightly handled in issue #363

Original comment by bjior...@gmail.com on 15 Jun 2011 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by Meee...@gmail.com on 26 Jun 2011 at 7:12