-
Notifications
You must be signed in to change notification settings - Fork 3
PyAER Communication Module
PyAER has been a simple interface to DAVIS Camera. It's better than pure libcaer
, but less complicated than frameworks such as DV
and ROS
. What is missing from day-one is a communication module that can manage the activities between devices.
This feature has been considered for a long time and now it's here!
It's a ROS-like communication module that implements similar features such as roscore
, publisher
, subscriber
, roslaunch
, rostopic
.
It's implemented by using zeromq
's XPUB
and XSUB
. Specifically, I implemented Figure 13 in this chapter.
In one sentence, this module allows tossing messages between processes. Imagine you want to simultaneously record and display outputs from a DAVIS camera. You can first run a publisher to broadcast all the polarity events, frame events, and IMU events. Then one subscriber can record the data while another subscriber display outputs.
Thanks to the powerful zeromq
socket, you can construct a much more complex network than I just described.
Python sucks at threading and multi-processing. This is a known fact. The learning curve is too steep, the features are not as desired, there are locks, and I can go on. Most of all, I have never successfully written a multi-processing project in Python without making my code unreadable.
Another fact is there are many attempts and projects trying to improve multi-processing in Python because of the need for readability and scalability. I didn't go for those solutions because most of them aim for a super-computing scenario.
Finally, I decided to implement a ROS-like communication module that purposely creates a network among agents. But you may wonder "why wouldn't you use ROS instead?". And the answer is "it's too heavy for prototyping scenario". If you don't know ROS, you may spend a week or so to understand its rationale. And, even then you probably still quite confused about.. well, everything.
This is why I coded pyaer.comm
, a small module which you can basically deploy it almost everywhere (Raspberry Pi, Edge TPU, Desktop, Laptop, whatever with a decent *nix
based OS.
More importantly, this module does not limit to the use of pyaer
, you can basically use it like a mini-ROS and your life becomes brighter.