Skip to content

Commit

Permalink
feat: add conditional rendering in scene capture logic (#336)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
bresilla authored and yuokamoto committed Dec 2, 2024
1 parent d595b8c commit d776bf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d776bf5

Please sign in to comment.