ArduPilot/ardupilot

Rover: Guided mode's wp_bearing is incorrect for some sub modes

Offen

#11.284 geöffnet am 07.05.2019

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (15.603 Forks)batch import
BUGRovergood first issue

Repository-Metriken

Stars
 (9.336 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 26T 16h) (166 gemergte PRs in 30 T)

Beschreibung

While working on this PR: https://github.com/ArduPilot/ardupilot/pull/11283 I found that Guided mode's wp_bearing valueis incorrect for some submodes.

Guided uses the mode.cpp's wp_bearing method which calls the navigation library. This works when _guided_mode == Guided_WP but is incorrect when it's Guided_HeadingAndSpeed, Guided_TurnRateAndSpeed and Guided_Loiter.

We should override the wp_bearing for Guided mode and then handle these other sub modes. For example, for Guided_HeadingAndSpeed we should use the target heading. For Guided_TurnRateAndSpeed we should return 0.0f. For Guided_Loiter we should call ModeLoiter's wp_bearing.

Contributor Guide