Author: Yu Hang He
Email: hey6@unlv.nevada.edu
Date: Last modified on <10/25/18>
Keywords: Hubo 2, PODO 3, Ubuntu, AL, QT GUI
The tutorial serves as a guide for creating a new AL in PODO system. The tutorial will cover how to create a new GUI in QT program, creating a new AL in PODO, and modifying AL DB file. Contact the author for necessary files. The steps for creating a new AL is as follows:
Creating a main GUI
Creating AL program
Create basic program structure
Add communication functions
Implement GUI communication function
Adding AL program to Daemon
DB file modification
Author of this tutorial assumes the reader has the following background and interests:
* Familiar with programming process
* Interested in creating GUI with QT IDE
* Interested in working with Jaemi-Hubo and other Hubo robots
The rest of this tutorial is presented as follows:
This section will demonstrate how to create a GUI file for PODOGUI in QT Creator.
#include “CommonHeader.h”
#include “BasicFiles/PODOALDialog.h”
#include “CommonHeader.h”
private:
LANDialog * lanData; Communication with Daemon
int AlnumXXXX; Choose the name of AL you want to use or create
int AlnumOmniWheel; For example
*
int AlnumWalkReady; or this
This section will demonstrate how to create a new AL for PODO.
right click on ALPrograms → project → New Subproject.
→ Application → Select Qt Console Application.
PODO/DRC_HUBO/PODO_DRC/src/ALPrograms/ALTutorial
and Copy the BasicFiles folder into the folder of new AL that was created.QT → Add Existing Directory
. In the new window click → Browse → Click on BasicFIles folder
that was copied into the new AL project folder.[project name].pro
.CONFIG (debug, debug | release) {
DESTDIR = ../PODO_PROC_Build
} else {
DESTDIR = ../PODO_PROC_Build
}
Important!
Modify line 38 with name of new AL. The name must be unique and matches the name that will be add to the DB file later.sprintf(__AL_NAME, “ALTutorial”);
QTimer *displayTimer;
displayTimer = new QTimer(this);
connect(displayTimer, SIGNAL(timeout()), this, SLOT(DisplayUpdate())); function inside SLOT() will be updated according to the interval set
displayTimer→start(50); set the time interval (50 ms) for the function inside SLOT() to be updated
Create a DisplayUpdate() function to update the variables on GUI.
USER_COMMAND cmd;
cmd.COMMAND_DATA.USER_COMMAND = (Enter one of the variables declared in the enum);
cmd.COMMAND_TARGET = (variable with name of AL to use ex) AlnumManualMove);
pLAN→ SendCommand (cmd);
Declare [new AL]dialog object = new Classname(this);
ui→ MAIN_TAB→ addTab ((Qwidget *) declared dialog, “TABNAME”);
For questions and comments, email hey6@unlv.nevada.edu