Git Product home page Git Product logo

collision-avoidance-library's Introduction

DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

Collision Avoidance Library

Build Status Coverity Scan Build Status

A framework for testing and benchmarking collision avoidance strategies.

Requirements

Collision Avoidance Library (Coav) is developed having drones in mind, so when compiling the library without additional options, features related to benchmark and simulation will be OFF by default. This should be the preferred way when you want to ship the library on your drone target/product.

Library Features and Options

Collision Avoidance Library has support to following features that can be defined on compile time:

Feature/Option Compile Options Default Value
Intel RealSense support WITH_REALSENSE ON
Gazebo support WITH_GAZEBO OFF
Visual Debugger support WITH_VDEBUG OFF (depends on Gazebo)
Coav Tools WITH_TOOLS OFF
Compile code samples WITH_SAMPLES OFF

Build and Install

Method 1 - Embed 'coav-control' on an Intel Aero image

This method is recommended for those who want to use 'coav-control' on an Intel Aero Drone.

A Yocto layer containing recipes to build and install coav-control can be found on the repository under the folder 'meta-coav'. This layer can be easily added to to the image build by following the steps described by Intel Aero documentation here.

The recipe install the 'coav-control' utility tool as well an init script that runs the tool on start-up. You can change it's behavior by editing the script file at any point of the process that seems convenient to you (custom branch, custom recipe or changing the file on the drone itself).

Method 2 - Compile and Install yourself

This method is recommended for those who will run simulations and tests on the development environment instead of a real drone. It is also recommend for those actively writing the library code because makes it easier to switch binaries for tests during development. If targeting an Intel Aero drone, check additional instructions about taking advantage of Yocto's SDK support.

If you're using Ubuntu, before continuing please ensure you have the needed dependencies:

  • If you want to use Gazebo, ensure you go through the instructions available here and ensure you install the libgazebo8-dev package;
  • Install all build dependencies (the last two are needed to build librealsense):
sudo apt-get install git cmake libglm-dev python-future doxygen libusb-1.0-0-dev libglfw3-dev
  • Go through the steps to install librealsense (it does not support librealsense2) which can be found here

The project use CMake as build system and does not support in-tree build. As such, create a separate folder before building.

  1. Make sure you have initialized and updated all the required submodules at least once with:

    git submodule update --init --recursive
    
  2. Create a "build" folder and build the library using CMake as follows:

    mkdir build
    cd build
    cmake ..
    sudo make install
    cd -
    

    These instructions will build and install the targets on cmake's default install path (usually '/usr/local'). To modify the library options, the following syntax is used when issuing cmake:

    cmake .. -D<COMPILE_OPTION_1>=<OPTION_1_VALUE> -D<COMPILE_OPTION_2>=<OPTION_2_VALUE>
    

    Also, the following CMake options may be of value:

    Option Description
    CMAKE_INSTALL_PREFIX Set a custom installation path. This path is also used for dependency search.
    CMAKE_PREFIX_PATH Add paths to be searched when looking for dependencies

    A more complete explanation of those options can be found on CMake's Documentation.

    Example:

    • Search GLM and Mavlink on <custom_deps_path>
    • Change the install path to <custom_install_path>
    • Compile the library additional tools (coav-sim)
    cmake .. -DCMAKE_INSTALL_PREFIX=<custom_install_path> -DCMAKE_PREFIX_PATH=<custom_deps_path> -DWITH_TOOLS=ON
    

Testing Collision Avoidance Library with coav-control

Make sure that the library was compiled with 'Coav Tools' turned on. This will build a target coav-control that can be found in 'tools/coav-control/' inside the build folder.

coav-control can be used execute a simple collision avoidance system for a Mavlink controlled Quadcopter that is composed by: a sensor, a detection algorithm and a detection strategy. It needs interaction with an autopilot and a sensor to work, so it won't do much when executed alone.

The following will list the possible options for each component:

./coav-control --help

Example:

Run a collision avoidance system composed by:

  • Intel Realsense
  • Obstacle detector based on 'Blob extraction'
  • 'Stop' avoidance strategy
./coav-control -d DI_OBSTACLE -a QC_STOP -s ST_REALSENSE

Simulation and Automated tests

For information on how to make use of 'Collision Avoidance Library' on simulated environment and how to take advantage of tests automation via testbed, please refer to the Simulation Docs.

Deploying on Intel Aero

Intel Aero firmware is based on Yocto, so the Yocto SDK for Intel Aero will be used to properly compile Collision Avoidance Library for deploy on Intel Aero.

Instruction on how to build Intel Aero image and the associated SDK can be found on Intel Aero Wiki.

Intel Aero SDK will be missing one of the Collision Avoidance Library dependencies:

  • GLM

Since GLM is a "headers only" library, cmake just need to know where to find the headers in order to successfully "cross-compile" it. This will be done with "-DCMAKE_PREFIX_PATH" parameter as described by the instructions bellow.

Once Intel Aero SDK is successfully installed, the following instructions will configure the environment and compile the library:

source <SDK_PATH>/environment-setup-core2-64-poky-linux

mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH="<GLM_HEADERS_PATH>"
make

After a successful build, you can install Collision Avoidance Library in a temporary path:

make install DESTDIR=<TMP_PATH>

Pack everything:

cd <TMP_PATH>
tar cvf coav.tar *

Copy coav.tar to Intel Aero root dir and execute the following on Intel Aero:

[intel-aero]$ cd /
[intel-aero]$ tar xvf coav.tar

And Collision Avoidance Library should be successfully installed!

collision-avoidance-library's People

Contributors

anselmolsm avatar avinash-palleti avatar dakerfp avatar guiccbr avatar lfelipe avatar mbelluzzo-intel avatar rdower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collision-avoidance-library's Issues

Readme: s/testbed/coav-sim

  • Update Requirement list
  • Modify text about "testing the library. Explaing how to try it with coav-control
  • Once we have coav-sim up, change to explaing how to try it with coav-sim

Write a service to run coav-control on startup for Intel Aero

It worth reminds us that our "product" is the library and not coav-control. coav-control is great for development but too naive (a infinity loop as mainloop) to be a final product. We should state very clearly that this "service" is an example of how to automatically run a coav app on a drone.

Review library headers

Reorganize headers in a way that lib users can clearly understand what they get by including a header.

A more informative print function

Implement a special print_verbose() function to be used throughout the project based on this macro defined on mavlink_vehicles. This is useful to keep the style of verbose text-output of the library consistent and using only one method (printf or std::cout).

coav-control: List available detectors

Add an option argument to print a list of the possible detectors accepted by '-d' argument. This will be use by testbed so it knows all possible detectors it can use (to test all possible combinations on a near future), it will be easier and more robust than parse coav-control help text. Also we can figure out a way to tell what sensor that given detector needs so we can make sure we can use it on simulation.

$ coav-control --list-detectors
$ DI_OBSTACLE <info about sensor category here>
$ DI_POLAR_HIST

Testbed does not halt on error

Connection errors, for example, do not terminate the script. Living it to finish only in the occurrence of a fatal error or in the end of the timeout. We should try to detect those errors - taking an appropriate action - before continuing.

Detector: Improve simple detector logic

The way it is know is practically useless even for sense + stop. The drone will always stop because of the camera input noise. We should change the filter to detect some blobs instead of solely rely on single pixels of the depth map. Also very short distances needs to be filtered based on Depth Camera limitations.

Build: samples

After the cmake refactoring, samples aren't being built, at least for realsense=on gazebo=on

Build: librealsense on non-default path

Cmake found the lib, but I dont think that REALSENSE_INCLUDE_DIR in the compile line:

cmake:

-- Found REALSENSE: /home/murilo/root/include  
-- REALSENSE_INCLUDE_DIR = /home/murilo/root/include
-- REALSENSE_LIBRARY = /home/murilo/root/lib64/librealsense.so

make VERBOSE=1

[ 41%] Building CXX object sensors/CMakeFiles/sensors.dir/RealSenseCamera.cc.o
cd /home/murilo/projects/vision/coav-intel/collision-avoidance-library/build/sensors && /usr/bin/c++   -DLIBBULLET_VERSION=2.85 -DLIBBULLET_VERSION_GT_282 -I/home/murilo/projects/vision/coav-intel/collision-avoidance-library -I/usr/local/include -I/usr/local/include/gazebo-8 -I/usr/include/bullet -I/usr/local/include/sdformat-4.1 -I/usr/local/include/ignition/math2 -I/usr/include/OGRE -I/usr/include/OGRE/Terrain -I/usr/include/OGRE/Paging -I/home/murilo/projects/vision/coav-intel/collision-avoidance-library/interfaces  -fstack-protector-all -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -std=c++11  -Wall   -std=gnu++11 -o CMakeFiles/sensors.dir/RealSenseCamera.cc.o -c /home/murilo/projects/vision/coav-intel/collision-avoidance-library/sensors/RealSenseCamera.cc
In file included from /home/murilo/projects/vision/coav-intel/collision-avoidance-library/sensors/RealSenseCamera.cc:20:0:
/home/murilo/projects/vision/coav-intel/collision-avoidance-library/sensors/RealSenseCamera.hh:18:31: fatal error: librealsense/rs.hpp: No such file or directory
 #include <librealsense/rs.hpp>
                               ^

Also checked the directory itself and the folder/file is there.

Silentkill is not working properly

We need to prevent the terminal to display messages when one of its childs is killed.

The following block should prevent those messages to appear, however, in some cases it makes the script to get stalled on that call if the kill command is not successful:

kill $SIGNAL $1 > /dev/null 2> /dev/null
wait $1 2> /dev/null

We have remove the wait line above in the commit 9c4c222 in order to avoid the stall. We still need to figure out how to avoid those messages without crashing.

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.