AP_DDS: pre-arm check service
[ardupilot.git] / ArduCopter / navigation.cpp
blob1cc66f2744fc78a4948c38a5d25543d7020a7f3f
1 #include "Copter.h"
3 // run_nav_updates - top level call for the autopilot
4 // ensures calculations such as "distance to waypoint" are calculated before autopilot makes decisions
5 // To-Do - rename and move this function to make it's purpose more clear
6 void Copter::run_nav_updates(void)
8 update_super_simple_bearing(false);
11 // distance between vehicle and home in cm
12 uint32_t Copter::home_distance()
14 if (position_ok()) {
15 _home_distance = current_loc.get_distance(ahrs.get_home()) * 100;
17 return _home_distance;
20 // The location of home in relation to the vehicle in centi-degrees
21 int32_t Copter::home_bearing()
23 if (position_ok()) {
24 _home_bearing = current_loc.get_bearing_to(ahrs.get_home());
26 return _home_bearing;