From dcd665a3f585e75f6025eaf15308866e3b0ff536 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 3 Jul 2024 21:39:21 +0000 Subject: [PATCH 1/2] Fix test Signed-off-by: Ian Chen --- src/BoundingBoxCameraSensor.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/BoundingBoxCameraSensor.cc b/src/BoundingBoxCameraSensor.cc index ced59079..e13d2b20 100644 --- a/src/BoundingBoxCameraSensor.cc +++ b/src/BoundingBoxCameraSensor.cc @@ -331,12 +331,14 @@ 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 + // Camera Info Msg this->PopulateInfo(sdfCamera); // Create the directory to store frames From e8faa66a6bbd1cad275a2f1a31ec1b357822ae05 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 3 Jul 2024 21:42:01 +0000 Subject: [PATCH 2/2] fix indentation Signed-off-by: Ian Chen --- src/BoundingBoxCameraSensor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BoundingBoxCameraSensor.cc b/src/BoundingBoxCameraSensor.cc index e13d2b20..7729945b 100644 --- a/src/BoundingBoxCameraSensor.cc +++ b/src/BoundingBoxCameraSensor.cc @@ -338,7 +338,7 @@ bool BoundingBoxCameraSensor::CreateCamera() sdfCameraCopy); this->UpdateLensIntrinsicsAndProjection(this->dataPtr->boundingboxCamera, *sdfCamera); - // Camera Info Msg + // Camera Info Msg this->PopulateInfo(sdfCamera); // Create the directory to store frames