From c652932300550e9f79753e05965e53b3fff9823e Mon Sep 17 00:00:00 2001 From: mahimayoga Date: Fri, 20 Dec 2024 14:27:39 +0100 Subject: [PATCH] Remove local copy of vehicle attitude --- src/lib/collision_prevention/CollisionPrevention.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/collision_prevention/CollisionPrevention.cpp b/src/lib/collision_prevention/CollisionPrevention.cpp index 5e675b694461..b2c62d4906c6 100644 --- a/src/lib/collision_prevention/CollisionPrevention.cpp +++ b/src/lib/collision_prevention/CollisionPrevention.cpp @@ -400,12 +400,11 @@ CollisionPrevention::_addDistanceSensorData(distance_sensor_s &distance_sensor, int lower_bound = (int)round((sensor_yaw_body_deg - math::degrees(distance_sensor.h_fov / 2.0f)) / BIN_SIZE); int upper_bound = (int)round((sensor_yaw_body_deg + math::degrees(distance_sensor.h_fov / 2.0f)) / BIN_SIZE); - const Quatf q_vehicle_attitude(vehicle_attitude); const Quatf q_sensor(Quatf(cosf(sensor_yaw_body_rad / 2.f), 0.f, 0.f, sinf(sensor_yaw_body_rad / 2.f))); const Vector3f forward_vector(1.0f, 0.0f, 0.0f); - const Quatf q_sensor_rotation = q_vehicle_attitude * q_sensor; + const Quatf q_sensor_rotation = vehicle_attitude * q_sensor; const Vector3f rotated_sensor_vector = q_sensor_rotation.rotateVector(forward_vector);