mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 08:30:34 +08:00
adsb: Fix vertical separation check using wrong parameter
The collision detection incorrectly used crosstrack_separation (horizontal radius) for both horizontal and vertical checks. This resulted in the vertical separation threshold being ignored, creating a spherical detection zone instead of the intended cylindrical "hockey puck" shape. Fixed by using vertical_separation parameter for altitude difference check on line 80. The bug was likely introduced as a copy-paste error when creating the vertical check from the horizontal check template. The existing unit test uses identical values for both parameters (500.0f), which masked this bug. Testing: Code review. The existing unit tests pass, but they don't catch this bug due to using equal values. Future test improvement would be to use different crosstrack_separation and vertical_separation values. Signed-off-by: Tobias Fenner <tobyrfenner@gmail.com>
This commit is contained in:
committed by
Mathieu Bresciani
parent
d30fa62f40
commit
71f56df23b
@@ -77,7 +77,7 @@ void AdsbConflict::detect_traffic_conflict(double lat_now, double lon_now, float
|
||||
&& (fabsf(_crosstrack_error.distance) < _conflict_detection_params.crosstrack_separation);
|
||||
|
||||
const bool _crosstrack_separation_check = (fabsf(alt_now - _transponder_report.altitude) <
|
||||
_conflict_detection_params.crosstrack_separation);
|
||||
_conflict_detection_params.vertical_separation);
|
||||
|
||||
bool collision_time_check = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user