tweaked WP speed so long distances wont blow up equation.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2871 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jasonshort 2011-07-16 22:02:47 +00:00
parent b8f1fbe2fc
commit 01a8cec348
1 changed files with 3 additions and 2 deletions

View File

@ -149,7 +149,8 @@ void calc_rate_nav()
// Reduce speed on RTL // Reduce speed on RTL
//if(control_mode == RTL){ //if(control_mode == RTL){
waypoint_speed = min((wp_distance * 100), g.waypoint_speed_max.get()); int tmp = min(wp_distance, 50) * 100;
waypoint_speed = min(tmp, g.waypoint_speed_max.get());
waypoint_speed = max(waypoint_speed, 80); waypoint_speed = max(waypoint_speed, 80);
//}else{ //}else{
// waypoint_speed = g.waypoint_speed_max.get(); // waypoint_speed = g.waypoint_speed_max.get();