<> <> {{attachment:mtconnect_main_image.jpg}} == Overview == This stack is part of the [[Industrial|ROS Industrial]] and [[http://mtconnect.org|MTConnect]] programs. It contains packages that create a bridge between ROS and the MTConnect protocols. This page also contains information that covers the [[mtconnect_example|MTConnect example]] stack, which contains a sample implementation of a CNC and robot integration. == Installation == The installation of this stack requires both binary installations and installations from source. === Binary Installs === These instructions assume that you have already installed the Fuerte version of ROS. If you have not, see [[fuerte/Installation|here]] for detailed instructions. Ruby and the it's associated state machine library are required to run some scripts. {{{ sudo apt-get install ruby1.9.1 sudo gem install statemachine }}} The [[arm_navigation_experimental|arm navigation experimental]] and [[pr2-object-manipulation|PR2 object manipulation]] stacks are also required. The command below will pull down the stacks and any required dependencies. NOTE: The PR2 object manipulation is needed to satisfy dependencies for nodes/libraries that aren't really used. The dependency will likely be removed in the future. {{{ sudo apt-get install ros-fuerte-arm-navigation-experimental sudo apt-get install ros-fuerte-pr2-object-manipulation }}} The GUI application (not required, only used for example application) depends on the ROS Qt framework. If you wish to use the GUI, run the following {{{ sudo apt-get install ros-fuerte-qt-gui-core ros-fuerte-rqt }}} === Source Installs === It is easiest to create a single source directory in which all repositories are downloaded (ex: ~/ros/feurte). The [[Industrial|ROS-Industrial]], MTConnect ROS bridge, and MTConnect Agent libraries will all be downloaded. From the source directory enter the following: {{{ echo "Downloading repositories" svn checkout http://swri-ros-pkg.googlecode.com/svn/branches/fuerte_dev git clone git://github.com/mtconnect/ros_bridge.git git clone git://github.com/mtconnect/cppagent.git echo "Build MTConnect agents" mkdir agent_build cd agent_build cmake ../cppagent make echo "Build MTConnect ROS bridge and examples" roscd mtconnect_example rosmake }}} If you wish to use the sample GUI (not required, only used for example application) you will need to download some additional tools. {{{ echo "Downloading GUI tools" svn checkout https://alufr-ros-pkg.googlecode.com/svn/trunk/freiburg_tools echo "Building param edit gui plugin" roscd rosgui_paramedit rosmake }}} === Fanuc Controller Install === The repository contains Fanuc controller files (both KAREL and TP files). These are located in the mtconnect_cnc_robot_example package under the karel and tpe directories. All files in these directories must be compiled and installed on the Fanuc robot controller. === Configuration === The following environment variables must be defined in the ~/.bashrc file. Note, '''''' must be replaced with the source directory used above (ex: ~/ros/fuerte) {{{ ROS_PACKAGE_PATH=:$ROS_PACKAGE_PATH export MTCONNECT_AGENT_DIR=/agent_build/agent/ }}} == MTConnect Example == The [[mtconnect_example|MTConnect example]] stack contains sample integrations between a simulated cnc and robot. The Fanuc server (controller side) should be started first. Execute the ''ldr_mtc_i'' file using the Fanuc teach pendant. The following launch commands will bring up a simulated robot loading a CNC. The following command will start the ROS bridge, MTConnect agents, and CNC simulator. {{{ roslaunch mtconnect_ros_bridge mtconnect_ros_bridge_components.launch }}} Multiple terminal windows will be opened for the various agents and CNC simulator. In a separate terminal start the robot simulation (see option description below). {{{ roslaunch mtconnect_cnc_robot_example mtconnect_m16ib20_state_machine.launch