Copter: log error if circle does not initialise correctly

This commit is contained in:
Randy Mackay 2016-04-29 09:47:34 +09:00
parent 85963cecb4
commit 3d31c3b936
2 changed files with 2 additions and 0 deletions

View File

@ -456,6 +456,7 @@ void Copter::auto_circle_movetoedge_start(const Location_Class &circle_center, f
if (!circle_center.get_vector_from_origin_NEU(circle_center_neu)) {
// default to current position and log error
circle_center_neu = inertial_nav.get_position();
Log_Write_Error(ERROR_SUBSYSTEM_NAVIGATION, ERROR_CODE_FAILED_CIRCLE_INIT);
}
circle_nav.set_center(circle_center_neu);

View File

@ -407,6 +407,7 @@ enum ThrowModeState {
// subsystem specific error codes -- navigation
#define ERROR_CODE_FAILED_TO_SET_DESTINATION 2
#define ERROR_CODE_RESTARTED_RTL 3
#define ERROR_CODE_FAILED_CIRCLE_INIT 4
// parachute failed to deploy because of low altitude or landed
#define ERROR_CODE_PARACHUTE_TOO_LOW 2