ardupilot/APMrover2/navigation.cpp
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00

35 lines
864 B
C++

// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "Rover.h"
//****************************************************************
// Function that will calculate the desired direction to fly and distance
//****************************************************************
void Rover::navigate()
{
// do not navigate with corrupt data
// ---------------------------------
if (!have_position) {
return;
}
if ((next_WP.lat == 0)||(home_is_set==false)){
return;
}
// waypoint distance from rover
// ----------------------------
wp_distance = get_distance(current_loc, next_WP);
if (wp_distance < 0){
gcs_send_text_P(MAV_SEVERITY_CRITICAL,"<navigate> WP error - distance < 0");
return;
}
// control mode specific updates to nav_bearing
// --------------------------------------------
update_navigation();
}