Heading Issue in mission

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
air_n_water
Posts: 10
Joined: Sun Dec 21, 2014 1:48 am

Heading Issue in mission

Post by air_n_water »

I have a multiwii pro (red board from HK). I am using Multiwii2.3 navi-b7 and WinGUI2.3pre10b71. The heading will show correctly in the WinGUI, but if I set up a mission with SET HEADING points, the heading is 180 degrees off. I am using the internal mag and after calibration, the heading in the GUI is correct and I know where north is and everything is right.

If I set a mission with a SET_HEAD=180,it will turn to 0, if set for 220 degress, it will turn to 040.

So I checked to see how it should navigate without a set heading and I have this in config.h
#define NAV_CONTROLS_HEADING 1 
#define NAV_TAIL_FIRST 0
#define NAV_SET_TAKEOFF_HEADING 1

On a RTH, it will turn toward home, go to RTH position, turn to initial heading as expected.

Has anyone seen this, and how do you fix it?

User avatar
stronnag
Posts: 114
Joined: Thu Oct 24, 2013 9:32 pm
Location: New Forest, England
Contact:

Re: Heading Issue in mission

Post by stronnag »

This is a bug in the 2.3 navi-b7 firmware (I have not checked if it remains in the latest pre 2.4 r1729). mwp has long had an option to invert the heading in order to get the correct behaviour. You could always set the reciprocal heading in WinGui.

User avatar
stronnag
Posts: 114
Joined: Thu Oct 24, 2013 9:32 pm
Location: New Forest, England
Contact:

Re: Heading Issue in mission

Post by stronnag »

Issue raised, patch included and flight tested.

air_n_water
Posts: 10
Joined: Sun Dec 21, 2014 1:48 am

Re: Heading Issue in mission

Post by air_n_water »

Thanks Stronnag,
Reciprocal heading is what I have been using. Since I am a pilot I am used to doing that often. I will also try the patch.

Where do I find how to invert the heading in MWP?

Also after looking at the Set_head.dif I have one question.

original like
GPS_bearing(&GPS_coord[LAT],&GPS_coord[LON],&GPS_poi[LAT],&GPS_poi[LON],&GPS_directionToPoi);

DIF line
GPS_bearing(&GPS_coord[LAT],&GPS_coord[LON],&GPS_poi[LAT],GPS_poi[LON],&GPS_directionToPoi);

On the DIF line there appears to be a missing "&" on the GPS_poi[LON]. Should it be in there like the original line?

User avatar
stronnag
Posts: 114
Joined: Thu Oct 24, 2013 9:32 pm
Location: New Forest, England
Contact:

Re: Heading Issue in mission

Post by stronnag »

It's a context diff, the surrounding lines provide the context. The fix in GPS.cpp:483 (r1729) is to replace

Code: Select all

magHold = wrap_18000((GPS_directionToPoi*100)-18000)/100;

with

Code: Select all

magHold = wrap_18000((GPS_directionToPoi*100))/100;

air_n_water
Posts: 10
Joined: Sun Dec 21, 2014 1:48 am

Re: Heading Issue in mission

Post by air_n_water »

Thanks stronnag. I think the question I asked about the GPS_poi[LON] missing an & was just a typo after I check the set_head.dif file.

Post Reply