PyAER with Swig Bindings
Special thanks to iniLabs for making this possible.
The project is in its Beta development stage, please submit an issue if you need our help.
Check out the documentation for more help!
- Minimum installation effort
- Keep Python 2 and 3 in mind
- Clean, simple, easy to manage
- Well documented, human-readable code
$ bash <(curl -s https://raw.githubusercontent.com/duguyue100/pyaer/master/install-libcaer.sh)
NOTE: To build
libcaeron Windows, please follow this description.
NOTE: For more information, see
NOTE: From 0.1.0a18, we support eDVS, you will need to install
libserialportso that the package can work properly, follow the building instructions from here. Currently, this support is not built into the release since we are not clear how useful is this feature. If you are interested, you can build the project from scratch.
Directly install from pypi (RECOMMEND)
$ pip install pyaer
Install from source
$ git clone https://github.com/duguyue100/pyaer.git $ make install
Got a Linux?
libcaer relies on
libusb based driver, you won't be able
to access the camera unless fixing the
udev rules. Refer to details
$ bash <(curl -s https://raw.githubusercontent.com/duguyue100/pyaer/master/install-udev.sh)
The scripts folder provides some examples for you to play with:
dvs128-test: you need OpenCV to run this example, note that if you are on Mac, OpenCV's
waitKey()function may cause delay of displaying frames.
dvs128-glumpy: you need
glumpypackage to run this example.
glumpyis a fast visualization library based on OpenGL. We found it's very fast to render images. In our case, we use GLFW backend. If
glumpycouldn't find your installed GLFW on your system, make sure you set the
dvs240-test: you need OpenCV to run this example.
dvs346-test: you need OpenCV to run this example.
More examples are coming...
Yeah, you need SWIG
You only need to read this section if you are planning to compile
pyaer from source.
This repository uses SWIG to create Python bindings. And you will need to compile the latest SWIG from source. The reason is because current SWIG cannot handle some cases in libcaer, we made a modified SWIG for this purpose.
Install compilation dependency
$ sudo apt-get install automake $ sudo apt-get install bison
There might be other dependencies for compiling SWIG
$ git clone https://github.com/duguyue100/swig $ cd swig $ ./autogen.sh $ ./configure $ make $ sudo make install
For compiling SWIG with Python
$ ./configure --with-python=$(command -v python) --without-python3
The above is an example with Python 2, you can configure for Python 3 as well
$ ./configure --with-python=$(command -v python) --without-python2
Note: If you are not compile the SWIG with system Python distribution, it won't link to the custom Python automatically.
You will need to configure
LD_LIBRARY_PATHfor swig running properly.
Limitations and Notes
Current status of the project is meant for single device use. Potentially, this library supports multiple devices at the same time by giving concrete device names and serial numbers. Supporting and testing for multiple devices setup is in long-term plan, but we are not working on this right now.
Once the data stream is open, the data will be streamed through USB connection at certain publishing frequency (e.g. 100Hz). This is a hardware configuration, therefore you couldn't drop event packets by putting software-level delay. You can either skip processing the coming packets by some conditions or implement a queuing system that can do a particular dynamic fetching.
It's recommended to implement a multi-processing or multi-threading program so that each process or thread only deals with one particular task. The fetching of the event packets may be very fast, your program may be delayed if you are not carefully coping with this fact.
DYNAP is generally supported. We are currently looking for the correct bias configuration mechanism so that it can easily support the use of the device. We have mapped some core functions that are essential to device configuration.