Skip to content

Commit

Permalink
Merge pull request #3938 from saihv/PR/OpticalFlow
Browse files Browse the repository at this point in the history
Optical flow camera
  • Loading branch information
zimmy87 authored Nov 17, 2021
2 parents e692a6f + 4e3f875 commit f29f399
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
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

0 comments on commit f29f399

Please sign in to comment.