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?
Heading Issue in mission
Re: Heading Issue in mission
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.
Re: Heading Issue in mission
Issue raised, patch included and flight tested.
-
- Posts: 10
- Joined: Sun Dec 21, 2014 1:48 am
Re: Heading Issue in mission
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?
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?
Re: Heading Issue in mission
It's a context diff, the surrounding lines provide the context. The fix in GPS.cpp:483 (r1729) is to replace
with
Code: Select all
magHold = wrap_18000((GPS_directionToPoi*100)-18000)/100;
with
Code: Select all
magHold = wrap_18000((GPS_directionToPoi*100))/100;
-
- Posts: 10
- Joined: Sun Dec 21, 2014 1:48 am
Re: Heading Issue in mission
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.