User Tools

Site Tools


furo_programming

This is an old revision of the document!


Programming Structure for Furo Using Qt Creator


Author:Alex Cater Email:cater@unlv.nevada.edu
Keywords:Furo, programming, C++, Structure

The project files are zipped here:

furomotion_v3.zip


Requirements


1) Experience or familiarity of the C++ programming language
2) Experience within a Qt environment is not required but is recommended.
3) The Furo service robot.

Programming Structure

Note: This is a general structure for Furo's programming. The project files may be updated in the future to include different header and .cpp files or have some removed. Open the Qt project for Furo and on the left hand side you will have a menu like the one above which has all the files that are included in the project. The files we will go in depth with in this tutorial are the main, mainwindow, FuroRobot, FuroMotorController cpp files and header files along with the .pro file and the forms file. Others can be explored but will not be covered in this tutorial as they do not provide significant function.

Below is a structural flow diagram that shows how the entire project works together. First, let's take a look at the outer box which is our .pro file. This file ties all of our other files together and includes all the external libraries used (OpenCV for example). This file contains all of our header, source, and forms files and has the all paths and libraries listed for our external libraries. If anything is not included then our project will not build. Note: after making ANY changes in the .pro file you MUST run qmake before trying to build in order to update the project. Qmake is found under the build tab.

Next, the main file. This file is rather simple since all it does is call upon the QApplication function and display our mainwindow (GUI). Other functions, calculations, and tasks can be included in the main file but for our purposes this is all that we need. The rest of our programming is included in the mainwindow and FuroRobot files.

Moving forward brings us to the mainwindow file. Notice it works hand in hand with the our form file (mainwindow.ui) which defines all of our push buttons in the GUI. Clicking on the mainwindow.ui file will allow us to graphically edit our GUI. We can drag and drop pushbottons, dialog button boxes, tool buttons, create tables, scroll areas etc. to create a GUI that fits our needs. For Furo I have defined a few pushbottons that include some functions or tasks (line following or object detection for example). After editing our form file you will need to include these in our mainwindow header/source files as functions. Note: As Furo's project becomes larger and more in-depth it may be necessary to create another source/header file that contains specific functions. Mainwindow can hold the push button functions while the other functions that these push button function call are included in a separate source file. This will help keep the mainwindow file from becoming overcrowded and keep better orginization.

Next, the FuroRobot source file. If at any point the mainwindow functions need to directly interact with Furo they will need to be passed through to functions in the FuroRobot source file. These interactions are generally communications with the motors to make Furo move.

furo_programming.1497250008.txt.gz · Last modified: 2017/06/11 23:46 by acater