====== Creating a New AL for HUBO ====== **Author:** Alvaro Pintado Email: pintado@unlv.nevada.edu \\ **Date:** Last modified on 11/19/16 \\ **Keywords:** Humanoid, HUBO, Software, PODO, AL Creation \\ \\ Follow this lengthy set of steps in order to kind of create a new AL for HUBO. === Setting up a new AL Sub-project in Qt === - Open the PODO project (including PODOGUI, ALTutorial, sub-projects) - Check for correct build settings - Create a sub-project (Qt console application - Copy the Basic Files folder from src/ALPrograms/ALTutorial into the sub-project folder - Navigate to the main.cpp - Open the ALTutorial project and copy the code in main.cpp into the sub-projects main.cpp to utilize as a template - Rebuild your sub-project - Add to Git version control - Change AL Name to unique name - In main.cpp, declare enum{ enum = [enum_identifier]; }; - In PODOGUI subproject, add new > Qt > Designer Form Class - Select Dialog with Buttons - Name everything the same as the AL to make your life simpler when debugging - In the projectdialog.h, include CommonHeader.h - Under private: int [int_identifier]; - In Dialog.cpp include PODOALDialog.h - Declare the same enum in the dialog.cpp - Set the dialog function [enum_identifier] = PODODialog::GetALNumFromFileName("ALName") - In dialog.ui, make a button - In the QDialog menu, change the object name - Right click the button and go to Slot, and select clicked() event - In dialog.cpp, in button function clicked() add USER_COMMAND cmd; cmd.COMMAND_DATA_USER_COMMAND = [enum_identifier]; cmd.COMMAND_TARGET = [int_identifier]; pLan->SendCommand(cmd); - In PODOGUI sub-project, under GUIMainWindow.h and include dialog.h - Under the //User Dialog section//, make a pointer to the dialog class - In GUIMainWindow.cpp, under the section under //Expandable Dialogs// add ui->MAIN_TAB->addTab((QWidget*))dialogpointer, "tab name"); - In the Ubuntu Software Center, download and install the SQL Database browser - Open it up and stuff and go to AL table > New Record - Add [ALName], FileName, and set the Pathname (similar to the ones before it) - In General Table, increment PODO AL amount by 1 - Write Changes === Giving the New AL Functionality === - In the main.cpp of the AL, add a switch statement with a case equal to your enum - Ensure the enum is declared in your main.cpp - Copy the case code from case: 999 - Change the SetMoveJoint to RSP - Change to MOVE_RELATIVE - The line after is the "Don't Do Shit Anymore" command - -//Santiago Ricoy// - Rebuild the project === Using the New AL in PODOGUI === - Launch PODOLauncher - Start Daemon and GUI - SQL Build path to /Subproject Folder - Select the new AL in the AL Modules - Under the newly created tab will be the new button made for the functionality of the AL