User Tools

Site Tools


furo_programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
furo_programming [2017/06/11 23:46] acaterfuro_programming [2017/07/15 12:53] (current) acater
Line 7: Line 7:
 \\ \\
 The project files are zipped here: The project files are zipped here:
- 
 {{::furomotion_v3.zip}} {{::furomotion_v3.zip}}
 +\\
 +**Note:** These files may be updated and changed in the future.  If changed please attach the updated files here as a .zip file.
 +\\ 
  
 +====== Motivation and Audience ======
 \\ \\
 +This tutorial's motivation is to teach students/researchers the basic programming structure behind Furo so that they can successful navigate, adjust, implement and manipulate the code that controls it.  After viewing the tutorial is it hoped that the reader will fully grasp the concepts behind how Furo is programmed and can successfully navigate the code to pinpoint each pieces primary function. It is expected that the reader is proficient in a Windows environment, knows the basics of C++ programming (although programming knowledge in general may be sufficient), and has some familiarity with programming IDEs.
 +
 +
 +
 +\\
 +
 ====== Requirements ====== ====== Requirements ======
 \\ \\
-1) Experience or familiarity of the C++ programming language\\ +1) Qt creator version 5.4 or higher - [[https://www.qt.io/ide/]]\\ 
-2) Experience within a Qt environment is not required but is recommended.\\ +2) Experience or familiarity of the C++ programming language\\ 
-3) The Furo service robot.\\+3) Experience within a Qt environment is not required but is recommended.\\ 
 +4) The Furo service robot. 
 +\\
 \\ \\
 ====== Programming Structure ====== ====== 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.+**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. This version was ran on Qt 5.4 on Furo's Windows 7 32-bit Embedded boot (Furo is dual booted with Windows 32-bit Embedded and Ubuntu 32-bit).
 {{ :qtfiles.png?nolink&200 |}} {{ :qtfiles.png?nolink&200 |}}
 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. 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.
Line 34: Line 45:
 \\ \\
 \\ \\
-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.   +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. The functions from mainwindow will call on the Furo object and pass parameters to it's functions to make it do what we need to do.  The most common function in the FuroRobot file is the update() function which has a velocity (float value) for each wheel passed.  The velocity will be calculated into RPMs and then sent to the DriveWheel function in FuroMotorController to be sent through the serial COM port (COM3 in windows) to the motors. Other functions include RotateZ and TranslateX which are used to pivot and move forward/backward Furo for the Up,Down,Left and Right push buttons. 
 +\\ 
 +\\ 
 +Finally, the FuroMotorController.  This source file contains all the necessary information to communicate with Furo through the COM ports. The header file has all the protocol definitions declared and the source file contains all functions to initialize, close, read and write to the serial port.  The FuroRobot source file functions will generally call to the DriveWheel function in FuroMotorController which will send the values serially through the COM ports to the motors.  It would be a good idea to familiarize yourself with the protocol used in case you need to write your own communication to Furo. 
 +\\ 
 +\\ 
 +====== Conclusions ====== 
 +This tutorial discussed the overall structure of Furo's project files using the Qt creator IDE. It showed which source files interact with other source files and what type of functions they contain as well. Future tutorials will go over the coding functions in greater detail (such as line following and object tracking) and will discuss the algorithms, functions, libraries, capabilities and improvements needed for each.   
  
furo_programming.1497250008.txt.gz · Last modified: by acater