ardupilot/ArduCopter/commands.pde

32 lines
814 B
Plaintext
Raw Normal View History

// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
// run this at setup on the ground
// -------------------------------
static void init_home()
{
2012-11-10 01:55:51 -04:00
set_home_is_set(true);
2014-03-31 04:07:46 -03:00
// copter uses 0 home altitude
Location loc = gps.location();
loc.alt = 0;
ahrs.set_home(loc);
2012-08-16 21:50:03 -03:00
inertial_nav.setup_home_position();
2014-02-27 22:16:33 -04:00
// log new home position which mission library will pull from ahrs
if (g.log_bitmask & MASK_LOG_CMD) {
AP_Mission::Mission_Command temp_cmd;
if (mission.read_cmd_from_storage(0, temp_cmd)) {
Log_Write_Cmd(temp_cmd);
}
2014-02-27 22:16:33 -04:00
}
2012-08-16 21:50:03 -03:00
// update navigation scalers. used to offset the shrinking longitude as we go towards the poles
scaleLongDown = longitude_scale(home);
scaleLongUp = 1.0f/scaleLongDown;
}