diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..49c815e0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,53 @@ +name: Create a pull request to other versions + +on: + pull_request: + branches: + - devel + - UE5.2 + - UE5.3 + types: ["closed"] + + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + create_pr: + runs-on: ubuntu-latest + name: create_pr to other branchs + if: github.event.pull_request.merged == true + strategy: + matrix: + version: + - devel + - UE5.2 + - UE5.3 + steps: + - name: Checkout + uses: actions/checkout@v4 + if: matrix.version != github.base_ref + with: + ref: ${{ matrix.version }} + - name: Debug + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo ${{ matrix.version }}, ${{ github.base_ref }}, $GITHUB_SHA. ${{ github.event.pull_request.user.login }} + - name: Cherry pick and create PR + if: matrix.version != github.base_ref + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 + with: + branch: ${{ matrix.version }} + labels: | + cherry-pick + reviewers: | + ${{ github.event.pull_request.user.login }} + token: ${{ secrets.GITHUB_TOKEN }} + cherry-pick-branch: auto_created_${{ matrix.version }}_${{ github.sha }} + title: '[cherry-pick to ${{ matrix.version }} from ${{ github.base_ref }}] ${{ github.event.pull_request.title }}' + body: 'Cherry picking ${{ github.event.pull_request.title }} onto this branch' diff --git a/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp b/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp index 8acabc7f..fc1d0a18 100644 --- a/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp +++ b/Source/RapyutaSimulationPlugins/Private/Sensors/RRROS2CameraComponent.cpp @@ -2,6 +2,8 @@ #include "Sensors/RRROS2CameraComponent.h" +#include "BufferVisualizationData.h" + URRROS2CameraComponent::URRROS2CameraComponent() { // component initialization @@ -20,6 +22,14 @@ void URRROS2CameraComponent::PreInitializePublisher(UROS2NodeComponent* InROS2No SceneCaptureComponent->FOVAngle = CameraComponent->FieldOfView; SceneCaptureComponent->OrthoWidth = CameraComponent->OrthoWidth; + if (CameraType == EROS2CameraType::DEPTH) + { + FWeightedBlendable blendable(1.0f, GetBufferVisualizationData().GetMaterial(TEXT("SceneDepth"))); + CameraComponent->PostProcessSettings.WeightedBlendables.Array.Add(blendable); + SceneCaptureComponent->PostProcessSettings = CameraComponent->PostProcessSettings; + SceneCaptureComponent->CaptureSource = ESceneCaptureSource::SCS_FinalColorHDR; + } + RenderTarget = NewObject(this, UTextureRenderTarget2D::StaticClass()); RenderTarget->InitCustomFormat(Width, Height, EPixelFormat::PF_B8G8R8A8, true); SceneCaptureComponent->TextureTarget = RenderTarget; diff --git a/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h b/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h index fe5f7cc1..566c3cdd 100644 --- a/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h +++ b/Source/RapyutaSimulationPlugins/Public/Sensors/RRROS2CameraComponent.h @@ -33,6 +33,13 @@ struct FRenderRequest FRenderCommandFence RenderFence; }; +UENUM(BlueprintType) +enum class EROS2CameraType : uint8 +{ + RGB UMETA(DisplayName = "RGB"), + DEPTH UMETA(DisplayName = "Depth") +}; + /** * @brief ROS 2 Camera component. Uses USceneCaptureComponent2D. * @@ -104,6 +111,9 @@ class RAPYUTASIMULATIONPLUGINS_API URRROS2CameraComponent : public URRROS2BaseSe UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 QueueSize = 2; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + EROS2CameraType CameraType = EROS2CameraType::RGB; + // ROS /** * @brief Update ROS 2 Msg structure from #RenderRequestQueue