-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Compress data before sending #2128
Comments
currently my solution is to run the carla ros-bridge on my server. and then produce a compressed stream to subscribe to. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I spent some time on this one, and implemented a JPEG compression/decompression serializer. For a 1280x1024 frame size, the required bandwidth drops from 91 Mb/s to 13 Mb/s, i.e. from an unreasonable value to a reasonable one.When the server and the client are on different machines of the same ethernet network (or probably also on machines with a good internet connection), Carla works as well as when everything runs on the same machine. The drawback is an additional delay of ~13 ms (10ms for compression and 3ms for decompression). If you're interested by this I would need some help to clean the code (I'm not a C++ expert). I based the change on 0.9.9. |
@OlivierDelbeke I'd be interested in the jpeg compression/decompression feature if you want to share it (maybe put it in a branch?) |
@jimmyw404 Thanks for your interest. I tried to push it, but got a 403 error. |
@jimmyw404 and everyone else interested, I forked the project to my account and pushed my changes to a branch called "experimental/image_compression". I'm not sure that this is the right way to go, but at at least, the code is available. Only Linux is supported, and you have to put the jpeg libraries somewhere in the UE4 plugin directory ("Dependencies")) to get it compiled, but that should be all. |
@OlivierDelbeke Looks good to me! I think this is something that should be integrated into CARLA as an option to the RGB cameras, but until then this will save me some time. I see that you persisted the alpha channel in the RGB images, which is probably a good idea to avoid changing the nature of the data, but is that used for anything? I was surprised to see it in the RGB camera. |
The alpha channel is probably not necessary ; not sending it at all sounds like a good idea of improvement. The first thing the pygame-based carla clients do, is to strip that channel off (and it costs 3 ms per frame). |
I wonder is there any update on this issue? Has similar functions been added to the new releases? |
I don't think so. At least not in 0.9.13. |
@OlivierDelbeke |
|
Thanks, @kevin1zc |
@kevin1zc Thanks |
@PatrickFSLin Looks like we should go for v8. I have updated my script above. Also, you need to add the dependency in
inside the |
@kevin1zc |
@PatrickFSLin I don't have this error on my side. FYI, I'm using Ubuntu 20.04 and carla master branch. |
@kevin1zc |
I have tried this method of image compression several times. However, only once I can successfully build up and run, but with lack of libjpeg.so.8 in /usr/lib/x86_64-linux-gnu and the side effect is that I cannot open "Ubuntu Settings" with UI. Is there anyone tried image compression method successfully on Ubuntu 20.04 and carla master branch without any side effects? |
@PatrickFSLin That's weird since the code should not look for libjpeg under /usr/lib/x86_64-linux-gnu at all. Did you add this line |
@kevin1zc Yes, I am quite sure that I add I REALLY need this feature both for PC-PC and PC-(embedded platform) to test ADAS software @kevin1zc Thanks for your guide for resolving several issues I've encountered |
@kevin1zc |
Data that is sent to Python API is uncompressed, therefore connecting to a remote server running Carla requires a lot of bandwidth. In particular uncompressed camera data are very large, for example a 1920x1080 image occupies 8.3Mb.
It would be useful to have some compression before sending the data. A few ideas:
The text was updated successfully, but these errors were encountered: