mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
SITL: fixed segv when running examples under SITL
This commit is contained in:
parent
46b1a2d117
commit
0078a68fbb
@ -151,7 +151,8 @@ bool Aircraft::parse_home(const char *home_str, Location &loc, float &yaw_degree
|
||||
float Aircraft::ground_height_difference() const
|
||||
{
|
||||
float h1, h2;
|
||||
if (sitl->terrain_enable && terrain &&
|
||||
if (sitl &&
|
||||
sitl->terrain_enable && terrain &&
|
||||
terrain->height_amsl(home, h1, false) &&
|
||||
terrain->height_amsl(location, h2, false)) {
|
||||
return h2 - h1;
|
||||
|
Loading…
Reference in New Issue
Block a user