# Revision history [back]

I have actually just worked through this process myself for the first time this week. It was a more painful process than I was expecting to be honest, hopefully these pointers will make it easier for you.

First if you haven't already you'll need to define the robot URDF file and run through the moveit setup assistant as described here. This will create a moveit package with the configuration and launch files needed to control the robot from the Moveit RVIZ plugin and a fake robot simulation (this doesn't simulate the actual robot, just the communication interfaces of the joints so that moveit can be demonstrated without a real robot or full simulation of the robot. The demo.launch file that is created will bringup the RVIZ gui and allow you to experiment with planning.

Now you need to update your URDF file so it can be used in Gazebo. At a minimum this means adding the physical properties of each link of your robot, Mass, COG and inertia tensor. To control the joints you'll also need to add the gazebo_ros_control plugin and a transmission for each joint as described in this tutorial here.

The following sections is where the documentation got more confusing for me. Essentially you now need to setup a ros_control trajectory controller to link to the gazebo joints and control them while exposing the joint_status and joint_trajectory interfaces needed by Moveit to interface with the Gazebo simulated robot.

You'll need to install the ros_control package and the controller collection if you haven't already. This can be done using apt-get as below:

sudo apt_get install ros-<version>-ros_control ros-<version>-ros-controllers


For this I ended up reverse engineering this gazebo simulation of the UR5 on github. You can download the repository of my own work this week from my github here. If you clone this repo and run the command it should bring up the gazebo simulation and RVIZ with the moveit plugin all working (hopefully).

roslaunch flat_bot_moveit moveit_planning_execution.launch sim:=true

I'm going to try and list all the changes you'll need to make to the auto-generated moveit package to get this working (I not remember everything tbh, but hopefully I'll be close).

You'll have to add/create the following YAML files with the names of the joints in your arm

/config/arm_controller.yaml
/config/controllers.yaml
/config/joint_names.yaml


copy the /launch/moveit_planning_execution.launch file and update the package names to match your moveit pacakge and robot support packages.

Hopefully this will get this going in the right direction. Let us know if you have any problems getting this going, and we'll help you sort them out.