Copter: fixes to allow compiling without terrain support

This commit is contained in:
Randy Mackay 2016-04-22 10:58:36 +09:00
parent 74e02d2c82
commit 8e43be1511
2 changed files with 5 additions and 1 deletions

View File

@ -495,6 +495,7 @@ bool Copter::pre_arm_ekf_attitude_check()
// check we have required terrain data
bool Copter::pre_arm_terrain_check()
{
#if AP_TERRAIN_AVAILABLE && AC_TERRAIN
// succeed if not using terrain data
if (!terrain_use()) {
return true;
@ -504,6 +505,9 @@ bool Copter::pre_arm_terrain_check()
uint16_t terr_pending, terr_loaded;
terrain.get_statistics(terr_pending, terr_loaded);
return (terr_pending <= 0);
#else
return true;
#endif
}
// arm_checks - perform final checks before arming

View File

@ -202,7 +202,7 @@ void Copter::init_ardupilot()
// init Location class
Location_Class::set_ahrs(&ahrs);
#if AP_TERRAIN_AVAILABLE
#if AP_TERRAIN_AVAILABLE && AC_TERRAIN
Location_Class::set_terrain(&terrain);
#endif