Skip to content

stfc-aeg/aravis-detector

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aravis detector

Code CI Apache License

This project provides an Odin Data plugin that controls GenICam devices, an Odin Control server extension and a Python CLI tool. The plugin is ran within the the frame processor app in odin data and acquires buffers directly from the camera, circumventing the need for the frame receiver app. The Genicam interface is handled through the use of the Aravis library and each buffer captured from the camera passed through the normal Odin frame processor plugin chain making the detector compatible with other plugins designed to enhance the functionality of Odin Data.

https://observatory-sciences.github.io/aravis-detector/



Dependencies

The plugin has the following direct dependencies:

  • Aravis v0.8.31: used to interface with genicam cameras.
  • Cmake >= v2.9: used to generate the make files.
  • Odin-data v1.10.1: Aravis-detector inherits Odin's frameProcessor plugin structure and various utilities. Additionally, the frame processor app itself is required to run the plugin.
  • Odin-control v1.5.0: Used as a control server. This project extends its functionality to include the aravis-detector plugin and provides a python CLI to communicate with the odin frameProcessor using the control server.

Sub-dependencies:

Install

To build all sub-dependencies you can run the following in your shell:

Odin Data:

sudo apt -y update
sudo apt install cmake python3.10-venv
sudo apt install libboost-program-options-dev libboost-filesystem-dev \
 libboost-date-time-dev libboost-dev libboost-system-dev \
 libboost-test-dev libboost-thread-dev libboost-regex-dev \
 libzmq3-dev libpcap-dev liblog4cxx-dev libblosc-dev \
 libhdf5-dev librdkafka-dev

Aravis:

sudo apt install ninja-build build-essential meson libxml2-dev libglib2.0-dev \
 libusb-1.0-0-dev gobject-introspection libgtk-3-dev \
 gtk-doc-tools xsltproc libgstreamer1.0-dev \
 libgstreamer-plugins-base1.0-dev \
 libgstreamer-plugins-good1.0-dev\
 libgirepository1.0-dev gettext

Building Dependencies

(Optional) It's useful to save the plugin an its dependencies in same folder and create a virtual environment for the python server. Create a shortcut to this folder under the name "ODIN" as the rest of the guide utilizes it. Additionally you can create a temp folder for all the saved files. To do all this navigate to your desired location for the software and run the following:

mkdir odin_camera_driver && cd odin_camera_driver
sudo apt-get update
mkdir temp
python3 -m venv venv
source /path/to/venv/bin/activate

For the next step make sure you have installed git. It's important to use git clone for the odin-data library as you want to maintain the git history for versioning purposes. If you decide not to do this, you can download the tar version from git an unpack and build it, but after that you need to navigate into the build directory, include and manually edit the version.h file to a version of the form 1.1.1 , the exact numbers are not important. Do the same for Aravis-detector. Or simply run:

git clone https://github.com/AravisProject/aravis
git clone https://github.com/odin-detector/odin-control
git clone https://github.com/odin-detector/odin-data
git clone https://github.com/Observatory-Sciences/aravis-detector

Similar to "cwd" short cut, the commands written here use a prefix and it's shortcut:

 mkdir prefix
 PREFIX=$cwd/prefix

Build Odin-data

PREFIX=$cwd/prefix
cd $cwd/odin-data
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX ../cpp
make -j4 && make install
ls -la $PREFIX

Don't forget to modify the -j4 flag in make to however many cores you want to use (or leave it out altogether).

Install Odin Control

The use of a virtual python is recommended but not necessary:

source venv/bin/activate
pip install -e odin-control
odin_control

Build Aravis

Install Aravis and switch to version 0.8.30:

cd aravis
git checkout 96cea98

Build it using meson:

meson setup --prefix=$INSTALL_PREFIX --build.pkg-config-path $PC_ARAVIS build 
cd build
ninja
ninja install

To test your build:

meson test
cd src
arv-fake-gv-camera-0.8 -s GV02 -d all

This should run 7 tests with no errors and then you will activate the simulated camera provided by Aravis. To connect to the camera you can use the aravis app. If connected to a genicam you shou1ld be able to see it listed as well.

Build aravis-detector

Run the following code to build the plugin library in the same directory as the rest of Odin:

 cd $cwd/aravis-detector
 mkdir build && cd build
 cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DODINDATA_ROOT_DIR=$PREFIX ../cpp
 make -j4 && make install

Install the aravis server extension:

 source venv/bin/activate
 cd $cwd/aravis-detector
 pip install -e python

Install the Python CLI:

 source venv/bin/activate
 cd $cwd/aravis-detector/python
 pip install -e tools

Docs

Online documentation is available at: https://observatory-sciences.github.io/aravis-detector/

To install the documentation run the following (preferably in a venv)

pip install python[dev]
sphinx-autobuild -ET docs/ docs/build/html

The server should then be available at http://localhost:8000/

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.3%
  • C++ 19.8%
  • Python 13.1%
  • CMake 9.5%
  • CSS 3.8%
  • HTML 3.5%