Skip to content
Snippets Groups Projects
StaY's avatar
Stéphane Yang authored
Added a new script : object tracking. Part of it reuses view_cells, it allows learning of view cells and associates to an object.
8c4e7f03
History

Awesome Badges Awesome Badges Maintenance

Pixhawk service

Introduction

The pixhawk service program is a simple application that allows communication through Mavlink to a pixhawk flying controller. It uses blc_channels, a lib to use shared memory made by the friendly collegue, Arnaud Blanchard (See blaar lib).

Project Structure

The project works in real time with multiple threads :

  • Main thread
  • Serial port thread in reading and writing
  • Promethe threads (joystick, neural networks, ...)
  • IHM thread

Language

C++

Dependencies

This project uses :

You need git, a C/C++ compiler, cmake, make

git clone https://git.cyu.fr/blaar/blc.git
cd blc
mkdir blc_build && cd blc_build  && cmake ..
make
sudo make install

Organization

The project is organized in different specific folders :

+-- Com_server
|   +-- c_library_v2 :     Mavlink v2.0 library
|   +-- fly_monitor :      main program
|       +-- include :      all header files of the application
|       +-- plot :         all data that can be ploted
|       +-- snippet :      unit test code
|       +-- src :          all source files of the project
|   +-- include :          old header files
|   +-- lib_old :          old Mavlink library no longer used, removal should be considered
|   +-- prom_blc_channel : blc_channel functions to be compiled to generate libraries
|   +-- prom_blc_core :    blc_core functions to be compiled to generate libraries
+-- Promethe_scripts :     scripts like joystick to run in Promethe
+-- (lib/Linux/blc) :      blc libraries generated by prom_blc_channel and prom_blc_core)

How to ...

... see blc_channels ?

cd $HOME/blaar
./run.sh gnuplot/o_gnuplot /pixhawk.control.arm
./run.sh gnuplot/o_gnuplot /pixhawk.control.motors -m-1000 -M1000

... resolve blc_channels problem ?

You may have mishandled the blc_channels (changed a blc array's size, changed the name, etc). You can try to unlink channels:

blc_channels -U

If it doesn't work, you may want to wipe what's already present in "/dev/shm" and "/tmp/blc_channels.txt" (don't forget the hidden files as well). You can also run the code below (the first line generates warnings which we just get rid of by sending them to /dev/null):

rm -rf /dev/shm/.* 2> /dev/null
rm /tmp/blc_channels.txt

If you don't want to wipe, check if the informations in those places are correct and change/remove accordingly.

... resolve serial port problem ?

http://tvaira.free.fr/bts-sn/activites/preparation-ccf-e52/activite-port-serie-usb.html

... compile the project ?

Don't lose your time with greedy IDE :P. Use Cmake in the build folder.

- mkdir build
- cd build
- cmake ..
 make

... execute tests ?

No unitary test support was made but the system was prepared. It's only a simple option on cmake.

... use Promethe scripts ?

To launch promethe with a script to control the drone via joystick and check feedback signals.

cd Promethe_scripts/drone_joyRemote
promethe drone_joyRemote.script drone_joyRemote.res drone_joyRemote.config

Launch in an another window testDrone (source code in test):

testDrone /dev/ttyUSB0

Other

Some links are interesting to consult in order to contribute to this program.

Wiki

Author

Sylvain Colomer into the Laboratory Etis, University of Cergy-Pontoise Don't hesitate to contact me trough gitLab !