mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 00:33:33 +08:00
HomePos: check corresponding validity before using data
This commit is contained in:
@@ -295,9 +295,11 @@ build_gps_response(uint8_t *buffer, size_t *size)
|
||||
memset(&home, 0, sizeof(home));
|
||||
orb_copy(ORB_ID(home_position), _home_sub, &home);
|
||||
|
||||
_home_lat = home.lat;
|
||||
_home_lon = home.lon;
|
||||
_home_position_set = true;
|
||||
if (home.valid_hpos) {
|
||||
_home_lat = home.lat;
|
||||
_home_lon = home.lon;
|
||||
_home_position_set = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Distance from home */
|
||||
|
||||
Reference in New Issue
Block a user