Revision 14 as of 2013-02-12 14:27:31

Clear message

Note: This tutorial assumes familiarity with Fanuc controller cabinets, the Teach Pendant (iPendant) and the Roboguide environment. For more information on any of the steps in this tutorial, consult the documentation on these subjects provided by Fanuc Robotics.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Installation of ROS-Industrial on Fanuc controllers

Description: This tutorial guides you through an installation of the ROS-Industrial programs on Fanuc controllers.

Keywords: Fanuc, Roboguide, Industrial, R-30iA, R-J3iC, KAREL, TP

Tutorial Level: INTERMEDIATE

Next Tutorial: Running the ROS Industrial programs

There are two main steps in setting up a Fanuc arm for use with ROS Industrial: 1) building and installing the necessary KAREL programs, and 2) configuring the controller for use with these programs.

Prerequisites

In order to be able to complete this tutorial, you should have access to the following:

  • a local checkout of the fanuc_common package from the fanuc stack in the swri-ros-pkg repository

  • an installation of Fanuc Roboguide1

  • a Windows PC or VM (Roboguide does not run on Linux)
  • a USB stick or some other method of transferring the necessary files to the controller

In addition to the above, the following software options should be present on your robot (besides basic networking and TCP/IP support):

  • KAREL (R632)
  • User Socket Messaging (R648)

Building and installing the programs

Before the ROS Industrial KAREL programs can be transferred to the robot controller, they need to be compiled into binaries. In this tutorial, we'll use Fanuc Roboguide for compiling (or building, in Fanuc terminology), and in the next (Running the ROS Industrial programs) as a simulator of the real hardware.

Creating a workcell

First, create a new workcell in Roboguide, either by using the wizard or by creating a copy from your actual robot controller. When using the wizard, be sure to select the correct Application package, as well as the correct robot type. On the software options screen, also make sure to select at least options R648 (KAREL) and R632 (User Socket Messaging).

After completing the wizard, you should end up with an empty workcell with just your robot in the middle of it. If you chose to create a copy of the controller, the Cell Browser might show programs and files that were already present on the robot under the Programs and Files sections. Unless you find them distracting, these can be ignored.

Importing the KAREL sources

In the Cell Browser, import the KAREL sources into the workcell using the ProjectAdd Files menu option. Browse to your local checkout of the fanuc_common package and select all files in the KAREL subdirectory not ending in '_h.kl' or '_t.kl'. After clicking the Open button, the Files section should contain at least these files:

  • karel_type_sz.kl
  • libind_log.kl
  • libind_mth.kl
  • libind_pkt.kl
  • libsock.kl
  • ros_relay.kl
  • ros_state.kl

Picking free Server Tags

The ros_state and ros_relay programs make use of the User Socket Messaging (USM) software option, and expect two Server Tags to be available. By default, tags 3 and 4 are used. On the TP, open the Host Comm setup screen, and then go to the SETUP Servers listing using [SHOW]Servers. If you have no other programs making use of USM, 3 and 4 should be available.

If not, find two others and note their tag numbers. Now open the ros_relay.kl file in Roboguide and update the MOTION_TAG constant: enter the first of the two free tag numbers. Do the same for ros_state.kl and the STATE_TAG constant, but use the second free number. Save both files and close them.

For more information on User Socket Messaging and tags, see [3, Chapter 11].

Building

Now build all files by selecting ProjectBuildAll in Roboguide. No errors or warnings should be reported, and the Programs section in the Cell Browser should show the compiled binaries.

Copying the programs to the real controller

Finally, the binaries need to be transferred to the real controller. This can be done by using a USB stick, or by using a direct transfer over a network connection. Refer to [1, Chapter 8] for information on how to copy files using removable media. Refer to the Roboguide help files for information on how to perform network transfers of files to robots.

After copying the binaries onto the robot controller, open the Program Select window by pressing the Select button on the real TP, then [TYPE]KAREL Progs. Make sure the following programs are listed:

  • karel_type_sz
  • libind_log
  • libind_mth
  • libind_pkt
  • libsock
  • ros_relay
  • ros_state

Configuring the controller

Some additional configuration of the controller is required in order for the ROS Industrial programs to work correctly.

Server Tags

The two tags chosen in the 'Picking free Server Tags' section need to be configured. This section assumes tags 3 and 4 are used, but be sure to configure the correct tags in case you changed them in the KAREL sources earlier.

On the TP, again open the SETUP Servers listing on the Host Comm setup screen. Select tag 3 and press DETAIL, now configure the tag as follows:

Protocol

SM

Startup State

START

Inactivity Timeout

1 min

The rest of the fields should be empty or at their defaults. Do the same for tag 4.

Go back to the SETUP Servers listing and start each tag with [ACTION]DEFINE, then [ACTION]START, or restart the control cabinet. Make sure they have been started by re-opening the SETUP Servers screen (if necessary) and checking the Current State of both tags: it should say STARTED.

Refer to [3, Section 11.3.2] for more information on configuring server tags.

Payload settings, Tool and User frames

Three additional configuration items influence the behaviour of the robot when used with the ROS Industrial nodes: the arm payload schedule, and the selected user and tool frames.

For the payload schedule, input the correct information using the TP on the Motion/Payload Set setup screen. This screen can be found via MenuNextSystemMotion. Be sure to configure and select the correct schedule. For more information, see [1, Section 9.14].

Configured user and tool frames are (currently) ignored in the ROS Industrial nodes: motion trajectories are specified at joint coordinate (and velocity) level. This is also true for robot state reporting. The use of a user frame coincident with the world frame is however recommended as it helps in debugging and verifying the motion of the arm and the location of the TCP.

Tool frames configured at the robot controller side are also not taken into account by the ROS motion planners: tools should be represented by an appropriate URDF. The combination of the arm and tool URDFs provides similar information to the planning libraries (see also the Create a URDF for an Industrial Robot tutorial). It is however recommended to manually verify the correct tool frame setup on the TP, as the robot controller also uses this information in its safety algorithms.

Go to MenuSetupFrames and use the [OTHER] function key to switch between the Tool and User Frame listings. Disable the user frame: use the Next button, then press the CLRIND function key (alternatively, configure an all zeros user frame) 2. Verify the tool frame setup in the Tool Frame screen. For more information on user and tool frame setup, see [1, Section 3.9].

Notes

  1. As an alternative to Roboguide, WinOLPC / OlpcPRO or even the KCL console could be used to compile the KAREL sources into p-code binaries. These alternatives are not documented in this tutorial, and only the use of Roboguide will be described. (1)

  2. Depending on the configuration and mounting of the arm, an 'all-zeros' user frame may not be the best choice. In those situations, be sure to configure a more suitabe frame. (2)

References

  1. FANUC Robot Series, R-30iA, Handling Tool, Operator's Manual, B-82594EN-2/02
  2. FANUC Robot series, R-30iA/R-30iA Mate Controller, KAREL Function, Operator's Manual, B-83144EN/01
  3. FANUC Robotics SYSTEM, R-30iA Controller, KAREL Reference Manual, MARRC75KR07091E Rev C