-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Implement an Optical Flow Camera #4104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 17 of 17 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @sshashank124)
LibCarla/source/carla/sensor/data/Color.h, line 68 at r1 (raw file):
} // operator rpc::Color16bit() const {
If this part does not work better to remove it, not left it commented
PythonAPI/examples/manual_control.py, line 1117 at r1 (raw file):
if OPENCV_INSTALLED: data_array = np.array(array[:, :, 0:2], dtype=np.float32) data_array[:, :, 0] = (data_array[:, :, 0] - 32767) * (2 * image.width / 65535)
I think this transformations are important to understand. Could you please describe in some comments what this operation does?
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/OpticalFlowCamera.cpp, line 17 at r1 (raw file):
AddPostProcessingMaterial( TEXT("Material'/Carla/PostProcessingMaterials/PhysicLensDistortion.PhysicLensDistortion'")); // AddPostProcessingMaterial(
These materials as they are not used we could just remove the comented lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @sshashank124)
PythonAPI/examples/manual_control.py, line 1012 at r1 (raw file):
self.sensors = [ ['sensor.camera.rgb', cc.Raw, 'Camera RGB', {}], ['sensor.camera.optical_flow', cc.Raw, 'Optical Flow', {}],
Maybe it is better to move this to the end of the list to not change the order of the old sensors
…mple to manual_control.py
…ed to do conversion on C++/Client side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 8 files at r2, 12 of 13 files at r3, 3 of 3 files at r4.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @sshashank124)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @sshashank124)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sshashank124)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r5.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sshashank124)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r6.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sshashank124)
Description
Adds a new Optical Flow Camera sensor. Transmits data as an image with uint16 channels where the first channel represents the x-component of the optical flow and the second channel represents the y-component. The value of each channel maps to a float range of [-2, 2] which means that the maximum optical flow that can be represented between two consecutive frames is twice the dimensions of the viewport (image width x height).
Also includes a fix for correctly transmitting 16-bit buffers with the Vulkan backend. This fix was implemented by @Axel1092
Where has this been tested?
Possible Drawbacks
PythonAPI/examples/manual_control.py
code for displaying output of Optical Flow sensor runs a bit slower than real-time.This change is