Skip to content
Augusto Vega edited this page Dec 5, 2018 · 25 revisions

ERA Wiki

Introduction

This wiki captures some additional ERA development efforts that we consider worth being documented. This is "live" text that will keep evolving with new contributions.

Known Issues and Limitations

(work in progress)

ERA Profiling

GNU Radio Profiling

One alternative to profile GNU Radio flowgraphs is through its built-in performance counters. To enable them, GNU Radio has to be built from sources (including some additional dependencies) as explained below. These instruction build and install GNURadio 3.7.9.3, which looks like a stable "pre-3.8" version. We initially tried GNURadio 3.8, but there are some major changes between 3.7 and 3.8 (for example, the use of YAML instead of XML) that complicate the installation of other GNURadio projects.

  1. Install UHD (to be able to use USRP devices):

    sudo apt-get install libuhd-dev libuhd003 uhd-host
    
  2. Install Boost 1.57 from sources:

    cd ~/gnuradio/
    wget http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2 
    tar xjvf boost_1_57_0.tar.bz2
    cd boost_1_57_0/
    sudo apt-get update
    sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev libboost-all-dev
    ./bootstrap.sh --prefix=/usr/
    ./b2
    sudo ./b2 install
    
  3. Install GMP (GNU Multiple Precision Arithmetic Library):

    sudo apt-get install libgmp3-dev
    
  4. Install Apache Thrift 0.9.2 (the exact version 0.9.2 is required):

    cd ~/gnuradio/
    git clone https://github.com/apache/thrift.git thrift
    cd thrift
    git checkout 0.9.2
    ./bootstrap
    ./configure --prefix=/usr --with-cpp --with-python
    make
    sudo make install
    thrift --version
    
  5. Install GNU Radio:

    cd ~/gnuradio/
    wget https://www.gnuradio.org/releases/gnuradio/gnuradio-3.7.9.3.tar.gz 
    tar xzvf gnuradio-3.7.9.3.tar.gz
    cd gnuradio-3.7.9.3/
    mkdir build
    cd build/
    cmake -DENABLE_PERFORMANCE_COUNTERS=True -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=/usr/bin/python ../
    make && make test
    sudo make install
    

ROS Profiling

Lessons Learned

ROS Integration in GNU Radio OOT Blocks

During the creation of the ros-interface out-of-tree (OOT) module, we found difficulties to link this new module against the external ROS libraries. Actually, the compilation process run just fine; the problem appeared at run-time with the following Python message: AttributeError: 'module' object has no attribute 'ros_interface' The problem is due to improper linking against ROS libraries, which is fixed with appropriate directives in the CMakeLists.txt file in the root of the module as well as in the CMakeLists.txt file under lib/:

target_link_libraries(gnuradio-ros_interface ${roscpp_LIBRARIES} ... )

Similarly, we had to explicitly define the linking against the LZ4 compression library by creating a proper FindLZ4.cmake file under cmake/Modules/ and adding ${LZ4_LIBRARY} to target_link_libraries:

target_link_libraries(gnuradio-ros_interface ${roscpp_LIBRARIES} ${LZ4_LIBRARY} ... )

Making a GNU Radio OOT Block Behave like a ROS Node

When we converted the ros-interface OOT block into a ROS node, we found that the callback function to process incoming ROS messages was never called. This was because the ROS spin() or spinOnce() functions were never called since the ros-interface instance is not a standalone program with a main function to call them. We solved this by using an alternative version of spin(), called AsyncSpinner. Then, when the ros-interface block is instantiated, the asynchronous spinner is started in the background.

Miscellaneous

Clone this wiki locally