Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

YuMi Lead Through

Frederick Wachter edited this page Sep 9, 2016 · 14 revisions

YuMi Lead Through Script Description

The purpose of the YuMi lead through script is to be able to store the position of the YuMi arm(s) and generate a YuMi RAPID module from the stored positions. These files then can also be run through RobotStudio or on YuMi without requiring ROS if desired.

Sections

Before Running the Script

Before running the script, ensure that the grippers attached to YuMi have been calibrated using the TeachPendant (show below) and if you are storing points from an existing YuMi instead of just a simulated YuMi, ensure that lead through has been enable for each arm (shown below). If you are running an existing YuMi, please ensure you are using the correct YuMi quick commands to load YuMi in ROS (shown below).

For more information on YuMi quick commands, please take a look at the YuMi Quick Commands page

Setting Up YuMi

By default, the state and motion server should be running in the background unless thez wer stopped or have run into an error. This script only requires the state servers to be running. To check if the state servers are running, click the quick access button on the bottom right of the TouchPendant screen to bring up the quick access sidebar. Click the bottom button on the side bar (large hollow circle connected to three smaller filled circles) to bring up the Active Task list. Be sure that at least the two state servers have a status of "Go" and the two motion tasks (not motion servers) have a status of "Stop".

If this is the case, then continue with the steps shown below. If the two motion tasks (not motion servers) are in a "Go" state, then make sure that only the to motion tasks are active (active tasks have a check mark on the left of their name) and click the stop button on the bottom right of the TouchPendant (not the screen). If the state servers are not running, set only the state servers as active and click the play button on the bottom right of the TouchPendant (not the screen). Now YuMi is ready to interface with the lead through script.

Calibrating Grippers

To calibrate the gripper, click the menu drop down button on the TeachPendant which is located on the top left of the screen. Press the button labeled Smart Gripper and push the button for either the left or right hand (these buttons are the two right most buttons on the screen). Move the current gripper to the closed position by using the Jog - button on the TeachPendant or manually. Once the current gripper is closed, press the Calibrate button on the left panel. Go back to the previous screen by clicking close on the bottom right and press the button for the other hand. Perform the same operation for this gripper, and then go ahead and press the Calibrate button when the gripper is fully closed. Both grippers are now calibrated.

Enabling Lead Through for Both Arms

On the TeachPendant, click the menu drop down button on the top left of the screen. Press the button labelled Jogging. Near the bottom right of the screen, a button should appear labelled Enable Lead Through. Press this button, then switch the current mechanical unit to the other arm and press Enable Lead Through again. Both arms can now be move manually.

YuMi Quick Commands for loading an Existing or Strictly Simulated YuMi into ROS

If you did not allow for YuMi quick commands to be added when setting up your workspace, then please take a look at the YuMi Quick Commands page to find their command line equivalents.

If you will be using an existing YuMi, please run the the commands below in separate terminal windows to load YuMi into ROS. Please ensure that after executing the first command that the state/motion servers have loaded properly before running the second command. For more information on how to know if the state/motion servers have loaded properly, please take a look at the Setting up ROS wiki page.

yumi_server state_servers_only two_grippers
yumi rviz two_grippers

If you are not using two grippers, then replace two_grippers with the appropriate command for both lines. For more information on appropriate commands, please refer to the YuMi Quick Commands page.

If you will be using only a simulated YuMi, please run the following command:

yumi_demo rviz two_grippers

If you are not using two grippers, then replace two_grippers with the appropriate command. For more information on appropriate commands, please refer to the YuMi Quick Commands page.

Back to top

Starting the Script

In order to start the YuMi lead through script, run the following command:

yumi_lead $file_name <right/left/both> (opt: debug)

The $ symbol indicates that the shown variable name should be replaced by a name (in this case the desired save file name), and the <> symbols indicate that the user should choose one of the options listed within the angle brackets.

yumi_lead is a YuMi quick command, for more information on how to use the command, please refer to the YuMi Quick Commands page.

Replace the $file_name variable with the desired file name to save the RAPID module as (ex: test) and choose one of the options within the angle brackets (ex: both). The parameter shown in angle brackets is used to tell the program which arm(s) to store the positions of. The user would only like to store the positions of the left or right arm, then supply the command left or right respectively. If the user would like to generate RAPID modules for each arm, then supply the command both.

The user can also start the program in debug mode, in which case the argument debug would need to be supplied as the last parameter. This is an optional argument and does not need to be supplied. If it is supplied, the user will receive more feedback from the program in respect to the operations it is performing in the background.

When the above command is executed, the program will check that there are at least 2 argument provided, check that the second argument is either left, right, or both, and check if a third argument exists that the argument was debug. Then the provided file name will be checked to ensure the file does not already exist, the program will check if grippers are attached to the arms of YuMi, and then will wait for commands from the user as described in the section below.

Back to top

How to Use the Script

Once the program has been started and the terminal window has cleared with the line below displayed at the top of the window, then the program is ready to accept arguments from the user.

[ INFO] [#]: Ready to take arguments. For a list of recognized arguments, enter "help"

This program will wait for an argument from the user, determine if the provided argument is one of the recognized arguments, and if so will perform the appropriate operation as described below. Otherwise the user will be notified that the argument was not one of the recognized arguments and will wait for another input from the user. The arguments must be typed into the terminal window, and clicking the enter button on the keyboard will run the argument through the argument list.

Note: Normal terminal commands do not work in this program other than clear. Previous commands can not be retrieved by pushing the up arrow on the keyboard and so forth.

Using the Script for an Existing YuMi

If the user is interfacing with an existing YuMi, then move the arm(s) of YuMi manually (ensure the proper steps described in the Before Running the Script have been completed) to a position and that is desired to be stored. Once YuMi is at this position, execute one of the store commands depending on the which arm was supplied at the script execution and desired position to be stored (for more information on which store command to use, please continue reading below). This will save the position of the arm(s) depending on what parameter was supplied at the script execution. Continue this until all desired positions have been stored.

If the user would like to delete any previous points, then one of the delete previous commands can be used to accomplish this. For more information on which delete previous command to use, please continue reading below).

Once all points have been stored, execute the finish command and the program will build a RAPID module and save it in the modules folder in the yumi_scripts package of the YuMi workspace on your computer with the user name supplied at the script execution.

Using the Script for a Simulated YuMi

If the user is not using a real YuMi and only a simulated one in ROS, then be sure to load RViz at program execution in order to be able to manually manipulate the arms to desired positions. Once the simulated YuMi is at a desired position, execute one of the store commands depending on the which arm was supplied at the script execution and desired position to be stored (for more information on which store command to use, please continue reading below). This will save the position of the arm(s) depending on what parameter was supplied at the script execution. Continue this until all desired positions have been stored.

If the user would like to delete any previous points, then one of the delete previous commands can be used to accomplish this. For more information on which delete previous command to use, please continue reading below).

Once all points have been stored, execute the finish command and the program will build a RAPID module and save it in the modules folder in the yumi_scripts package of the YuMi workspace on your computer with the user name supplied at the script execution.

Recognized Argument List with Simple Descriptions

Command Description
store Store the current position for the group (left, right, both) provided at program execution
store left Only store the current position for the left arm
store right Only store the current position the right arm
close left Indicate that the left gripper should be set to the closed position
close right Indicate that the right gripper should be set to the closed position
open left Indicate that the left gripper should be set to the open position
open right Indicate that the right gripper should be set to the open position
finish Notify the program that the last point has been stored
show points Show all stored point names with lined up synchronized movements
delete previous Delete the previous stored position/gripper movement
delete previous left Delete the previously stored point for the left arm
delete previous right Delete the previously stored point for the right arm
delete all Delete all stored points
debug Switch the current debug mode (can also use debug on and debug off)
state Check if the script is in debug mode or not
clear Clear the terminal window
help Display all the allowed commands that can be executed
exit Exit the program without writing stored points to file

Please note the following:

For the commands left only and right only:

  • These commands should only be used if the group provided at program execution was both, not if the provided group was left or right.
  • If the left only command is given by the user when the provided group at program execution was left, then the user will be warned that the program is already only storing data for the left arm, and the current position of the left arm will be stored anyway. Same goes for the right only command if the provided group at program execution was right
  • If the left only command is given by the user when the provided group at program execution was right, then an error will be displayed to the user stating that the program was set to only store data for the left arm, and the current position of the left arm will not be stored. The program will then wait for another command from the user. Same goes for the right only command if the provided group at program execution was left

For the commands close left, close right, open left, and open right:

  • These commands will add to the RAPID module a command to indicate that the gripper should close/open. The previous pose stored will be assumed to be the position of the gripper when the gripper is closing/opening.
  • The commands will not close or open the grippers on the real robot since this program requires that only the state servers are to be executed (described in the above section titled Before Running the Script) preventing motion commands from being sent to YuMi. To close the grippers using the TeachPendant, please refer to the Moving the Gripper(s) Using the TeachPendant section below.
  • If a gripper is not attached to the arm which the command is intended for (ex: close left is meant to close the left gripper), than an error will displayed to the user stating that a gripper is not attached to the arm that the command is intended for.

The program determines if a gripper is attached to either arm by looking at the last active joint in the left_arm and right_arm move group and checks if the first seven letters of the last active joint name is "gripper". If it is gripper, then a gripper is assumed to be on the respective arm. To remove one or both grippers, change the optional parameters when loading YuMi as described on the YuMi quick commands page.

For the commands delete previous, delete previous left, delete previous right, and delete all:

  • Once these commands are executed, they cannot be undone.
  • the delete previous command will delete the last position that was stored. If the provided group at program execution was both arms, then the previous position stored will be deleted. If the store left command was the last command used, then the last position stored only for the left arm will be deleted. Otherwise if only the **store command was the last command used, then the last position stored for both arms will be deleted.

Moving the Gripper(s) Using the TeachPendant

The grippers can be jogged using the TeachPendant. In order to do this, on the TeachPendant click the drop down menu bottom on the top left of the screen, and click the button called Smart Gripper. Three buttons will appear, click the gripper for the desired arm (left or right hand, these are the two buttons on the right most side of the screen).

The gripper can then be jogged using either the Jog + and Job - buttons to open and close the gripper respectively, or using the Grip To and Move To button. For closing the grippers, it is suggested to user the Grip To button (Gripper force can also modified on the left panel of the screen) and grip to the 0 position (if gripping an object, the gripper will stop closing once it is holding on to the object with the previously set force). When opening the grippers, it is suggested to user the Move To button and to move the grippers to 24mm apart (this is set in the dialog box to the right of the Move To button).

24mm is the convention used for an open gripper, the max is 25mm. 24mm is used to ensure that the gripper doesn't job too far outwards causing an error on YuMi.

Back to top

RAPID Module Generation

Once all positions have been stored, the user should notify the program by providing the command finish. The program will then automatically run the appropriate functions in order to open and write the stored positions to the file provided by the user at program execution. The file(s) are placed in a folder called modules in the yumi_scripts package of the YuMi workspace on your computer. The ABB conventions that are used to generate the files are shown below.

Back to top

ABB YuMi RAPID Module Conventions Used

Axis Configurations

ABB YuMi axis naming convention (from YuMi base to end effector): [1, 2, 7, 3, 4, 5, 6]

ABB axis configuration convention: [axis_1_config, axis_4_config, axis_6_config, cfx]

ABB axis configuration values for axis_1_config, axis_4_config, and axis_6_config:

Configuration Value Minimum (including value) Maximum (excluding value)
-4 -360 -270
-3 -270 -180
-2 -180 -90
-1 -90 0
0 0 90
1 90 180
2 180 270
3 270 360
  • The configuration values above are for joints 1, 4, and 6

Description for cfx: if cfx = ABCD

  • A represents configuration for axis 5 and can be either (1) or (0)
    • (0) if axis 5 position >= 0 degrees, (1) if axis 5 position < 0 degrees
  • B represents configuration for axis 3 and can be either (1) or (0)
    • (0) if axis 3 position >= -90 degrees, (1) if axis 3 position < -90 degrees
  • C represents configuration for axis 2 and can be either (1) or (0)
    • (0) if axis 2 position >= 0 degrees, (1) if axis 2 position < 0 degrees
  • D represents the compatibility bit, particularly used for linear movements
    • This value is not used and is always set to (0)

Examples (compatibility bit assumed to be 0):

  • Axis 5 = 0 degrees, Axis 3 = -90 degrees, Axis 2 = 0 degrees | cfx = 0000 or 0
  • Axis 5 = 0 degrees, Axis 3 = -91 degrees, Axis 2 = 0 degrees | cfx = 0100 or 100
  • Axis 5 = -90 degrees, Axis 3 = 0 degrees, Axis 2 = -90 degrees | cfx = 1010

External axis configuration: [arm_angle, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]

Simple YuMi Module Example

Layout of simple module:

  1. MODULE module_name
  2. LOCAL CONST string YuMi_App_Program_Version:="1.0.1";
  3. LOCAL VAR robtarget s1 := position],[orientation],[configuration_data],[external_axis;
  4. LOCAL VAR robtarget p1 := position],[orientation],[configuration_data],[external_axis;
  5. PROC main()
  6. MoveSync s1;
  7. Move p1;
  8. OpenHand;
  9. CloseHand;
  10. ENDPROC
  11. ENDMODULE

Module Convention Description:

  • First line is always the module name
  • Second line always defines that this file is to be used by the YuMi App Program
  • Next set of lines define the robtargets in descending numerical order
  • Line after the robtarget definitions is the start of the main function
  • Next set of lines define the robot arm and gripper movements for the robot to move through
    • MoveSync indicates a synchronized movement with the other arm
      • All variables for these types of movement begin with "s"
    • Move indicates an independent movement from the other arm
      • All variables for these types of movement begin with "p"
  • The last two lines indicate the end of the main function and end of the module

Gripper Commands:

  • The gripper can either be set to open or close. When set to close, the gripper will close its hand until it is either completely closed, or had grasped an object. The gripper close force can also be set from the TouchPendant (as described in the Moving the Gripper(s) Using the TeachPendant section above).

Robtarget Definition

ABB units: milimeters and degrees

ROS units: meters and radians

ABB robtarget convention:

robtarget_name := [[position.x,position.y,position.z],[orientation.w,orientation.x,orientation.y,orientation.z],[cf1,cf4,cf6,cfx],[eax1,eax2,eax3,eax4,eax5,eax6]]
  • cf1 represents the configuration data for axis 1
  • cf4 represents the configuration data for axis 4
  • cf6 represents the configuration data for axis 6
  • cfx represents the configuration data for a combination of axis 5, 3, 2, and a compatibility bit
  • eax1 represents the arm angle
  • eax2 to eax6 represents 5 other external axis values, but these are not used on YuMi and thus are all set to 9E+09. This data is ignored.

Back to top