Mission Planner Log Download Form [is Arducopter] check box issue
If a user does not check the Is Arducopter check box in the Log Download form (because they don't know what it is for or do not see it) And... if GPS is not enabled in Logging then the firmware value in config.xml gets changed from ArduCopter2 to ArduPlane after a log download and exit from Mission Planner.
Side Effect. I think the fix below will also solve this side effect.
- connect usb to arducopter
- download a log without GPS and do not check the box (casues change of firmware in MainV2.comPort.MAV.cs.firmware)
- select Flight Data
- Connect
- Many of the items in status are no longer updated. (radio and others) I suspect MP expecting arduplane, APM sending Arducopter?
- Disconnect then Connect may or may not resolve. Go to Configure and back to Flight Data resolves issue.
Cause: In sub processLine(string line) the check of CHK_Arducopter.Checked changes firmware to ArduPlane and the tests for "GPS" lines later in the sub never happen. Exiting MP then changes config.xml to ArduPlane.
Fix. I am not sure why the check box was added as any change to the frimware setting is only used in the writeKML () routine. One way to fix is to use a temporary to do the check of GPS on download and use that temporary in the writeKML() routine.
Another way would be to add a line like this in Log.cs;. This would set per current users confix.xml or last connect to apm. for the case GPS is not being logged.
I leave the resolution to you as is pretty low priority :)
public Log()
{
InitializeComponent();
//------------------------------------------- Dennis Add ---------------------------------------------- if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) { CHK_arducopter.Checked = true; } //-------------------------------------------- Dennis end ------------------------------------------ }
I find is also useful to add these lines in processLine(..)
//GPS, 1, 15691, 10, 0.00, -35.3629379, 149.1650850, -0.08, 585.41, 0.00, 126.89
if (items[0].Contains("GPS") && items[2] == "1" && items[4] != "0" && items[4] != "-1" && lastline != line) // check gps line and fixed status
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduPlane;
//--------------------------- Add Dennis ----------------------------------------------------------------------
CHK_arducopter.Checked = false;
//--------------------------- end Dennis--------------------------------------------------------------
if (position[positionindex] == null)
position[positionindex] = new List
............................................................bla bla bla }
if (items[0].Contains("GPS") && items[4] != "0" && items[4] != "-1" && items.Length <= 9) // AC
{
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
//------------------------------------------------------------------Add Dennis -------------------------
CHK_arducopter.Checked = true;
//---------------------------------------------------------------------- End Dennis ------------------------
if (position[positionindex] == null)
position[positionindex] = new List
im not sure I realy see the fault.
Yes, if user checks the box, then there is no fault. So call it an enhancement to check the box for the user if her/his config.xml or last connect sets to Arducopter2.
Fault was user ignorance in my case. A Fix (enhancement) would avoid in future for other new users. This and the log browse issue you will fix in next release drove me crazy for a couple of weeks. I disabled GPS logging, flew some flights with my Copter and spent a few days browsing my logs. I did not even see the "Is Aruducopter check box" so browsing logs kept changing my setup to arduplane and the column names for my log matrix were for plane, not copter. Then I saw the check box and next wondered if I should check it or not - what would it do, Why do I need it Etc. I could find nothing in the forum or manual about that check box. Remember, not everyone has been tagging along with all the changes over many months.
Of course, I leave it to you
Thanks again for your hard work.
PS. If you have a small enhancement I could help with, let me know. I saw a request to let user select location of Logs (MP and downloads) storage. I could do that. but only if you feel OK with it. I could tackle other items not requiring a complete knowledge of MP. I like digging into code and have some time. I will be helping on the manuals some also.
Dennis
Thanks for the clarification Dennis, if only there where more like you!!! Ill see what I can do,
This should really in the mission planner's issue list: https://github.com/diydrones/MissionPlanner/issues
I'm closing this, I hope that's ok.