Skip to content

Commit c08c447

Browse files
bresillayuokamoto
authored andcommitted
feat: add conditional rendering in scene capture logic (#336)
- Add a `Render` bool property to control scene capture execution. - Wrap the scene capture logic in a conditional check on `Render` to allow for selective rendering.
1 parent 96fda3b commit c08c447

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ void URRROS2CameraComponent::PreInitializePublisher(UROS2NodeComponent* InROS2No
4949

5050
void URRROS2CameraComponent::SensorUpdate()
5151
{
52-
SceneCaptureComponent->CaptureScene();
53-
CaptureNonBlocking();
52+
if (Render) {
53+
SceneCaptureComponent->CaptureScene();
54+
CaptureNonBlocking();
55+
}
5456
}
5557

5658
// reference https://github.com/TimmHess/UnrealImageCapture

Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ class RAPYUTASIMULATIONPLUGINS_API URRROS2CameraComponent : public URRROS2BaseSe
114114
UPROPERTY(EditAnywhere, BlueprintReadWrite)
115115
EROS2CameraType CameraType = EROS2CameraType::RGB;
116116

117+
UPROPERTY(EditAnywhere, BlueprintReadWrite)
118+
bool Render = true;
119+
117120
// ROS
118121
/**
119122
* @brief Update ROS 2 Msg structure from #RenderRequestQueue

0 commit comments

Comments
 (0)