From ad95288dde22d86ba90d0cc480125002eff45f8d Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 4 Jul 2024 00:28:41 -0700 Subject: [PATCH] Fix boundingbox_camera integration test (#443) Signed-off-by: Ian Chen --- src/BoundingBoxCameraSensor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/BoundingBoxCameraSensor.cc b/src/BoundingBoxCameraSensor.cc index ced59079..7729945b 100644 --- a/src/BoundingBoxCameraSensor.cc +++ b/src/BoundingBoxCameraSensor.cc @@ -331,11 +331,13 @@ bool BoundingBoxCameraSensor::CreateCamera() this->AddSensor(this->dataPtr->boundingboxCamera); this->AddSensor(this->dataPtr->rgbCamera); + // use a copy so we do not modify the original sdfCamera + // when updating bounding box camera + auto sdfCameraCopy = *sdfCamera; this->UpdateLensIntrinsicsAndProjection(this->dataPtr->rgbCamera, - *sdfCamera); + sdfCameraCopy); this->UpdateLensIntrinsicsAndProjection(this->dataPtr->boundingboxCamera, *sdfCamera); - // Camera Info Msg this->PopulateInfo(sdfCamera);