diff --git a/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp b/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp index fc1d0a18..e0f4d62f 100644 --- a/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp +++ b/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp @@ -49,8 +49,10 @@ void URRROS2CameraComponent::PreInitializePublisher(UROS2NodeComponent* InROS2No void URRROS2CameraComponent::SensorUpdate() { - SceneCaptureComponent->CaptureScene(); - CaptureNonBlocking(); + if (Render) { + SceneCaptureComponent->CaptureScene(); + CaptureNonBlocking(); + } } // reference https://github.com/TimmHess/UnrealImageCapture diff --git a/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h b/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h index 566c3cdd..89420d82 100644 --- a/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h +++ b/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h @@ -114,6 +114,9 @@ class RAPYUTASIMULATIONPLUGINS_API URRROS2CameraComponent : public URRROS2BaseSe UPROPERTY(EditAnywhere, BlueprintReadWrite) EROS2CameraType CameraType = EROS2CameraType::RGB; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool Render = true; + // ROS /** * @brief Update ROS 2 Msg structure from #RenderRequestQueue