mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fixing possible safety issue with altitude
This commit is contained in:
parent
ed2029b5d4
commit
fbd2edaae5
@ -449,10 +449,12 @@ MissionBlock::set_follow_target_item(struct mission_item_s *item, float min_clea
|
||||
|
||||
item->lat = target.lat;
|
||||
item->lon = target.lon;
|
||||
item->altitude = target.alt + _navigator->get_home_position()->alt;
|
||||
item->altitude = _navigator->get_home_position()->alt;
|
||||
|
||||
if (((min_clearance > 0.0f) && (item->altitude < _navigator->get_home_position()->alt + min_clearance)) || PX4_ISFINITE(target.alt)) {
|
||||
item->altitude = _navigator->get_home_position()->alt + min_clearance;
|
||||
if (min_clearance > 0.0f) {
|
||||
item->altitude += min_clearance;
|
||||
} else {
|
||||
item->altitude += 8.0f; // if min clearance is bad set it to 8.0 meters (well above the average height of a person)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user