EUTAFT Log
We're in the process of updating the computer and camera of the football table. We took the existing software as a starting point; first goal is to make this work on the new hardware (meaning pc + camera).
There are currently two main parts of the software:
- the Vision software, a c++ based application
- and the Motion software, a Simulink based model
Vision
Quick update on what has been done on the Vision software so far:
- Made the new pc 'ready' by installing the required libraries etc.
- Updated deprecated functions etc. in Qtvision software, such that the project could be build on the new computer at all. A more detailed log of this can be found in the git, but it shouldn't be necessary to dive into this again.
- Took the old camera, and further debugged the code on the new pc. (For your reference, a working version of this project is located in ADDLINK)
- Took the new camera, and updated the camera calls in the old code. A log of this (and also the previous step) is also located in the git (ADDLINK). I do advise to take a look at this, because this is basically where I left off. I will put a copy of the most recent version of Qtvision in dev/kevin in the git.
Let me try and explain that last point a bit more in detail and afterwards what needs to be done now...
Simply put, a new camera means a new API. Instead of using PvApi, we now use the Pylon API. PvApi is a C based library that was used in camera.c/camera.h to implement the camera functionalities. This was then compiled into another library (in terminal while being root user "make && make install" in SVN_backup/src/camera) that was used in the rest of the Qtvision project. Pylon API has a C++ API, so the camera related code is now included in the Qt Creator project itself (camera.cpp & camera.h).
Documentation & example code features Pylon API (use menu on left to go through features): https://docs.baslerweb.com/features.html
So what now? We can grab images using the new camera (yay) with our Qtvision application, so the next step would be to have a better look at the processing of these images. Most of this is done in visionexecute.cpp, but there are also still a few things that need another look in camera.cpp as well (please ctrl+F for TODO!). As can be seen when running the program the view is a bit green. Green = Black...yep, due to post-processing black pixels are displayed greenish right now, this needs to be solved! Increasing the exposure time (ET in the GUI) already helps a bit, because more light (duh)... There are a few camera settings (see camera.cpp) and post-processing (visionexecute.cpp) that should be looked into. Furthermore, we need to re-calibrate, the old wiki explains how to do this (http://cstwiki.wtb.tue.nl/index.php?title=Football_Table_Vision). To be able to do camera and color calibration though, the callback for grabbing one frame instead of continuously grabbing needs to be implemented still (camera.cpp => OnGrabbedImage() function).
Getting started
- Open a new terminal -> sudo qtcreator
- Open the Qtvision.pro file located in SVN_backup/Qtvision/
- Save, build, and run using respectively ctrl+S, ctrl+B, and ctrl+R
Motion
To compile the motion (by running make.m), Matlab 2011a is needed, because the Termination Block in the Simulink model is deprecated. A short log of what has been done to upgrade the motion so far can be found in the git (ADDLINK). But I actually just suggest reading the Motion page on the old wiki (http://cstwiki.wtb.tue.nl/index.php?title=Football_Table_Motion), this should give you all information you need.
Getting started
- Open a new terminal -> sudo /usr/local/MATLAB/R2011a/bin/matlab
- Both make.m and the Simulink models (to compile a certain version of the model, copy it and rename it to MOTION.mdl) can be found in the root of SVN_backup