Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optical flow camera #3938

Merged
merged 3 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AirLib/include/common/ImageCaptureBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ namespace airlib
Segmentation,
SurfaceNormals,
Infrared,
OpticalFlow,
OpticalFlowVis,
Count //must be last
};

Expand Down
6 changes: 6 additions & 0 deletions PythonClient/airsim/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def SurfaceNormals(cls):
return 6
def Infrared(cls):
return 7
def OpticalFlow(cls):
return 8
def OpticalFlowVis(cls):
return 9

def __getattr__(self, key):
if key == 'DepthPlanner':
Expand All @@ -52,6 +56,8 @@ class ImageType(metaclass=_ImageType):
Segmentation = 5
SurfaceNormals = 6
Infrared = 7
OpticalFlow = 8
OpticalFlowVis = 9

class DrivetrainType:
MaxDegreeOfFreedom = 0
Expand Down
Binary file modified Unreal/Plugins/AirSim/Content/Blueprints/BP_PIPCamera.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Unreal/Plugins/AirSim/Source/PIPCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ APIPCamera::APIPCamera()
image_type_to_pixel_format_map_.Add(5, EPixelFormat::PF_B8G8R8A8);
image_type_to_pixel_format_map_.Add(6, EPixelFormat::PF_B8G8R8A8);
image_type_to_pixel_format_map_.Add(7, EPixelFormat::PF_B8G8R8A8);
image_type_to_pixel_format_map_.Add(8, EPixelFormat::PF_B8G8R8A8);
image_type_to_pixel_format_map_.Add(9, EPixelFormat::PF_B8G8R8A8);

object_filter_ = FObjectFilter();
}
Expand Down Expand Up @@ -70,6 +72,10 @@ void APIPCamera::PostInitializeComponents()
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("InfraredCaptureComponent"));
captures_[Utils::toNumeric(ImageType::SurfaceNormals)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("NormalsCaptureComponent"));
captures_[Utils::toNumeric(ImageType::OpticalFlow)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("OpticalFlowCaptureComponent"));
captures_[Utils::toNumeric(ImageType::OpticalFlowVis)] =
UAirBlueprintLib::GetActorComponent<USceneCaptureComponent2D>(this, TEXT("OpticalFlowVisCaptureComponent"));

for (unsigned int i = 0; i < imageTypeCount(); ++i) {
detections_[i] = NewObject<UDetectionComponent>(this);
Expand Down