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);