Develop Universal Robot (UR) in ROS: From Install to Demo

来源:互联网 发布:three.js 全景图切换 编辑:程序博客网 时间:2024/06/05 06:22

OS: Ubuntu 16.04.02 LTS x64
ROS: Kinetic
Robot: UR5

  • Download Source Codes
    • Download universal_robot source codes
    • Download ros_control package
    • Download ur_modern_driver
    • Replace the file ur_hardware_interfacecpp
  • Run a Demo

Download Source Codes

To begin with, create a new workspace or jump to your workspace.

mkdir -p ur_ws/srccd src

Download universal_robot source codes

You can download the source codes here.

git clone https://github.com/ros-industrial/universal_robot.git

This step may take some time.

Download ros_control package

The ros_control package is necessary when run your codes in a real hardware. To install it you can follow this website. Basic steps are given:

sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllerscd ur_ws/srcwstool initwstool merge https://raw.github.com/ros-controls/ros_control/kinetic-devel/ros_control.rosinstallwstool updatecd ..rosdep install --from-paths . --ignore-src --rosdistro kinetic -y

Download ur_modern_driver

There is a package named ur_driver in package universal_robot. However, it is of no use currently. The ur_modern_driver is the essential alternative. You can download it here.

cd src/universal_robotgit clone https://github.com/ThomasTimm/ur_modern_driver

Replace the file ur_hardware_interface.cpp

In Kinetic devel, there is also a small bug existing when build the workspace. To fix it, what you need to do is just replace the ur_hardware_interface.cpp with this one of the same name:

git clone https://github.com/philthinker/ur_hardware_interface

Finally, build it:

cd ../..catkin_makesource devel/setup.bash

Run a Demo

We focus on the simulation setup only. A demo is given by the source codes.

To bring up the simulated robot in Gazebo, run:

roslaunch ur_gazebo ur5.launch

For setting up the MoveIt! nodes to allow motion planning run:

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true

For starting up RViz with a configuration including the MoveIt! Motion Planning plugin run:

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

For efficiency, you can alternatively run:

roslaunch ur_gazebo ur5.launch limited:=trueroslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=trueroslaunch ur5_moveit_config moveit_rviz.launch config:=true

ur

There is also a simple demo:

roslaunch ur5_moveit_config demo.launch