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


AHAS Lua File

Navigate to the Allegro Hand Application Studio (AHAS) controls directory and locate the file called AHAS_NI-CAN_L.lua.

C:\Program Files (x86)\SimLab\Allegro Hand Application Studio\bin\controls

Find the Lua file called AHAS_NI-CAN_L.lua and copy it to your Desktop. Rename the file myAHController_ACTUAL.lua. Open myAHController_ACTUAL.lua to see the following code.

  aml = "models/Etc/AllegroHand/AllegroHandL_RT_NICAN.aml"
  controlXDL = "controls/control_AHAS_L.xdl"
  rtTimer ="RTTimer", rTimer_MODE_REAL_WIN32)
  sysname = "RTSys"
  T0 =,, 0, 0))
  hand = RoboticsLab.createRTSystem(aml, sysname, T0, rtTimer)
  comm = hand:findDevice("COMM")
  step = 1
  deltaT = 0.003
  controller = RoboticsLab.createController("controller", hand, step)
  controller:setNominalSystem(aml, sysname)--, T0) 
  function Update()
  	-- Can be used do draw graphic elements in AHAS

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 "AllegroHand_RT_NICAN.aml".

  aml = "models/Etc/AllegroHand/AllegroHandL_RT_NICAN.aml"
  rtTimer ="RTTimer", rTimer_MODE_REAL_WIN32)
  sysname = "RTSys"
  hand = RoboticsLab.createRTSystem(aml, sysname, T0, rtTimer)
AllegroHand_RT_NICAN.aml AllegroHand_RT_SoftingCAN.aml AllegroHand_RT_KvaserCAN.aml AllegroHand_RT_ESDCAN.aml
AllegroHandL_RT_NICAN.aml AllegroHandL_RT_SoftingCAN.aml AllegroHandL_RT_KvaserCAN.aml AllegroHandL_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 myAHController.xdl we made in tutorial 1.

  controlXDL = "controls/control_AHAS_L.xdl"

This line must be changed to the following so that the AHAS can evoke our new controller.

  controlXDL = "controls/myAHController.xdl"

Now move the file myAHController_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\myAHController.lua  
New Target:      "C:\Program Files (x86)\SimLab\Allegro Hand Application Studio\bin\Allegro.exe" controls\myAHController_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.
If the hand motion is not correct, please check the dml is set properly.

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

You are not allowed to post comments.

Copyright & Trademark Notice
Allegro, the Allegro logo, RoboticsLab, the RoboticsLab logo, and all related files and documentation are Copyright ⓒ 2008-2020 Wonik Robotics Co., Ltd. All rights reserved. RoboticsLab and Allegro are trademarks of Wonik Robotics. All other trademarks or registered trademarks mentioned are the properties of their respective owners.

Wonik Robotics's Allegro Hand is based on licensed technology developed by the Humanoid Robot Hand research group at the Korea Institute of Industrial Technology (KITECH).

Any references to the BHand Library or the Allegro Hand Motion and/or Grasping Library refer to a library of humanoid robotic hand grasping algorithms and motions developed and published by KITECH researchers.
J.-H. Bae, S.-W. Park, D. Kim, M.-H. Baeg, and S.-R. Oh, "A Grasp Strategy with the Geometric Centroid of a Groped Object Shape Derived from Contact Spots," Proc. of the 2012 IEEE Int. Conf. on Robotics and Automation (ICRA2012), pp. 3798-3804

Wiki maintained by Sean Yi <>

KitechLogo.jpg Wonikrobotics logo.png

Whos here now:   Members 0   Guests 1   Bots & Crawlers 0