From f534a315ea528ee0e4548dd3883c4e0793bd0fa2 Mon Sep 17 00:00:00 2001 From: Josh Henderson Date: Sat, 11 Sep 2021 06:35:38 -0400 Subject: [PATCH] AP_Proximity: use vector.xy().length() instead of norm(x,y) --- libraries/AP_Proximity/AP_Proximity_MAV.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Proximity/AP_Proximity_MAV.cpp b/libraries/AP_Proximity/AP_Proximity_MAV.cpp index 2936a315ae..babe855f06 100644 --- a/libraries/AP_Proximity/AP_Proximity_MAV.cpp +++ b/libraries/AP_Proximity/AP_Proximity_MAV.cpp @@ -259,7 +259,7 @@ void AP_Proximity_MAV::handle_obstacle_distance_3d_msg(const mavlink_message_t & // extract yaw and pitch from Obstacle Vector const float yaw = wrap_360(degrees(atan2f(obstacle.y, obstacle.x))); - const float pitch = wrap_180(degrees(M_PI_2 - atan2f(norm(obstacle.x, obstacle.y), obstacle.z))); + const float pitch = wrap_180(degrees(M_PI_2 - atan2f(obstacle.xy().length(), obstacle.z))); // allot to correct layer and sector based on calculated pitch and yaw const AP_Proximity_Boundary_3D::Face face = boundary.get_face(pitch, yaw);