From e5d22e25ce87ae9fcf7ccb8d08348476449c851a Mon Sep 17 00:00:00 2001 From: Sanjuksha Nirgude Date: Wed, 9 Nov 2022 12:57:32 -0800 Subject: [PATCH] Fixing Z check in WideAngleCamera::Project3d Signed-off-by: Sanjuksha Nirgude --- gazebo/rendering/WideAngleCamera.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gazebo/rendering/WideAngleCamera.cc b/gazebo/rendering/WideAngleCamera.cc index ebab594303..20eed55311 100644 --- a/gazebo/rendering/WideAngleCamera.cc +++ b/gazebo/rendering/WideAngleCamera.cc @@ -773,7 +773,8 @@ ignition::math::Vector3d WideAngleCamera::Project3d( pos.x /= pos.w; pos.y /= pos.w; // check if point is visible - if (std::fabs(pos.x) <= 1 && std::fabs(pos.y) <= 1 && pos.z > 0) + if (std::fabs(pos.x) <= 1 && std::fabs(pos.y) <= 1 && + pos.z > -std::fabs(pos.w)) { // determine dir vector to projected point from env camera // work in y up, z forward, x right clip space