Giter Site home page Giter Site logo

Rospix

  • ROS package for interfacing Timepix detectors on FitPIX-compatible (Advacam) or USB Lite-compatible (UTEF) readouts.
  • Allows measuring with multiple sensors simulatenously.
  • To be able to use it, install Linux OS compatible with ROS (Indigo or newer).
  • Install ROS and FTDI drivers, see section Prerequisities.

Prerequsities

FTDI drivers

Get the drivers:

sudo apt-get install "libftdi-*"

Create file 99-ftdi-sio.rules with following lines

ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666",  RUN+="/bin/sh -c '/sbin/rmmod ftdi_sio && /sbin/rmmod usbserial'"
ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0666",  RUN+="/bin/sh -c '/sbin/rmmod ftdi_sio && /sbin/rmmod usbserial'"
ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="0666",  RUN+="/bin/sh -c '/sbin/rmmod ftdi_sio && /sbin/rmmod usbserial'"

and place it in /etc/udev/rules.d/

Installing ROS

Follow tutorials on http://wiki.ros.org/kinetic/Installation/Ubuntu ... the core is extracted in following commands:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full python-catkin-tools ros-kinetic-cv-bridge
apt-cache search ros-kinetic
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

Connecting to Timepix interface

Firstly, find a unique ID of your Timepix interface. Connect it to your computer and run:

roslaunch rospix list_device

A list of device names will appear. Copy the insides of double commas, corresponding to your interface. It is supposed to look similar to: Medipix2 ver 1.32 sn: 1096. Create a config yaml (or modify the example in config/) file with following contents:

# dont forget to update this number according to following contents
number_of_detectors: 1

sensor_0: # the names are fixed, just the number change

  # by this name the device is found, run "roslaunch rospix list_devices" to find it
  name: 'Medipix2 ver 1.32 sn: 1096'

  # location of the equalization file
  # location is relative to a directory specified in launch file
  equalization: 'lite_rigaku.bpc' # *.bpc is needed

  # print percentage of sensor exposure time to real time
  print_utilization: true

  defaults:
    threshold: 340    # [-]
    bias: 10.0        # [Volt]
    exposure: 1.0     # [second]
    mode: 1           # [0 = MPX, 1 = TOT]

    # dacs can be found in calibration protocol (or equalization protocol)
    dacs: [1,100,255,127,127,0,340,7,130,128,80,85,128,128]

Secondly, place a pixel configuration matrix (equalization matrix) into equalizations/ folder.

Lastly launch the node using launch file example test.launch in launch/. It loads the example config file and sets the equalization directory.

roslaunch rospix test.launch
<launch>

  <!-- launch the node -->
  <node name="rospix" pkg="rospix" type="rospix" output="screen">

    <!-- load config from config file -->
    <rosparam file="$(find rospix)/config/test.yaml" />

    <!-- specify where should the node look for equalization matrices -->
    <param name="equalization_directory" value="$(find rospix)/equalizations/" />

    <!-- PUBLISHERS -->
    <remap from="~status" to="~status" />

  </node>

</launch>

Dummy detectors

The node allows creating ("connecting") dummy detectors. Any number of dummy detectors can be connected, even while real detectors are present. Here is an example of config file record for an dummy detector:

sensor_1:

  name: 'dummy'

  photon_flux: 100            # [photons/s], whole number
  simulate_background: true   # should we simulation radiation background?
  n_images: 20                # how many images of radiation background do we have?

  defaults:
    exposure: 1.0             # [seconds]

Images for creating artificial radiation background are located in the dummy subfolder. If anyone should provide their own additional images, copy them there and adjust n_images accordingly.

Interacting with the interfaces

After connecting to the devices, a message is published on

/rospix/status

reporting how many interfaces have been successfully opened. Namespaces will appeare for the opened, named as follows:

/rospix/sensor_0/...
/rospix/sensor_1/...
...

Following services provide control over some basic operations:

/rospix/sensor_0/do_batch_exposure
/rospix/sensor_0/do_continuous_exposure
/rospix/sensor_0/do_single_exposure
/rospix/sensor_0/interrupt_measurement
/rospix/sensor_0/set_bias
/rospix/sensor_0/set_exposure_time
/rospix/sensor_0/set_mode
/rospix/sensor_0/set_threshold
...
/rospix/sensor_1/...

Resulting images are published at

/rospix/sensor_0/image
/rospix/sensor_...

as a topic containing:

time stamp
float64 exposure_time
float64 bias
int32 threshold
string interface
int32 mode
int16[65536] image

Sample ROS nodes for control and visualization

Sample applications can be found in the rospix/utils repository.

References

  1. T. Baca, D. Turecek, R. McEntaffer and R. Filgas, Rospix: Modular Software Tool for Automated Data Acquisitions of Timepix Detectors on Robot Operating System, Journal of Instrumentation 13(11):C11008, 2018.

Acknowledgements

The work has been done on behalf of Medipix2 collaboration and is currently supported by the Czech Science Foundation project 18-10088Y and by Czech Technical University grant no. SGS17/187/OHK3/3T/13.

rospix's Projects

classification icon classification

ROS node for classification of particle tracks from Timepix detectors.

gazebo_rad_source icon gazebo_rad_source

A simulated radiation source for Gazebo/ROS simulator and Timepix detectors.

rospix icon rospix

ROS package for interfacing with Timepix sensors.

rospix3 icon rospix3

ROS interface for Timepix3 devices on Advacam hardware interface.

rospix_utils icon rospix_utils

Utilities for basic processing and control of the Rospix ROS node.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.