Skip to content

Commit

Permalink
Going back to initial approach for uint16/float16 Optical Flow but ne…
Browse files Browse the repository at this point in the history
…ed to do conversion on C++/Client side
  • Loading branch information
sshashank124 committed Jun 1, 2021
1 parent 602357c commit b8a0cef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 4 additions & 1 deletion PythonAPI/examples/manual_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ def parse_events(self, client, world, clock):
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):
Expand Down
9 changes: 9 additions & 0 deletions Unreal/CarlaUE4/.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.kdev4
.vscode
Content
Intermediate
Saved
Plugins/Carla/CarlaDependencies
Plugins/Carla/Content
Plugins/Carla/Intermediate
Plugins/CarlaExporter/Intermediate
1 change: 1 addition & 0 deletions Unreal/CarlaUE4/Config/OptionalModules.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Chrono OFF CarSim OFF
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

// =============================================================================
Expand Down

0 comments on commit b8a0cef

Please sign in to comment.