Real Time simulation of a pan-tilt camera using ALLEGRO and pthread library (C language) tracking a moving object in the space with RATE MONOTONIC scheduling.
5 concurrent tasks sharing resources are managed:
- Moving object
- Camera motors
- Screen
- Camera screen
- GUI
The v4.2 of the ALLEGRO library is used. To install it please run:
sudo apt‐get install liballegro4.2 liballegro4.2‐dev
Cmake build system generator is used. To compile the code:
mkdir build
cd build
cmake .. && cmake --build .
To execute the program please use administrator priviliges (due to the use of RATE MONOTONIC scheduler):
sudo ./camera
The camera tracks a moving target in the space and its velocity is controlled in closed-loop using target's position and velocity according to the following scheme:
Several parameters can be changed by the user in Real-Time. These parameters are reported in the graphic's menus.
It's possible to specify:
- Movement type of the target:
- Random movement
- Sinusoid movement
- Amplitude A and Period P
- Mouse controlled movement
- Controller poles x and y system poles
- Camera motors poles x and y motor poles
- Camera window's size S
To change such values just press the arrows Up or Down to select the desired one, then just press + or - to inrease or decrease it.
Press ESC to quit the simulation. Enjoy.