ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Simulating the robot using moveit

asked 2018-11-09 04:43:54 -0600

mvish7 gravatar image

Hello Robotics Community,

I'm an absolute beginner in this field so i request you to help me although the question seems very silly.

My task is to send the robot(in simulation) pose goal. I want to use to moveit framework. Previously i have used V-REP simulator and controlled a robot in V-REP using ROS node.

I want to do same by using moveit framework and gazebo simulator. I have already created the panda_moveit_config package but i dont know what to do next. My main questions are:

  1. Where can i keep my source file of ROS node(containing the code to control the robot)?
  2. How can i run the node and send command to robot model in Gazebo?

I'm looking forward to any tutorials or advice which will help me from environment setup till running the code. Any help is appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-09 07:20:58 -0600

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


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.

edit flag offensive delete link more



The new setup assistant automates almost all of this, but +1 for detailing all the steps.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-09 07:22:50 -0600 )edit

Wow that would have saved a few hours of my life. All of my goggling found a lot of ros_control tutorials but not this!

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-11-09 07:47:01 -0600 )edit

Thank you guys for this information. I'll try to follow the steps and post my conclusion here.

mvish7 gravatar image mvish7  ( 2018-11-09 07:51:02 -0600 )edit

@PeteBlackerThe3rd: it's not perfect though. One big limitation of the current implementation is that it converts xacro setups to a plain urdf. No way around that currently.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-09 08:19:36 -0600 )edit

@gvdhroorn i have followed all the steps from the new setup assistance but when i plan motion in moveit and execute it i see no movement in gazebo. Please find below all the steps i have followed:

mvish7 gravatar image mvish7  ( 2018-11-10 02:21:34 -0600 )edit
  • Created panda_moveit_config package, In panda_moveit_config package>ros controll screen>> add the Follow Joint Controllers for each planning group.
    • Generated the URDF file from simulation screen and saved it to in the config directory of package.
mvish7 gravatar image mvish7  ( 2018-11-10 02:24:19 -0600 )edit
  • launched rviz: roslaunch panda_moveit_config demo.launch
    • Launched gazebo empty scene: roslaunch gazebo_ros empty_world.launch paused:=true use_sim_time:=false gui:=true throttled:=false recording:=false debug:=true
mvish7 gravatar image mvish7  ( 2018-11-10 02:25:42 -0600 )edit
  • spawned the robot in gazebo using: rosrun gazebo_ros spawn_model -file </path_to_new_urdf> -urdf -x 0 -y 0 -z 1 -model panda
    • planned the motion in rviz using planning tab and pressed plan and execute,
    • am i doing something wrong? or am i missing something?
mvish7 gravatar image mvish7  ( 2018-11-10 02:29:35 -0600 )edit

Question Tools



Asked: 2018-11-09 04:43:54 -0600

Seen: 1,180 times

Last updated: Jan 10 '19