Going back to initial approach for uint16/float16 Optical Flow but need to do conversion on C++/Client side

This commit is contained in:
Shashank Singh 2021-05-30 19:07:55 +02:00 committed by Axel1092
parent 6b6f639e15
commit a087f2fb74
4 changed files with 22 additions and 2 deletions

View File

@ -423,7 +423,10 @@ class KeyboardControl(object):
world.constant_velocity_enabled = True
world.hud.notification("Enabled Constant Velocity Mode at 60 km/h")
elif event.key > K_0 and event.key <= K_9:
world.camera_manager.set_sensor(event.key - 1 - K_0)
index_ctrl = 0
if pygame.key.get_mods() & KMOD_CTRL:
index_ctrl = 9
world.camera_manager.set_sensor(event.key - 1 - K_0 + index_ctrl)
elif event.key == K_r and not (pygame.key.get_mods() & KMOD_CTRL):
world.camera_manager.toggle_recording()
elif event.key == K_r and (pygame.key.get_mods() & KMOD_CTRL):

9
Unreal/CarlaUE4/.ignore Normal file
View File

@ -0,0 +1,9 @@
.kdev4
.vscode
Content
Intermediate
Saved
Plugins/Carla/CarlaDependencies
Plugins/Carla/Content
Plugins/Carla/Intermediate
Plugins/CarlaExporter/Intermediate

View File

@ -0,0 +1 @@
Chrono OFF CarSim OFF

View File

@ -100,7 +100,14 @@ static void WriteFloatPixelsToBuffer_Vulkan(
FIntRect(0, 0, Rect.X, Rect.Y),
gFloatPixels,
FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX));
Buffer.copy_from(Offset, gFloatPixels);
TArray<float> IntermediateBuffer;
IntermediateBuffer.Reserve(gFloatPixels.Num() * 2);
for (FFloat16Color& color : gFloatPixels) {
IntermediateBuffer.Add((color.R.GetFloat() - 32767) * (2.0 / 65535));
IntermediateBuffer.Add((32767 - color.G.GetFloat()) * (2.0 / 65535));
}
Buffer.copy_from(Offset, IntermediateBuffer);
}
// =============================================================================