OS: Ubuntu 16.04.02 LTS x64
ROS: Kinetic
Robot: UR5
Download Source Codes
To begin with, create a new workspace or jump to your workspace.
mkdir -p ur_ws/src
cd 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-controllers
cd ur_ws/src
wstool init
wstool merge https://raw.github.com/ros-controls/ros_control/kinetic-devel/ros_control.rosinstall
wstool update
cd ..
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_robot
git 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_make
source 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:=true
roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=true
roslaunch ur5_moveit_config moveit_rviz.launch config:=true
There is also a simple demo:
roslaunch ur5_moveit_config demo.launch