Skip to content
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

Proposal to replace RPClib with ZeroMQ #225

Open
SijmenHuizenga opened this issue Aug 13, 2020 · 3 comments
Open

Proposal to replace RPClib with ZeroMQ #225

SijmenHuizenga opened this issue Aug 13, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@SijmenHuizenga
Copy link
Member

SijmenHuizenga commented Aug 13, 2020

Currently communication to and from the simulator happens using the rpc protocol. The reason for this is that AirSim uses it and this project was forked from AirSim. I believe ZeroMQ is a better fit. Therefore I propose to replace RPC with ZeroMQ. Note that msgpack encoding stays unchanged when moving to ZeroMQ.

The main problem with RPC is that it is a request-reply protocol. This results in clients having to poll to stay up-to-day with the available data. For sensordata this results in delays:

An rpc example: a lidar running at 20hz will capture a point cloud every 0.05 second. This pointcloud is stored in memory within the simulator. A client (the ros bridge) requests the latest pointcloud from the simulator at 20hz. There is no way to sync this timer with the simulator timer. When the client requests the pointcloud, the pointcloud is already outdated up to 0.049999 second. This latency could be minimized by requesting sensordata more frequently, but having all sensors execute request at, let's say, 500hz is doomed to introduce new performance issues.

A publish/subscribe architecture would better fit what we are trying to do. The simulator would be able to push sensor data to clients as soon as it becomes available. Clients get lower latency sensordata.

Only few mature, open-source, cross-language, broker-free, networking libraries supporting both publish-subscribe and request-reply exist. From my googling I have come to believe ZeroMQ is the best option as it has the great documentation, seems easiest to use and performs great.

Before I start with a prototype to test the feasibility of ZeroMQ as a replacement for RPClib, I would like to hear if this plan in general makes sense to you. I would love to hear questions, remarks and concerns!

@SijmenHuizenga SijmenHuizenga added the enhancement New feature or request label Aug 13, 2020
@davidoort
Copy link
Member

I have no experience with ZeroMQ but the overarching argument you are making that a publish/subscribe method is more suitable is something I definitely agree with. How much work (time, #files that have to be changed) do you expect this replacement to be?

@mateusz-lichota
Copy link
Contributor

A long time has passed, but I believe there might be some value in restarting the discrussion on this topic. However, if we were going to use a pub/sub messaging system to communicate with the ROS bridge, why not use ROS itself? It literally is a pub/sub messaging system, so this would eliminate a level of indirection and instead of having UE4 <-> fsds_ros_bridge <-> autonomous system we'd have UE4 <-> autonomous system, at the cost of having to use ROS in the python client, but gaining substantial performance improvements. @wouter-heerwegh what's your opinion on that?

@wouter-heerwegh
Copy link
Member

I'm not sure that would work, as Unreal Engine would have to build the ROS code. You would probably need to send your data in some way to a node that will convert your data and send it to ROS topics. I do think it is best to use a pub/sub system, and it seems like ZeroMQ is quite nice. This also makes it so that if the python API is used, no ROS is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants