You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
811 B
29 lines
811 B
#include "Copter.h" |
|
|
|
// run_nav_updates - top level call for the autopilot |
|
// ensures calculations such as "distance to waypoint" are calculated before autopilot makes decisions |
|
// To-Do - rename and move this function to make it's purpose more clear |
|
void Copter::run_nav_updates(void) |
|
{ |
|
update_super_simple_bearing(false); |
|
|
|
flightmode->update_navigation(); |
|
} |
|
|
|
// distance between vehicle and home in cm |
|
uint32_t Copter::home_distance() |
|
{ |
|
if (position_ok()) { |
|
_home_distance = current_loc.get_distance(ahrs.get_home()) * 100; |
|
} |
|
return _home_distance; |
|
} |
|
|
|
// The location of home in relation to the vehicle in centi-degrees |
|
int32_t Copter::home_bearing() |
|
{ |
|
if (position_ok()) { |
|
_home_bearing = current_loc.get_bearing_to(ahrs.get_home()); |
|
} |
|
return _home_bearing; |
|
}
|
|
|