Difference between revisions of "3. Interfacing with the Actual Allegro Hand"
Alexalspach (Talk | contribs) |
Alexalspach (Talk | contribs) (→AHAS Shortcut) |
||
Line 99: | Line 99: | ||
Please move on to the next tutorial to learn how to use the AHAS button to evoke BHand library grasping motions and your own motions/algorithms. | Please move on to the next tutorial to learn how to use the AHAS button to evoke BHand library grasping motions and your own motions/algorithms. | ||
− | [[4. | + | [[4. AHAS Buttons and BHand Library Motions]] |
Revision as of 15:07, 12 November 2012
In the last tutorial, 2. Allegro Hand Joint Position Control, we developed a controller that commands the joints in a sinusoidal fashion. While any motion can be established at this point, we will show this same motion in the actual Allegro Hand to demonstrate the ease of developing a controller for use with both the virtual and actual Allegro Hand systems.
This tutorial assumes you have completed both of the previous tutorials, 1. Setup: DLL Project, Control XDL & the AHAS Lua file and 2. Allegro Hand Joint Position Control. Also, this tutorial assumes that you have one of the four stock supported CAN devices
Contents |
AHAS Lua File
Navigate to the Allegro Hand Application Studio (AHAS) controls directory and locate the file called ERHAND_NI-CAN_LEFT.
C:\Program Files (x86)\SimLab\Allegro Hand Application Studio\bin\controls
Find the Lua file called ERHAND_NI-CAN_LEFT.lua and copy it to your Desktop. Rename the file ALLEGROHAND1_ACTUAL.lua. Open ALLEGROHAND1_ACTUAL.lua to see the following code.
function Awake() print("Begin Allegro Hand") version() -- If you just want to simulate, comment "rtTimer" and "createRTSystem" -- and uncomment loadModel -- to change CAN interface, change "createRTSystem" line --loadModel("hand", "models/Etc/ERHand/ERHand.aml") rtTimer = createTimer("RTTimer", rTimer_MODE_REAL_WIN32) print(rtTimer) createRTSystem("models/Etc/ERHand/ERHandL_RT_NICAN.aml", "RTSys", rtTimer) createController("RTController", "RTSys") --, 1, "controls/control_ERHand.xdl", "") setControlAlgorithm("RTController", "controls/control_ERHandL.xdl") --setNominalSystem("HandController", "") end function Update() -- body end ...
The line below loads the NI-CAN interfacing Allegro Hand model. We must change this to reflect the hand (left/right) and the CAN interface (NI/Softing/ESD/Kvaser) that are using. Please refer to the following table to determine with what model you must replace "ERHandL_RT_NICAN.aml".
createRTSystem("models/Etc/ERHand/ERHandL_RT_NICAN.aml", "RTSys", rtTimer)
|
NI CAN |
Softing |
Kvaser |
ESD |
Right |
ERHand_RT_NICAN.aml | ERHand_RT_SOFTING.aml | ERHand_RT_KvaserCAN.aml | ERHand_RT_ESDCAN.aml |
Left |
ERHandL_RT_NICAN.aml | ERHandL_RT_SOFTING.aml | ERHandL_RT_KvaserCAN.aml | ERHandL_RT_ESDCAN.aml |
For this tutorial, I am using NI can and a left Allegro Hand so I will leave this line as-is.
Next we must link this new LUA file to the control_AllegroHand.xdl we made in tutorial 1.
createController("RTController", "RTSys") --, 1, "controls/control_ERHand.xdl", "") setControlAlgorithm("RTController", "controls/control_ERHandL.xdl")
These two lines must be changed to the following so that the AHAS can evoke our new controller.
createController("RTController", "RTSys") --, 1, "controls/control_AllegroHand.xdl", "") setControlAlgorithm("RTController", "controls/control_AllegroHandL.xdl")
Now move the file ALLEGROHAND1_ACTUAL.lua from the Desktop back into the controls directory.
AHAS Shortcut
Make a copy of the AHAS shortcut on the Desktop created in tutorial 1. Right click the shortcut and click Properties. Change the target as follows:
Original Target: "C:\Program Files (x86)\SimLab\Allegro Hand Application Studio\bin\Allegro.exe" controls\ALLEGROHAND1.lua New Target: "C:\Program Files (x86)\SimLab\Allegro Hand Application Studio\bin\Allegro.exe" controls\ALLEGROHAND1_ACTUAL.lua
Close the Properties window. Connect the Allegro Hand to your computer's CAN interface and turn it on.
Note: Make sure to straighten out all of the fingers prior to running AHAS.
Double-click the the shortcut to test it out. An Allegro Hand simulator should load with more buttons that before. Click On and the controller will immediately start controlling the actual Allegro Hand joints with the same sinusoidal patterns as the virtual. The AHAS model will reflect the joint movements of the actual hand.
Please move on to the next tutorial to learn how to use the AHAS button to evoke BHand library grasping motions and your own motions/algorithms.
4. AHAS Buttons and BHand Library Motions
Whos here now: Members 0 Guests 0 Bots & Crawlers 1 |