Skip to main content

Allied Vision AVT-Prosilica camera controller with PLICO

Project description

PYSILICO: Prosilica AVT camera controller for Plico

Python package codecov Documentation Status PyPI version

pysilico is an application to control Allied AVT/Prosilica cameras (and possibly other GigE cameras) under the plico environment.

Installation

On client

On the client machine

pip install pysilico

On the server

On the server machine install the proprietary driver for the camera you want to control. Currently only AVT/Prosilica camera are supported through Vimba

For AVT / Prosilica

First install Vimba (that comes with the camera, or download Vimba SDK from AVT website). Assuming you have downloaded and unpacked Vimba6 in the Downloads folder on a Linux machine:

cd ~/Downloads/Vimba_6_0/VimbaGigETL/
sudo ./Install.sh

Check that the Vimba installation is successful (you may need to log out and log in) and that the camera is accessible by the server using VimbaViewer, the standalone application provided in Vimba SDK. You should be able to see the cameras reachable in the network and you should be able to stream images.

cd ~/Downloads/Vimba_6_0/Tools/Viewer/Bin/x86_64bit
./VimbaViewer

Then install the Vimba python wrapper. It is suggested to use a dedicated python virtual environment, like conda (check elsewhere how to install Anaconda and create a virtual environment).

Now you can install the Vimba python wrapper in the

cd ~/Downloads/Vimba_6_0/VimbaPython/
./Install.sh

The script Install.sh is to date not working with conda virtual envs. If you are using conda and the command above fails, the following should do the work :

cd ~/Downloads/Vimba_6_0/VimbaPython/Source
pip install .

Check that the installation is successfull by running the provided example, like the one below:

cd ~/Downloads/Vimba_6_0/VimbaPython/Examples
python list_cameras.py

The ouput shows that camera(s) has been properly detected.

(pysilico) lbusoni@argos:~/Downloads/Vimba_6_0/VimbaPython/Examples$ python list_cameras.py 
//////////////////////////////////////
/// Vimba API List Cameras Example ///
//////////////////////////////////////

Cameras found: 1
/// Camera Name   : GC1350M
/// Model Name    : GC1350M (02-2130A)
/// Camera ID     : DEV_000F3101C686
/// Serial Number : 02-2130A-06774
/// Interface ID  : eno2

Install server

As a last step you always have to install the package pysilico-server

pip install pysilico-server

Usage

Edit config file

The config file location depends on the operating system. In Ubuntu is /home/labot/.config/inaf.arcetri.ao.pysilico_server/pysilico_server.conf. When the server is started, it prints the config file location on standard output. Open the file and adapt it to your case.

In this example we want pysilico_server to control 2 cameras: a Manta 419 whose IP address is 192.168.29.189 used for a SH WFS, and a GC1350 (IP 192.168.29.194) used as PSF monitor. We reduce the streaming rate to 20MB/s in such a way that no packet will be lost during transfer to the server PC.

Every [cameraN] entry in the config file correspond to a pysilico server; you may add as many as you want. Every [cameraN] entry must have a camera= key linking to a [deviceX] entry that specifies the camera model, IP, etc.

[deviceManta419]
name= AVT Manta G-419B 5CA8
model= avt
ip_address= 192.168.29.189
streambytespersecond= 20000000
binning= 1

[deviceGC1350M]
name= AVT GC 1350M C686
model= avt
ip_address= 192.168.29.194
streambytespersecond= 20000000
binning= 1

[camera1]
name= SH WFS Ibis
log_level= info
camera= deviceManta419
host= localhost
port= 7100

[camera2]
name= PSF Ibis
log_level= info
camera= deviceGC1350M
host= localhost
port= 7110

Starting Servers

Start the servers with

pysilico_start

The servers are logging info in a dedicate log file. The log file name is printed on the standard output when the server is started.

On Ubuntu it can be in /home/labot/.cache/inaf.arcetri.ao.pysilico_server/log/camera1.log (and camera2.log and so on for the other servers)

Check in the log file that the server is properly running and communicating with the camera; it should periodically dump a line like "Stepping at xx Hz"

Using the client module

We assume that pysilico_server runs on '192.168.29.132'.

In a python terminal on a client computer on which pysilico has been installed:

In [1]: import pysilico

In [2]: cam_sh= pysilico.camera('192.168.29.132', 7100)

In [3]: cam_psf= pysilico.camera('192.168.29.132', 7110)

In [4]: frames= cam_sh.getFutureFrames(10)

Using the GUI

Run pysilico_gui

Stopping pysilico

To kill the servers run

pysilico_stop

More hard:

pysilico_kill_all

Administration Tool

For developers.

Testing

Never commit before tests are OK! To run the unittest and integration test suite cd in pysilico source dir

python setup.py test

Creating a Conda environment

Use the Anaconda GUI or in terminal

conda create --name pysilico

To create an environment with a specific python version (you need > 3.7 for Vimba)

conda create --name pysilico python=3.8

It is better to install available packages from conda instead of pip.

conda install --name pysilico matplotlib scipy ipython numpy

Packaging and distributing

  1. Update the version in version.py and commit
  2. Create a new release
  3. If you have the proper rights (see PYPI_API_TOKEN in Settings/Secrets), the Action automatically builds and uploads the wheel on pypi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysilico-0.21.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

pysilico-0.21.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file pysilico-0.21.0.tar.gz.

File metadata

  • Download URL: pysilico-0.21.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pysilico-0.21.0.tar.gz
Algorithm Hash digest
SHA256 e6f4447f6a97e796f64d3b57cd5f1350bae98b5842bb125b9c51bcb5d2c61b5d
MD5 5170c6556410c2db8ba6dd01a10706d0
BLAKE2b-256 aff88658b44a14d7fa1ab40d9d8d8c4613d982a87aec1304bdb1d5984f59e880

See more details on using hashes here.

File details

Details for the file pysilico-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: pysilico-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for pysilico-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 adf60ba20d052dc6bed764c3be91fdf33f6c0133e85fd6a0e2e293a58b3a179e
MD5 86a24248310c67e4afba097bbe93af51
BLAKE2b-256 e1215292d629dabb6f1140636d18c6ec819f617b6caf2dccca07034945060b92

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page